fMRI Prep+tedana

Hi NeuroStars,

I have a question related to tedana on ME data preprocessed via fMRIPrep.

I am currently trying to run tedana on the “bold-space-MNI152NLin2009cAsym_preproc.nii.gz” files for e1, e2 and e3. However, I get the following error: " ValueError: Found array with 0 sample(s) (shape=(0,)) while a minimum of 1 is required."

Any idea why?

Thanks in advance for your help/advice :slight_smile:

Hi TribikramT,

Would you mind sharing the full traceback for the error, as well as the version of tedana that you used and the command you used to call tedana?

Taylor

Hi Taylor,

Thank you for your reply. Below is the command, the full traceback with details of the loaded modules, and the error:

"tedana -d sub-PILOT009_task-pseudo_seq_stim_echo-1_bold_space-MNI152NLin2009cAsym_preproc.nii.gz sub-PILOT009_task-pseudo_seq_stim_echo-2_bold_space-MNI152NLin2009cAsym_preproc.nii.gz sub-PILOT009_task-pseudo_seq_stim_echo-3_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -e 15 31.07 47.14 --label MRH046_PILOT009_Pseudo_Stim_tedana

/usr/local/anaconda/5.1.0-Python3.6-gcc5/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
/home/ttha0011/.local/lib/python3.6/site-packages/tedana/model/fit.py:161: RuntimeWarning: invalid value encountered in true_divide
F_S0 = (alpha - SSE_S0) * (n_echos - 1) / (SSE_S0)
/home/ttha0011/.local/lib/python3.6/site-packages/tedana/model/fit.py:168: RuntimeWarning: invalid value encountered in true_divide
F_R2 = (alpha - SSE_R2) * (n_echos - 1) / (SSE_R2)
/home/ttha0011/.local/lib/python3.6/site-packages/tedana/model/fit.py:177: RuntimeWarning: invalid value encountered in greater
F_S0[F_S0 > F_MAX] = F_MAX
/home/ttha0011/.local/lib/python3.6/site-packages/tedana/model/fit.py:178: RuntimeWarning: invalid value encountered in greater
F_R2[F_R2 > F_MAX] = F_MAX
/home/ttha0011/.local/lib/python3.6/site-packages/tedana/model/fit.py:161: RuntimeWarning: divide by zero encountered in true_divide
F_S0 = (alpha - SSE_S0) * (n_echos - 1) / (SSE_S0)
/usr/local/anaconda/5.1.0-Python3.6-gcc5/lib/python3.6/site-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_sel ection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
“This module will be removed in 0.20.”, DeprecationWarning)
/usr/local/anaconda/5.1.0-Python3.6-gcc5/lib/python3.6/site-packages/sklearn/grid_search.py:42: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selectio n module into which all the refactored classes and functions are moved. This module will be removed in 0.20.
DeprecationWarning)
/usr/local/anaconda/5.1.0-Python3.6-gcc5/lib/python3.6/site-packages/sklearn/learning_curve.py:22: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selec tion module into which all the functions are moved. This module will be removed in 0.20
DeprecationWarning)
Traceback (most recent call last):
File “/home/ttha0011/.local/bin/tedana”, line 11, in
sys.exit(_main())
File “/home/ttha0011/.local/lib/python3.6/site-packages/tedana/workflows/tedana.py”, line 447, in _main
tedana_workflow(**vars(options))
File “/home/ttha0011/.local/lib/python3.6/site-packages/tedana/workflows/tedana.py”, line 412, in tedana_workflow
filecsdata=filecsdata)
File “/home/ttha0011/.local/lib/python3.6/site-packages/tedana/selection/select_comps.py”, line 570, in selcomps
acc_comps > KRcut]) == 3]
File “/home/ttha0011/.local/lib/python3.6/site-packages/tedana/utils/utils.py”, line 517, in andb
arrs = [check_array(arr, dtype=int, ensure_2d=False, allow_nd=True) for arr in arrs]
File “/home/ttha0011/.local/lib/python3.6/site-packages/tedana/utils/utils.py”, line 517, in
arrs = [check_array(arr, dtype=int, ensure_2d=False, allow_nd=True) for arr in arrs]
File “/usr/local/anaconda/5.1.0-Python3.6-gcc5/lib/python3.6/site-packages/sklearn/utils/validation.py”, line 462, in check_array
context))
ValueError: Found array with 0 sample(s) (shape=(0,)) while a minimum of 1 is required "

Cheers,
Thapa :slight_smile:

Hi Thapa,

From what I can tell, andb (which really just sums arrays) is throwing the error because at least one of the arrays being fed into it is empty. I’m pretty sure that all of the arrays will be empty, since all of the arrays should be 1D boolean arrays of the same length. If that’s the case, then it’s breaking because there are no accepted components, even though this is just after the first pass at component selection.

Off the top of my head, there are two things that might be causing this. First, fMRIPrep may rescale the echoes separately, which would invalidate the TE-dependence and -independence models that are fit to the data and used to classify components. Elizabeth DuPre and others are working to integrate the full tedana denoising process into fMRIPrep in this PR. The second possibility is that too few components are being retained by the PCA step, which could also be caused by the scaling of the echo-specific files.

Unfortunately, full tedana integration into fMRIPrep may take a while, so if you need to process these data soon, then it might be better to use a pipeline like afni_proc for now.

1 Like

Hi Taylor,

Thank you for your reply, and insight into what could be happening with the dataset.

I will look into the afni_proc pipeline, and integrate that with my current approach.

Much appreciated.
Thapa :slight_smile: