Running fmriprep, tedana, and xcp_d

Hi all, I’m hoping to preprocess a dataset using a combination of fmriprep, tedana, and xcp_d. It is my understanding that there’s plans for these software packages to become better integrated, but for now things are a bit disjointed. I think I’ve figured out what I need to do, so I’m mostly hoping that someone can confirm if this is right (or let me know if there’s a much easier way and/or if someone has a script I can adopt).

Preprocessing steps:

  1. Run fmriprep using the --me-output-echos argument
  2. Run tedana on the fmriprep outputs
  3. Take the optimally combined (but not denoised) tedana output, and warp it to a standard space using an fmriprep transformation matrix (perhaps using the script on this page, under “Warping scanner-space fMRIPrep outputs to standard space”).
  4. Take the tedana ICA mixing tsv file, and rename the components that are classified as signal (from the metrics tsv file) such that they start with signal__
  5. Run xcp_d with the -c argument, specifying the edited ICA mixing file (to regress out the rejected ICs, but make sure they’re orthogonalized with respect to the signal regressors)
  6. Rejoice

Obviously some quality checking can occur in between steps to make sure the outputs are all sensible.

Hopefully I haven’t completely misunderstood everything! Let me know if anyone has any thoughts.



This step is not necessary, as long as you include your target space in your fMRIPrep output-spaces. The “desc-preproc” output is the optimally combined data.

Other than that, your workflow looks solid.

Thanks for the reply. Am I correct in understanding that fmriprep generates the optimally combined data, and tedana is solely for generating noise regressors - i.e., tedana’s optimally combined output is redundant if I’m also running fmriprep?

That’s correct. fMRIPrep is actually using tedana’s t2smap workflow to create its optimally combined output in native space (which it then warps to your selected output spaces), so the optimally combined data come from the same process for both fMRIPrep and the tedana ME-ICA pipeline.