Tedana ICA fails to converge

Hi

I’m running tedana on a 3 echo data set that has been distortion corrected with either fugue or topup – the undistorted images look correct. The ICA step fails to converge, and then tedana fails at the spatial clustering of components – how can I proceed with / fix this situation? Thanks.

Module duecredit not successfully imported due to “No module named ‘duecredit’”. Package functionality unaffected.
/mnt/home/keschenb/anaconda3/lib/python3.6/site-packages/sklearn/externals/joblib/ init .py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.
23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serializ
e those models with scikit-learn 0.21+.
warnings.warn(msg, category=DeprecationWarning)
INFO:tedana.workflows.tedana:Using output directory: ./ME3/fugue
INFO:tedana.workflows.tedana:Loading input data: [‘rest_e1_pos_undistorted.nii.gz’, ‘rest_e2_pos_undistorted.nii.g
z’, ‘rest_e3_pos_undistorted.nii.gz’]
INFO:tedana.workflows.tedana:Using user-defined mask
INFO:tedana.workflows.tedana:Computing T2* map
INFO:tedana.combine:Optimally combining data with voxel-wise T2 estimates
INFO:tedana.decomposition.eigendecomp:Computing PCA of optimally combined multi-echo data
INFO:tedana.decomposition.eigendecomp:Loading PCA from: pcastate.pkl
INFO:tedana.decomposition.eigendecomp:Selected 149 components with MLE dimensionality detection
WARNING:tedana.decomposition.eigendecomp:ICA attempt 1 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 43
WARNING:tedana.decomposition.eigendecomp:ICA attempt 2 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 44
WARNING:tedana.decomposition.eigendecomp:ICA attempt 3 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 45
WARNING:tedana.decomposition.eigendecomp:ICA attempt 4 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 46
WARNING:tedana.decomposition.eigendecomp:ICA attempt 5 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 47
WARNING:tedana.decomposition.eigendecomp:ICA attempt 6 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 48
WARNING:tedana.decomposition.eigendecomp:ICA attempt 7 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 49
WARNING:tedana.decomposition.eigendecomp:ICA attempt 8 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 50
WARNING:tedana.decomposition.eigendecomp:ICA attempt 9 failed to converge after 500 iterations
WARNING:tedana.decomposition.eigendecomp:Random seed updated to 51
WARNING:tedana.decomposition.eigendecomp:ICA attempt 10 failed to converge after 500 iterations
INFO:tedana.workflows.tedana:Making second component selection guess from ICA results
INFO:tedana.combine:Optimally combining data with voxel-wise T2 estimates
INFO:tedana.model.fit:Fitting TE- and S0-dependent models to components
INFO:tedana.model.fit:Performing spatial clustering of components
Traceback (most recent call last):
File “/mnt/home/keschenb/anaconda3/bin/tedana”, line 10, in
sys.exit(_main())
File “/mnt/home/keschenb/anaconda3/lib/python3.6/site-packages/tedana/workflows/tedana.py”, line 453, in _main
tedana_workflow(**vars(options))
File “/mnt/home/keschenb/anaconda3/lib/python3.6/site-packages/tedana/workflows/tedana.py”, line 379, in tedana_workflow
n_echos)
File “/mnt/home/keschenb/anaconda3/lib/python3.6/site-packages/tedana/selection/select_comps.py”, line 276, in selcomps
np.min(comptable.loc[acc_prov, ‘variance explained’])))
ZeroDivisionError: float division by zero

Hey @keschenb

I’ve responded on GitHub to this, but will reply here as well incase it helps other folks in the future.

First things:
Were the data also motion and slice time corrected, as well as distortion corrected? Additionally, what were the echo times, TR, field of view - just to get a better idea of the data?

Also, does the T2* map look appropriate - does it have the shape of your data/ a brain? In other words, does it include the data you expect it to include? Does it have reasonable values (at 3T, a range from 14 to 70 in the cortex could be called reasonable).

You can also look at the optimally combined data - this should look like you input data - except less noisy due to averaging. Anything strange in that?

Also perhaps you could tag this as multi-echo, may attract the attention of the other developers.

Hi @dowdlelt

The data were motion corrected and distortion corrected – I didn’t do slice-timing correction in this case. The echo times for this acquisition were 20, 41.4, and 62.2, with a TR of 2000ms, and FOV of 126x240.

The T2* map looks appropriate, as does the optimally combined map (in this case, I’m looking at the dn_ts_OC.nii image) – it does in fact look less noisy than the original images.

Interestingly, I have a few different multi-echo schemes that I’m looking at – some of these fail entirely (as with the above error message) and others proceed to completion but with ICA attempts that never converge. Why might this be the case?

Thanks.

kristian

Hmm - well it doesn’t seem to be something simple. A few other thoughts…

Distortion correction may be smoothing the data a little bit - so that could causing a little bit of trouble. May be worth trying without that.

Is this 3T data? Those echo times seem a little late to me, with just three echoes, and one being at 62.2 ms just may be adding a lot of noise to the data. Average values for 3 echoes at 3T are ~13, 29.3, 45.6

Given a TR of 2s, it may be worth it to try with slice timing correction.

Did you have 150 volumes? Given that it selected 149 components - ICA is probably not converging because the alg. selected too many components. Given the late echo, maybe try using kundu or kundu-stabilize for --tedpca. (https://tedana.readthedocs.io/en/latest/usage.html) could lead to better results.

An unfortunate number of possibilities. I would test kundu-stabilize first - as it may make the # of PCs more reasonable. Also, there should be another tedana release soon, so testing with the latest version could also help.

I’m still thinking on why it failed - convergence isn’t required, its just desirable. I may be missing something obvious in the error.

Yes – the data were acquired on a 3T Philips Ingenia. This scan had 150 volumes, with a multi-band factor of 2, SENSE factor of 2.5, and voxel size of 3mm. For each of the acquisitions, the parameters were optimized such that total scan time was 5 minutes.

I’ll test adding slice-timing correction.

Thanks.

k

We don’t recommend distortion correction. You can read more about that here. I believe it causes a combination of smoothing and scaling, hopefully someone more experienced can correct me if I’m wrong. A TR of 2 seconds is also pretty long to do without slice-time correction, so I second @dowdlelt’s suggestion.
I actually think this is also a bug, we shouldn’t be getting an error with 0-divides.

Hi @keschenb

Could you please share your tedana call ? It would help to know your exact configuration to debug performance.

I’d also second @dowdlelt’s recommendation to try and update the PCA algorithm to kundu-stablize.

Let us know how it goes !

Thanks,

Elizabeth

HI @emdupre

My tedana call for this subject was:

in_files=“rest_e1_pos_undistorted.nii.gz rest_e2_pos_undistorted.nii.gz rest_e3_pos_undistorted.nii.gz”

tedana -d ${in_files} -e 20 41.1 62.2 --mask rest_e1_pos_fbrain.nii.gz --tedpca mle --png --out-dir ./tedana_mle_500_10/

I have a set of subjects, each with test-retest data, and each with 3 different multi-echo acquisition schemes (each acquisition scheme has a different TR, different TEs, different multi-band factor > 1, and different SENSE factor).

My main issue is that, for the same acquisition scheme with the same Tedana parameters,

  1. Some subjects produce Tedana errors (like the variance error above)
  2. Some subjects run to completion, but with warnings such as “No BOLD-like components detected”
  3. Some subjects are accurately denoised (no convergence issues, no warnings, no errors).

Thanks for the help.

k