Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOLD to T1w transformation #2189

Closed
JulioAPeraza opened this issue Jun 13, 2020 · 6 comments
Closed

BOLD to T1w transformation #2189

JulioAPeraza opened this issue Jun 13, 2020 · 6 comments
Labels
Milestone

Comments

@JulioAPeraza
Copy link

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 –dimensionality 3 \
	–input-image-type 3 \
	–input sub-01_ses-01_task-rest_space-native_desc-MEICA_bold.nii.gz \
	–default-value 0 \
	–float 1 \
	–interpolation LanczosWindowedSinc \
	–output sub-01_ses-01_task-rest_space-MNI152NLin6Asym_res-2_desc-MEICA_bold.nii.gz \
	–reference-image $HOME/.cache/templateflow/tpl-MNI152NLin6Asym_res-02_T1w.nii.gz \
	–transform sub-01_from-T1w_to-MNI152NLin6Asym_mode-image_xfm.h5 \
	–transform 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.

@mgxd
Copy link
Collaborator

mgxd commented Jun 19, 2020

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*

@mgxd mgxd added this to the 20.2.0 LTS milestone Jun 19, 2020
@effigies
Copy link
Member

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.

@JulioAPeraza
Copy link
Author

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

@oesteban
Copy link
Member

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
Copy link
Author

@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!

@oesteban
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants