Transforming multiechodata post tedana using fMRIprep transforms

Summary of what happened:

I’m trying to use ANTs to apply transformations calculated by fMRIprep to multiecho data denoised by tedana. The fMRIprep output looks fine & the transformations on that end appear to have gone well, but manually trying to apply these transforms to optimally combined and denoised data from tedana leads to a misalignment of the data - I suspect the linear transform is failing.

Command used

docker run --rm \
-v /home/johnanderson/Documents/JA_fMRIprep_testing:/data \
-v /home/johnanderson/templateflow:/template \
antsx/ants antsApplyTransforms --dimensionality 3 \
--input-image-type 0 \
-i /data/BILCOR_ENFR/fmriprep_test/sub-02/tedana/1back/sub-02_1back_tedana_desc-optcomDenoised_bold.nii.gz \
--default-value 0 \
--float 1 \
--interpolation LanczosWindowedSinc \
-o /data/BILCOR_ENFR/fmriprep_test/sub-02/tedana/1back/sub-02_1back_tedana_desc_MNI152NLin6Asym_optcomDenoised_bold.nii.gz \
-r /template/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz \
-t /data/BILCOR_ENFR/fmriprep_test/sub-02/func/sub-02_task-1back_from-scanner_to-T1w_mode-image_xfm.txt \
-t /data/BILCOR_ENFR/fmriprep_test/sub-02/anat/sub-02_acq-mempragefilter_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5

Version:

ANTs Version: 2.4.4.dev1-gd74bb06
Compiled: May 1 2023 15:46:02

Environment (Docker, Singularity, custom installation):

I’m using Docker & installed antsx/ants

Screenshots / relevant information:

ok - never mind - I figured out the correct command after doing a bit more digging. For anyone else who gets stuck, here it is…

docker run --rm \
-v /home/johnanderson/Documents/JA_fMRIprep_testing:/data \
-v /home/johnanderson/templateflow:/template \
antsx/ants antsApplyTransforms --dimensionality 3 \
    --input-image-type 3 \
    --input /data/BILCOR_ENFR/fmriprep_test/sub-02/tedana/1back/sub-02_1back_tedana_desc-optcomDenoised_bold.nii.gz \
    --default-value 0 \
    --float 1 \
    --interpolation LanczosWindowedSinc \
    --output /data/BILCOR_ENFR/fmriprep_test/sub-02/tedana/1back/sub-02_1back_tedana_desc_TEST_MNI152NLin6Asym_optcomDenoised_bold.nii.gz \
    --reference-image /template/tpl-MNI152NLin2009cAsym/tpl-MNI152NLin2009cAsym_res-02_T1w.nii.gz \
    --transform /data/BILCOR_ENFR/fmriprep_test/sub-02/anat/sub-02_acq-mempragefilter_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 \
    --transform /data/BILCOR_ENFR/fmriprep_test/sub-02/anat/sub-02_acq-mempragefilter_from-fsnative_to-T1w_mode-image_xfm.txt
2 Likes

I spent a bit of time on this today, so thought I’d share, in case anyone else has this issue.

The main thing he changed was the ordering of the ANTS transforms:

Bad order: bold_to_t1_xfm.txt t1_to_MNI.h5

Successful order: t1_to_MNI.h5 bold_to_t1_xfm.txt

This is counter to the transform ordering found in the TEDANA faq (or elsewhere):
https://tedana.readthedocs.io/en/stable/faq.html#warping-scanner-space-fmriprep-outputs-to-standard-space

(I also used ‘–transform’ instead of ‘-t’ from that script, mostly out of superstition after a long day. But hey, it worked.)

1 Like