Transforming ROIs from MNI to Native DWI Space - coregistration transform files

Hi NeuroStars,

I’m currently using QSIPrep to preprocess my DWI data. My goal is to bring ROIs defined in MNI2009c space into native DWI space (MNI → T1w → DWI) in order to overlay the transformed masks on subject-specific FA maps and ensure that the ROIs are well-aligned with white matter. I understand that QSIprep outputs are ACPC-aligned and that the dwiref image is already coregistered with the T1w reference, but for the overlay, I need them to be in the same voxel space and resolution, which requires applying the appropriate transforms.

As mentioned in the QSIprep documentation, the final QSIPrep outputs do not yet include transforms for the coregistration between dwiref and T1w. Within the qsiprep_wf, I noticed a potential affine .mat file inside the b0_to_anat folder. However, it appears to use an intermediate b0 reference image (eddy_corrected_LPS_b0_series_mean) that differs from the final dwiref outputted in the qsiprep main folder ( sub-XX_space-ACPC_dwiref.nii.gz). As a result, applying this transform directly doesn’t work as expected (the result is misaligned). I was wondering if it might be because some additional steps and transformations were applied to dwiref after the coregistration.

Am I missing a relevant transform file or reference image that would make this registration step easier? Or the way to proceed would be to manually register dwiref to T1w if further ROI work is needed?

Thanks for any clarification, and apologies if I’ve overlooked something obvious!

Command used (and if a helper script was used, a link to the helper script or the command generated):

docker run -ti --rm \
  -v /path/to/BIDS_dataset:/data:ro \
  -v /path/to/output_dir:/out \
  -v /path/to/working_dir:/work \
  pennlinc/qsiprep:latest /data /out participant \
  --participant-label sub-XX \
  --output-resolution 1.3 \
  --fs-license-file /path/to/license.txt \
  --unringing-method mrdegibbs \
  --dwi-denoise-window 5 \
  --nthreads 8 \
  --omp-nthreads 8 \
  -w /work

Version:

QSIPrep v1.0.1

Environment (Docker, Singularity / Apptainer, custom installation):

Docker

Hi @Kristina_Rainich,

Why use native DWI, instead of ACPC? All qsiprep outputs are aligned to acpc-T1w space, so your FA map would be as well.

Best,
Steven

Hi Steven,

Thank you for such a quick reply!

Yes, sure. But when I try to make any manipulation with ROIs registered to the T1w ACPC space and my FA maps (calculated with dtifit on the qsiprep output), I get an error because of different voxel sizes and dimensions.

I’m trying to use the FA map to refine my ROIs and keep only voxels with low anisotropy. For example, one of my commands:
fslmaths V1_left_thr10_bin_T1w_ACPC.nii.gz -mul dri_FAT_thr0p2_bin.nii.gz dti_FA_thr0p2_bin_overlap.nii.gz

But I get this error:
WARNING:: Inconsistent orientations for individual images in pipeline!
Will use voxel-based orientation which is probably incorrect - PLEASE CHECK!
Image Exception : #3 :: Attempted to multiply images of different sizes
terminate called after throwing an instance of ‘std::runtime_error’

Since my ROIs and FA map are already aligned but use different voxel sizes (the ROIs are 1 mm iso, and the FA map - 1.3 mm), could I just resample the ROIs to the FA map instead of registering and then proceed with subtraction/multiplication?

Best,
Kristina

Hi @Kristina_Rainich when you apply your registration to ACPC, you should use a DWI scalar map as your geometric reference so registered outputs match voxel resolution.

Best,
Steven