Fmriprep: BOLD to T1w transformation

Created on 14 Jun 2020  路  6Comments  路  Source: nipreps/fmriprep

Dear developers,
I have run fMRIPrep on a multi-echo dataset using the latest release (20.1.1).
I am using the ME-ICA implemented in tedana for denoising. I ran tedana using echo-specific and partially preprocessed data (vol0000_xform-00000_merged.nii.gz), which I collected from the working directory of fMRIPrep. Now, I am trying to transform the output of tedana to the MNI space using the transformations saved by fMRIPrep.

antsApplyTransforms 鈥揹imensionality 3 \
    鈥搃nput-image-type 3 \
    鈥搃nput sub-01_ses-01_task-rest_space-native_desc-MEICA_bold.nii.gz \
    鈥揹efault-value 0 \
    鈥揻loat 1 \
    鈥搃nterpolation LanczosWindowedSinc \
    鈥搊utput sub-01_ses-01_task-rest_space-MNI152NLin6Asym_res-2_desc-MEICA_bold.nii.gz \
    鈥搑eference-image $HOME/.cache/templateflow/tpl-MNI152NLin6Asym_res-02_T1w.nii.gz \
    鈥搕ransform sub-01_from-T1w_to-MNI152NLin6Asym_mode-image_xfm.h5 \
    鈥搕ransform sub-01_ses-01_task-rest_from-native_to-T1w_mode-image_xfm.h5

I realized you store in anat the transformation sub-01_from-T1w_to-MNI152NLin6Asym_mode-image_xfm.h5, but I cannot find the transformation from-native_to-T1w.
I looked into:

fmriprep_wf/
  single_subject_01/
    func_preproc_<...>/
      bold_reg_wf/
        bbreg_wf/
          fsl2itk_fwd/
            *.txt

but the fsl2itk_fwd file is missing in the latest release. I was wondering if you can help me find that transformation?
I was also wondering if it would be possible to have the transformation from the native space to the T1w, for each functional run/task/ses, saved in the func folder. That would be something like sub-01_ses-01_task-rest_from-native_to-T1w_mode-image_xfm.h5. Similar issue: #1184.

Thank you so much for your help!

Julio A.

question

All 6 comments

Hey @JulioAPeraza, thanks for the issue - this is something that we definitely want to make available for a future release!

If you still have the working directory, you should be able to retrieve these. This transformation can be calculated by 2 different paths, based on your pipeline input:

  • if freesurfer was used: fmriprep_wf/single_subject<...>/func_preproc<...>/bold_reg_wf/bbreg_wf/concat_xfm/*.tfm

    • out_fwd.tfm is BOLD -> T1w, out_inv.tfm is the inverse

  • if freesurfer was omitted: fmriprep_wf/single_subject<...>/func_preproc<...>/bold_reg_wf/bbreg_wf/fsl2itk*

Yeah, this has come up before. I'm also thinking that any normalization transforms should be output if we calculate them at all, regardless of whether we save that space. If we've gone to the effort to calculate, seems silly to waste them.

Hello,
I applied the transformation using out_fwd.tfm. The output looks fine.
Thank you so much!

I'm also thinking that any normalization transforms should be output if we calculate them at all, regardless of whether we save that space

Pushing towards a format that can pack all the transforms together while offering a clear and easy-to-use interface to select the appropriate transform chain would definitely help with this (I'm describing https://github.com/poldracklab/nitransforms, and the BIDS-Derivatives proposed format for transforms, X5).

@JulioAPeraza let us know if you want to get more involved in this or other fronts of fMRIPrep.

For anyone willing to help, please check out www.nipreps.org and make sure you read through the community section to learn how investing your time can give you (and Science in general) some returns.

@JulioAPeraza let us know if you want to get more involved in this or other fronts of fMRIPrep.

Hello @oesteban,

I do not have that experience with such a big repo like fMRIPrep, but I am willing to learn and help with anything the community needs. Please, let me know how to get involved.

Thanks!

I think this would be the best starting point - https://www.nipreps.org/community/CONTRIBUTING/

Then, the second step would be to go around the issue tracker of each project (starting with the one you're most interested in) and find issues labeled "good first issue" or "low hanging fruit" or "help wanted". Typically writing documentation is a low-barrier entry point (and you get to think through topics of your interest and how to explain them to others).

After that, I would search for those features you most badly want to see implemented in fMRIPrep. Once you have identified one, the hacking starts!

Was this page helpful?
0 / 5 - 0 ratings