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

bold2target transforms applied in incorrect order to boldref, mask, t2star map #3237

Closed
madisoth opened this issue Feb 27, 2024 · 3 comments · Fixed by #3238
Closed

bold2target transforms applied in incorrect order to boldref, mask, t2star map #3237

madisoth opened this issue Feb 27, 2024 · 3 comments · Fixed by #3238
Labels
Milestone

Comments

@madisoth
Copy link
Collaborator

What happened?

In a subject processed with --output-spaces MNI152NLin6Asym:res-2, the MNI-space boldref, t2star, and BOLD mask volumes appear misregistered to the MNI template, though the BOLD timeseries appear correctly registered. No errors in processing reported

What command did you use?

/opt/conda/envs/fmriprep/bin/fmriprep --output-spaces MNI152NLin6Asym:res-2 --fs-license-file /license.txt --project-goodvoxels --omp-nthreads 3 --cifti-output 91k -vv -w /wd /bids_dir /output_dir participant

What version of fMRIPrep are you running?

current Dockerhub unstable

How are you running fMRIPrep?

Singularity

Is your data BIDS valid?

Yes

Are you reusing any previously computed results?

No

Please copy and paste any relevant log output.

No response

Additional information / screenshots

from the command.txts in the work dir, it looks like xfms are being passed in the opposite of the expected order for antsApplyTransforms:

antsApplyTransforms --default-value 0 --dimensionality 3 --float 1 --input /wd/fmriprep_0_0_wf/sub_XXXXXX_wf/bold_ses_1_task_rest_run_01_echo_1_wf/bold_native_wf/bold_t2smap_wf/t2smap_node/T2starmap.nii.gz --interpolation LanczosWindowedSinc --output T2starmap_trans.nii.gz --reference-image /home/feczk001/tmadison/.cache/templateflow/tpl-MNI152NLin6Asym/tpl-MNI152NLin6Asym_res-02_T1w.nii.gz --transform /output_dir/sub-XXXXXX/ses-1/func/sub-XXXXXX_ses-1_task-rest_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt --transform /output_dir/sub-XXXXXX/ses-1/anat/sub-XXXXXX_ses-1_from-T1w_to-MNI152NLin6Asym_mode-image_xfm.h5
@madisoth madisoth added the bug label Feb 27, 2024
@effigies
Copy link
Member

Just rewriting for readability:

antsApplyTransforms --default-value 0 --dimensionality 3 --float 1 \
    --input /wd/fmriprep_0_0_wf/sub_XXXXXX_wf/bold_ses_1_task_rest_run_01_echo_1_wf/bold_native_wf/bold_t2smap_wf/t2smap_node/T2starmap.nii.gz \
    --interpolation LanczosWindowedSinc --output T2starmap_trans.nii.gz \
    --reference-image /home/feczk001/tmadison/.cache/templateflow/tpl-MNI152NLin6Asym/tpl-MNI152NLin6Asym_res-02_T1w.nii.gz \
    --transform /output_dir/sub-XXXXXX/ses-1/func/sub-XXXXXX_ses-1_task-rest_run-01_from-boldref_to-T1w_mode-image_desc-coreg_xfm.txt \
    --transform /output_dir/sub-XXXXXX/ses-1/anat/sub-XXXXXX_ses-1_from-T1w_to-MNI152NLin6Asym_mode-image_xfm.h5

@tsalo
Copy link
Collaborator

tsalo commented Feb 29, 2024

So it seems like the problem is specifically with the order of transforms in boldref2target in init_ds_volumes_wf, right?

@effigies
Copy link
Member

Ah, okay. Yes, the problem is that nitransforms builds a list of transforms while antsApplyTransforms builds a stack, so we can't pass the same sequence to our own resampler versus antsApplyTransforms.

@effigies effigies added this to the 23.2.1 milestone Feb 29, 2024
effigies pushed a commit that referenced this issue Feb 29, 2024
Closes #3237.

- Switch order of transforms in `boldref2target` node of `init_ds_volumes_wf` from boldref2anat_xfm --> anat2std_xfm to anat2std_xfm --> boldref2anat_xfm, as antsApplyTransforms expects transforms to be provided in reverse order.
@effigies effigies closed this as completed Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants