Tedana denoising package: numeric error in T2* map calculation

Dear developers

The research group I am part of has successfully used the TE-dependent analysis workflow (tedana; https://tedana.readthedocs.io/en/latest/index.html) in our two new fMRI studies. However, we encountered an error in the calculation of the T2* map when submitting one of the scanning runs to tedana. The raw and preprocessed fMRI data of that run is here: https://uoe-my.sharepoint.com/:f:/g/personal/atamm2_ed_ac_uk/EtY4q_wir9pNgCdTrdjX5MUB5pso8j6mSsu4FiLeqRyBCA?e=d3aaBp

Would you have time to look at it and offer any suggestions for how to make tedana work? We used tedana version 0.0.7.

Before running tedana, we performed slice timing and motion correction using SPM12. Motion parameters were estimated using echo-1 images and then applied to corresponding volumes in echos 2 and 3. Tedana ran successfully (converged) for the three other scanning runs of the same participant. If you need any additional information or files, I am happy to provide these.

An additional observation: when I performed slice timing and motion correction separately for that run, tedana worked on that run. But when I performed slice timing and motion correction on all runs (such that the problematic run was resliced to the space of the first image of the first run), I encountered that error. Upon visual inspection, images from different runs did not seem to be very differently positioned, so I’m not sure why including all runs in motion correction makes a difference (the images of other runs are currently not included in the folder). A possible workaround is to perform motion and slice timing correction separately for that run, and later realign the dn_ts_OC image of that run to the dn_ts_OC images of other runs, but I wonder if it would be possible to fix the issue with tedana without a workaround.

Many thanks for your help
Andres Tamm

Research Assistant
Department of Psychology
The University of Edinburgh


Error message that I received on my Windows computer

tedana -d rasub-23_task-ProdR_run-1_echo-1_bold.nii rasub-23_task-ProdR_run-1_echo-2_bold.nii rasub-23_task-ProdR_run-1_echo-3_bold.nii -e 13.00 31.26 49.52 --mask sub-23_mask-comb_spm.nii --maxit 500 --maxrestart 15 --out-dir tedana_task-ProdR_run-1 --png
Module duecredit not successfully imported due to “No module named ‘duecredit’”. Package functionality unaffected.
INFO:tedana.workflows.tedana:Using output directory: Z:…\sub-23\func\tedana_task-ProdR_run-1
INFO:tedana.workflows.tedana:Loading input data: [‘rasub-23_task-ProdR_run-1_echo-1_bold.nii’, ‘rasub-23_task-ProdR_run-1_echo-2_bold.nii’, ‘rasub-23_task-ProdR_run-1_echo-3_bold.nii’]
INFO:tedana.workflows.tedana:Using user-defined mask
WARNING:tedana.utils:254 voxels in user-defined mask do not have good signal. Removing voxels from mask.
INFO:tedana.workflows.tedana:Computing T2* map
c:\users…\appdata\local\continuum\anaconda3\lib\site-packages\tedana\decay.py:85: RuntimeWarning: invalid value encountered in log
log_data = np.log((np.abs(data[:, :echo + 1, :]) + 1).reshape(len(data), -1).T)

Intel MKL ERROR: Parameter 6 was incorrect on entry to DGELSD.
Traceback (most recent call last):
File “c:\users…\appdata\local\continuum\anaconda3\lib\runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “c:\users…\appdata\local\continuum\anaconda3\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Users…\AppData\Local\Continuum\anaconda3\Scripts\tedana.exe_main
.py", line 9, in
File “c:\users…\appdata\local\continuum\anaconda3\lib\site-packages\tedana\workflows\tedana.py”, line 453, in _main
tedana_workflow(**vars(options))
File “c:\users…\appdata\local\continuum\anaconda3\lib\site-packages\tedana\workflows\tedana.py”, line 327, in tedana_workflow
t2s, s0, t2ss, s0s, t2sG, s0G = decay.fit_decay(catd, tes, mask, masksum)
File “c:\users…\appdata\local\continuum\anaconda3\lib\site-packages\tedana\decay.py”, line 90, in fit_decay
betas = np.linalg.lstsq(X, log_data, rcond=None)[0]
File “c:\users…\appdata\local\continuum\anaconda3\lib\site-packages\numpy\linalg\linalg.py”, line 2156, in lstsq
x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
File “c:\users…\appdata\local\continuum\anaconda3\lib\site-packages\numpy\linalg\linalg.py”, line 101, in _raise_linalgerror_lstsq
raise LinAlgError(“SVD did not converge in Linear Least Squares”)
numpy.linalg.linalg.LinAlgError: SVD did not converge in Linear Least Squares


Error message that I received on a Linux cluster

/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/decomposition/_utils.py:43: RuntimeWarning: invalid value encountered in greater
imask[np.logical_and(m > lthr, m < hthr), ee] = True
/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/decomposition/_utils.py:43: RuntimeWarning: invalid value encountered in less
imask[np.logical_and(m > lthr, m < hthr), ee] = True
/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/model/fit.py:334: RuntimeWarning: invalid value encountered in less
data_R[data_R < -0.999] = -0.999
/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/model/fit.py:335: RuntimeWarning: invalid value encountered in greater
data_R[data_R > 0.999] = 0.999
Traceback (most recent call last):
File “/exports/eddie/scratch/…/speaklisten/tedana-venv/bin/tedana”, line 10, in
sys.exit(_main())
File “/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/workflows/tedana.py”, line 453, in _main
tedana_workflow(**vars(options))
File “/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/workflows/tedana.py”, line 358, in tedana_workflow
verbose=verbose)
File “/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/decomposition/eigendecomp.py”, line 325, in tedpca
verbose=verbose)
File “/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/model/fit.py”, line 120, in fitmodels_direct
axis=1))
File “/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/tedana/model/fit.py”, line 399, in get_coeffs
betas = np.linalg.lstsq(X, mdata, rcond=None)[0].T
File “/exports/eddie/scratch/…/speaklisten/tedana-venv/lib/python3.5/site-packages/numpy/linalg/linalg.py”, line 2236, in lstsq
x, resids, rank, s = gufunc(a, b, rcond, signature=signature, extobj=extobj)
ValueError: On entry to DLASCL parameter number 4 had an illegal value

MANAGED BY INCF