Hi everyone,
I have encountered a perplexing error while running tedana. I acquired 167 EPIs with three echoes (TEs, in ms = 14, 31.28, 48.56). Prior to running tedana, per suggestions on the tedana website, I applied slice-timing correction to all three echo series. I estimated realignment parameters for the short echo and applied the estimated transformation matrices to respective volumes within the subsequent echoes. I derived a binary brain mask from the co-registered T1-MPRAGE and resliced the mask into EPI dimensions (68x68x45).
Last week, I ran the following tedana command with no problems:
tedana -d ~/epi/ammj_15_e1.nii ~/epi/ammj_15_e2.nii ~/epi/ammj_15_e3.nii -e 14 31.28 48.56 --out-dir ~/epi/tedana --mask ~/struc/mask.nii
This week, however, I tried the same command on the exact same data (not recomputed data, files unchanged from before successful tedana run) and encountered this error:
INFO io:init:106 Generating figures directory: ~/epi/tedana/figures
INFO tedana:tedana_workflow:536 Using user-defined mask
INFO tedana:tedana_workflow:584 Computing T2* map
INFO combine:make_optcom:242 Optimally combining data with voxel-wise T2* estimates
INFO tedana:tedana_workflow:609 Writing optimally combined data set: ~/epi/tedana/desc-optcom_bold.nii.gz
INFO pca:tedpca:227 Computing PCA of optimally combined multi-echo data
INFO collect:generate_metrics:123 Calculating weight maps
INFO collect:generate_metrics:132 Calculating parameter estimate maps for optimally combined data
INFO collect:generate_metrics:145 Calculating z-statistic maps
INFO collect:generate_metrics:155 Calculating F-statistic maps
INFO collect:generate_metrics:165 Thresholding z-statistic maps
INFO collect:generate_metrics:172 Calculating T2* F-statistic maps
INFO collect:generate_metrics:179 Calculating S0 F-statistic maps
INFO collect:generate_metrics:187 Counting significant voxels in T2* F-statistic maps
INFO collect:generate_metrics:193 Counting significant voxels in S0 F-statistic maps
INFO collect:generate_metrics:200 Thresholding optimal combination beta maps to match T2* F-statistic maps
INFO collect:generate_metrics:206 Thresholding optimal combination beta maps to match S0 F-statistic maps
INFO collect:generate_metrics:213 Calculating kappa and rho
INFO collect:generate_metrics:222 Calculating variance explained
INFO collect:generate_metrics:228 Calculating normalized variance explained
INFO collect:generate_metrics:236 Calculating DSI between thresholded T2* F-statistic and optimal combination beta maps
/usr/lib/python3.6/site-packages/tedana/utils.py:211: RuntimeWarning: invalid value encountered in true_divide
dsi = (2.0 * intersection.sum(axis=axis)) / arr_sum
INFO collect:generate_metrics:247 Calculating DSI between thresholded S0 F-statistic and optimal combination beta maps
INFO collect:generate_metrics:257 Calculating signal-noise t-statistics
INFO collect:generate_metrics:295 Counting significant noise voxels from z-statistic maps
INFO collect:generate_metrics:306 Calculating decision table score
INFO pca:tedpca:314 Selected 19 components with mdl dimensionality detection
Traceback (most recent call last):
File “/usr/bin/tedana”, line 8, in
sys.exit(_main())
File “/usr/lib/python3.6/site-packages/tedana/workflows/tedana.py”, line 905, in _main
tedana_workflow(**kwargs)
File “/usr/lib/python3.6/site-packages/tedana/workflows/tedana.py”, line 638, in tedana_workflow
dd, n_components, seed, maxit, maxrestart=(maxrestart - n_restarts)
File “/usr/lib/python3.6/site-packages/tedana/decomposition/ica.py”, line 71, in tedica
ica.fit(data)
File “/usr/lib64/python3.6/site-packages/sklearn/decomposition/_fastica.py”, line 574, in fit
self._fit(X, compute_sources=False)
File “/usr/lib64/python3.6/site-packages/sklearn/decomposition/_fastica.py”, line 512, in _fit
W, n_iter = _ica_par(X1, **kwargs)
File “/usr/lib64/python3.6/site-packages/sklearn/decomposition/_fastica.py”, line 110, in _ica_par
- g_wtx[:, np.newaxis] * W)
File “/usr/lib64/python3.6/site-packages/sklearn/decomposition/_fastica.py”, line 57, in _sym_decorrelation
s, u = linalg.eigh(np.dot(W, W.T))
File “/usr/lib64/python3.6/site-packages/scipy/linalg/decomp.py”, line 374, in eigh
a1 = _asarray_validated(a, check_finite=check_finite)
File “/usr/lib64/python3.6/site-packages/scipy/_lib/_util.py”, line 239, in _asarray_validated
a = toarray(a)
File “/usr/lib64/python3.6/site-packages/numpy/lib/function_base.py”, line 496, in asarray_chkfinite
“array must not contain infs or NaNs”)
ValueError: array must not contain infs or NaNs
From the tedana*.tsv file generated during the successful run I can figure that this occurs during ica.tedica. The following images are generated by tedana prior to the error: 1) S0map.nii.gz, 2) T2starmap.nii.gz, 3) desc-optcom_bold.nii.gz, 4) desc-adaptiveGoodSignal_mask.nii.gz. Comparing these files between the successful run with the unsuccessful run, I confirmed that the values are identical.
However, desc-PCA_stat-z_components.nii.gz differs between the runs. The preceding step, pca.tedpca, returns a different number of components between the runs (successful run: 25, unsuccessful run: 19). It is not clear to me what causes this discrepancy.
No software was changed/updated. As I mentioned, imaging data are the same. I would greatly appreciate any suggestions as to what is causing this problem or how to solve it.
Kind regards,
Patrick