NaN in tcompcor

Keep running into an issue when running one of the individuals in my data set: looks to me like it’s trying to grab a NaN while generating the tcompcor output and throwing an error. Any way around this, or is this participant unusable?

Node inputs:

components_file = tcompcor.tsv
failure_mode = NaN
header_prefix = t_comp_cor_
high_pass_cutoff = 128.0
ignore_initial_volumes = 0
mask_files = [’/ufrc/camctrp/working/mark.britton/scripts/work/fmriprep_wf/single_subject_057_wf/func_preproc_ses_01_task_nback_wf/bold_confounds_wf/tcc_tfm/sub-057_ses-01_T1w_template_ras_valid_corrected_xform_rbrainmask_eroded_trans_boldmsk.nii’]
mask_index =
mask_names =
merge_method =
num_components =
percentile_threshold = 0.05
pre_filter = cosine
realigned_file = /ufrc/camctrp/working/mark.britton/scripts/work/fmriprep_wf/single_subject_057_wf/func_preproc_ses_01_task_nback_wf/bold_bold_trans_wf/merge/vol0000_xform-00000_merged.nii.gz
regress_poly_degree = 1
repetition_time = 3.0
save_metadata = True
save_pre_filter = True
use_regress_poly =
variance_threshold = 0.5

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/”, line 69, in run_node
result[‘result’] =
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/”, line 472, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/”, line 563, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/”, line 643, in _run_command
result =
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/”, line 375, in run
runtime = self._run_interface(runtime)
File “/usr/local/miniconda/lib/python3.7/site-packages/niworkflows/interfaces/”, line 51, in _run_interface
runtime = super(RobustTCompCor, self)._run_interface(runtime)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/algorithms/”, line 560, in _run_interface
mask_images = self._process_masks(mask_images, imgseries.get_data())
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/algorithms/”, line 760, in _process_masks
(1. - self.inputs.percentile_threshold)).astype(int))
File “/usr/local/miniconda/lib/python3.7/site-packages/numpy/lib/”, line 3540, in percentile
a, q, axis, out, overwrite_input, interpolation, keepdims)
File “/usr/local/miniconda/lib/python3.7/site-packages/numpy/lib/”, line 3652, in _quantile_unchecked
File “/usr/local/miniconda/lib/python3.7/site-packages/numpy/lib/”, line 3250, in _ureduce
r = func(a, **kwargs)
File “/usr/local/miniconda/lib/python3.7/site-packages/numpy/lib/”, line 3767, in _quantile_ureduce_func
x1 = take(ap, indices_below, axis=axis) * weights_below
File “/usr/local/miniconda/lib/python3.7/site-packages/numpy/core/”, line 181, in take
return _wrapfunc(a, ‘take’, indices, axis=axis, out=out, mode=mode)
File “/usr/local/miniconda/lib/python3.7/site-packages/numpy/core/”, line 51, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.

Hi, what version of fMRIPrep are you using?

Hi! I’m using v1.4.0a1.


Can you confirm whether this persists in fMRIPrep 1.5.4?

Might take a few days to get the newest version up and running on our end, but I can certainly give it a shot. Is this a known bug in earlier versions?

IndexError: cannot do a non-empty take from an empty axes. has shown up before. I don’t know for a fact that this is for the same reason, but it’s best to try to see if a new version has already fixed a bug before we do a deep dive.

1 Like

Looks like that resolved the issue. Thanks!