Apply transformations to all anatomical images

Summary of what happened:

Dear QSIprep team,

thanks for the great software! We’re currently preprocessing our dataset using qsiprep-1.0.2, and I’ve got a question about the anatomical processing workflow. Here’s an example of our derivatives anat folder:

ses-3
|-- anat
|   |-- sub-1554_ses-3_from-ACPC_to-MNI152NLin2009cAsym_mode-image_xfm.h5
|   |-- sub-1554_ses-3_from-ACPC_to-anat_mode-image_xfm.mat
|   |-- sub-1554_ses-3_from-MNI152NLin2009cAsym_to-ACPC_mode-image_xfm.h5
|   |-- sub-1554_ses-3_from-anat_to-ACPC_mode-image_xfm.mat
|   |-- sub-1554_ses-3_from-orig_to-anat_mode-image_xfm.txt
|   |-- sub-1554_ses-3_space-ACPC_desc-aseg_dseg.nii.gz
|   |-- sub-1554_ses-3_space-ACPC_desc-brain_mask.nii.gz
|   |-- sub-1554_ses-3_space-ACPC_desc-preproc_T1w.json
|   |-- sub-1554_ses-3_space-ACPC_desc-preproc_T1w.nii.gz
|   `-- sub-1554_ses-3_space-ACPC_dseg.nii.gz

However, we also have T2w, FLAIR and lesion masks in the subject space (registered to the original T1w), and we’d like them to be brought into AC-PC space as well. I tried running antsApplyTransforms with the transformation matrices provided by QSIprep, but this resulted in somewhat misaligned images:

antsApplyTransforms -d 3 -e 0 -i sub-1554_ses-3_T2w.nii.gz -r sub-1554_ses-3_space-ACPC_desc-preproc_T1w.nii.gz -o sub-1554_ses-3_space-ACPC_desc-preproc_T2w.nii.gz --interpolation Linear -t sub-1554_ses-3_from-anat_to-ACPC_mode-image_xfm.mat

According to this thread, QSIprep registration workflow is more complicated than suggested by the derivative matrices, and the easiest option is to run antsRegistration from scratch.

I was wondering, as of 2025, is there a more appropriate way to align all of the source anatomical images to the derivative space? Maybe giving QSIprep a list of files to tag along with T1w?

Thanks in advance!

Warm regards,
Victoria


1 Like