Fmriprep for mutliecho data (and tedana)

I haven’t seen any discussions on fmriprep+mutliecho+tedana for a while, has there be any movements in combining fmriprep and tedana?

For now, my approach is to use fmriprep on individual echo, then feed them to tedana.
I saw in some previous posts about using --echo-idx to prevent fmriprep from combining all echoes. But if you have three echoes, you can’t use --echo-idx 1 2 3. What is the proper argument when you have three echoes in func?


My func folder consists of (plus corresponding json files):

Using the following command seems to combine all the echoes:
PYTHONPATH="" singularity run
-B {MYPATH}/sub-026a/data:/data \ -B {MYPATH}/sub-026a/output:/output
-B {MYPATH}/sub-026a/work:/work \ -B {HOME}/license.txt:/license.txt
/data /output participant --participant-label sub-026
-w /work --fs-license-file /license.txt
–mem-mb 64000 --nthreads 10 --ignore ‘slicetiming’
–output-spaces MNI152Lin:res-2
–use-aroma -v


It’s definitely a long-term goal, but we’re not quite there yet. In terms of fMRIPrep integration, we’ve focused lately on dealing with reported issues with coverage in the T2*/optimal combination approach.

I would recommend against this approach. One key element of multi-echo processing is making sure that all echoes are processed the same way. Processing them independently may result in slightly different motion parameter, for example, by echo. I would recommend running fMRIPrep with the standard approach, including optimal combination, and then extracting the appropriate echo-wise results from the working directory. You can run tedana on those files, then apply the transforms that should be in the output directory to get the files in standard space. Here is some code that should do that, but may need to be adjusted.

This approach ignores distortion correction, which happens in native space but may impact scaling of values across echoes, but I would generally ignore that for simplicity’s sake. If you want to be extra careful, you can grab the files from before distortion correction, but that will require a lot more work.

I noticed that your command includes AROMA. It’s not ready yet, but we’re working on a pure Python implementation for AROMA (ME-ICA/aroma) and are trying to produce outputs in both AROMA and tedana that should make it easy to re-use decompositions and combine classifications from ICA-based denoising methods.

Hi @tsalo

Thanks for putting the script to extract minimally pre-processed individual echoes together. I’ve been using this script in the older versions of fMRIPrep and its been fantastic :slight_smile:

Recently, I updated to fMRIPrep v20.2.1, and realised the affine.txt which is generally in Temp/fmriprep_wf/single_sub_ID_wf/func_preproc_task_REST_echo_1_wf/bold_reg_wf/bbreg_wf/fsl2itk_fwd/ folder is missing. I’ve looked into other folders but can’t seem to fine the affine.txt file. I’ve also noticed that the fsl2itk folder is missing. Any idea where I could get this file from?

Thapa :slight_smile:

I believe that this is the transform we started saving to the output directory with nipreps/fmriprep#2233. It should have a name like sub-<subject_label>_[specifiers]_from-scanner_to-T1w_mode-image_xfm.txt.

I’m not sure where the other main transform (bold_hmc_wf/fsl2itk/mat2itk.txt) is stored in the current working directory, but it should be somewhere. Unfortunately, navigating fMRIPrep’s working directory will continue to be a moving target, since it’s really not meant to be a stable folder structure.

1 Like