I have a task and resting multi-echo datasets. Very nice to see that fmriprep now has a multiecho pipeline. However, as far as I can see, fmriprep does not yet apply multiecho ICA denoising. For this, I would still be required to use tedana. My query is regarding the optimal pipeline for processing my multiecho datasets with me-ica denoising.
Does the following approach sound sensible:
Use fmriprep to perform slice-timing correction on multiecho dataset.
Use tedana to optimally combine multiecho-data and perform ICA denoising, removing motion, physiology, etc⌠non-bold components.
Feed optimally combined and denoised multiecho data to fmriprep for normalisation and distortion correction using field map.
Please let me know if this sounds like a sensible approach, or whether there is an imminent release of fmriprep with me-ica denoising.
Thank you in advance for your help.
Kind regards,
Gershon.
I know that @emdupre is working on integrating multi-echo denoising (in addition to optimal combination) with tedana into fMRIPrep, but thatâs a little ways out.
I agree that, in the mean time, it makes sense to use fMRIPrep and tedana separately, but within the same overall pipeline. However, Iâm not sure about the details of your approach. Specifically, I donât think you can break fMRIPrep into separate parts like that.
The approach weâre planning to take in a tedana analysis is to run fMRIPrep and then to grab native-space partially preprocessed data (i.e., post STC and HMC) from the fMRIPrep working directory. Weâll then feed those data through tedana and finally apply fMRIPrepâs calculated transforms for coregistration and normalization. We havenât completed the code to do this yet, but I believe that itâs all doable. The overall pipeline is the same as yours, but doesnât require stopping and restarting fMRIPrep.
Thank you for the helpful reply. It is good to know that integration of multi-echo denoising and fmriprep is on its way. Do you know what the timeline for this might be?
In the mean time, I wonder whether we might not just be able to obtain some partially processed images from fmriprep. For example, echo1_bold_hmc_stc, echo2_bold_hmc_stc, echo3_bold_hmc_stc and feed these files into tedana.
I take it tedana would then output a combined file of denoised optimally combined echos. Could I then feed this one file into fmriprep, to complete the SDC, normalisation etc�
Just as a note, I am new to tedana and fmriprep so I may be naive to certain aspects of the workflow/pipeline.
The first files that you should be able to access (which will be stored in the working directory, I think) should be the data in native space, after slice timing correction, motion correction, and distortion correction. You can take those, run tedana on them, and then use coregistration and normalization warp files, saved by fMRIPrep, to transform the denoised data into standard space. I donât think that you can submit partially processed data into fMRIPrep without it re-running the entire pipeline.
So the only difference from your proposed approach is that you would apply the final transforms, originally estimated by fMRIPrep, yourself instead of re-submitting the denoised data to fMRIPrep to have it do them. That said, I think SDC will have to be performed before tedana, although I could be wrong.
Thank you thus far for your help setting up a pipeline using fmriprep. I have managed to get fmriprep to run, though I have a few things that are still not working correctly. I was wondering whether you had any thoughts.
Pipeline:
BIDS directory: This was setup using heudiconv for BIDS directory. I a customised heuristic file to, largely, set up my directory as required. Ie., my multiecho files were individual list in /func folder. However, my sbref images were labeled with rec_magnitude for each echo image. I relabeled these to align with the labels for echo images. I have attached my heuristic file as well as an image for reference.
fmriprep: I then used this BIDS directory in the fmriprep analysis pipeline (code used is attached). I managed for this to run successfully on our cluster using singularity. However, it seems as though only echo 1 was processedâI see no optimically combined image and cannot locate the minimally preprocessed echo images in my working directory that I would like to feed into tedana. Moreover, fmriprep is not recognising the I have a fieldmap in /fmap folder and sbref images for each echo. Any ideas why fmriprep is skipping these images?
Please let me know if you would like for me to attach anything else, please let me know.
I donât believe that fMRIPrep labels the output preprocessed file as âoptimally combined,â but it shouldnât have echo-1 in the filename. Is that the case?
Currently, fMRIPrep doesnât output the echo-specific images, which is why we recommend collecting the relevant files from fMRIPrepâs working directory and moving them into the output directory. We have some provisional code available here, although itâs currently just a notebook tailored to our project. We plan to convert it into a more general function soon, but you can almost certainly adapt it yourself to work with your own data structure. We have tested the code (and it looks good), but havenât checked too deeply against fMRIPrepâs code, so weâre not 100% sure weâre grabbing the right files.
Regarding the field maps, it looks like youâre using --force-syn. That would force fMRIPrep to use field map-less distortion correction. Iâm not sure about the sbref files. Are you sure itâs not using them? Can you share the captured stdout?
However, when I go to the output directory the files are not labeled with âechoâŚâ. For example, fmriprep/sub-018/ses-001/func/sub-018_ses-001_task-faces_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
Does this mean that the html report and working file label is indicating the echo-1 is being used as some reference, but actually the correct, optimally combined, images can be found in the output folder?
ie., the following image is the optimally combined image: sub-018_ses-001_task-faces_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz
I will examine your code and try to omit --force-syn.
I believe that the echo-1 is probably just an oversight in the naming. Even after the data are optimally combined across echoes, the working directory may store the files in folders with echo-1 in the name. The desc-preproc file in the output directory should definitely be the optimally combined, preprocessed data.
For example, the script points to the folder in the wf called âbold_to_mni_trans_wfâ, which does not seem to exist. I wonder if this has changed in subsequent version of fmriprep. I think I may have found the correct files in âop.join(task_dir, âbold_mni_trans_wfâ,âbold_to_mni_transform/_inputs.pklzâ)â, but not entirely sure.
Using these files, I create two files:
native_to-reference_mode-image_xfm.txt
reference_to-T1w_mode-image_xfm.txt
I then tried to use the following to files using ApplyTransform to warp my BOLD image in native space to MNI152NLin6Asym (as a sanity check prior to running tedana), but this did not work (ie, the command ran but not image was displayed).
I havenât had a chance to look into your question yet, but I just wanted to let you know itâs on our radar ! Hoping to have time next week to check-in. In the mean time, not sure if some fmriprep folks (maybe @effigies or @oesteban ?) would know about fmriprep updates in saving transforms as of v1.4.
Itâs unclear what files exactly you found and are trying to use, but a .txt file is not going to perform the warps needed to get you to the template space. We save the transform from T1w to template in the anat/ subdirectory, which should look something like:
It looks like youâre also using a BOLD image that hasnât been resampled in T1w space, so youâll probably need to dig up the affine transform from BOLD to T1w, which should be in something like:
Good newsâI am able to transform my tedana-processed denoised epi to standard space using the t1_2_standard and bold_2_t1 transforms.
However, because I apply pepolar sdc, I would also like to apply this to my tedana-processed image. I can see that fmriprep uses the _warpfieldQwap_PLUS_WARP_fixhdr.nii.gz
However, opening this image just provide an empty imageâjust a rectangle with all â0â. Is this correct? Including this to my transform has no effect on the image. ie., no SDC correction applied.
Iâm not positive of the filename used, but you should be able to find it in the ApplyTransform transforms list, so if thatâs what youâre seeing, then thatâs probably right.
Are you sure that itâs all zeros? e.g.,
import nibabel as nb
img = nb.load(fname)
print("Zeros: ", np.allclose(img.get_fdata(), 0))
If so, I would inspect your input fieldmaps to make sure that they look sensible. All zeros suggests to me that you have the exact same data in your reverse-PE fieldmap, but this is just an intuition. Iâm not as versed in the fieldmap components of the workflow as most of the rest.
I used the Apply Transform to hunt down the correct transforms:
For SDC it is: single_subject_002_wf/func_preproc_ses_001_task_fmritask_echo_1_wf/sdc_wf/pepolar_unwarp_wf/cphdr_warp/_warpfieldQwarp_PLUS_WARP_fixhdr.nii.gzâ
Using this file I return âFalseâ using the command you provided above.
I am using the following command for apply transform:
Sorry, to be clear, are you saying that this is working for you? It sounds like your reverse-PE EPI looks good, you have a non-zero fieldmap estimate, and are able to apply the transforms. If you need further assistance, please clarify.
Looking at the images again, I seem to be able to ârecoverâ to original preprocessed image from fmriprep. There are some differences, which I suspect are due to a different mask being applied in tedana. Ie., voxels are in same place in both images, but some voxels, o the outside of the brain are missing. Ie., looks like at some point tedana applies a tighter mask.
Hi Taylor and @emdupre,
I was reading through this string as I have ME data and am currently preprocessing with fMRIPrep (thanks for all of your work on the pipeline!). Iâm wondering - since this post was back in March '19 - how close is fMRIPrep with integrating multi-echo denoising? Just trying to figure out if itâs worth waiting until itâs integrated, or using fMRIPrep and tedana separately, but within the same pipeline as suggested here. Thanks so much for any thoughts and suggestions!
Best,
Nicole