Dwiintensitynorm changed dimensions from input dwis and masks

TL;DR: white matter template mask created through dwiintensitynorm has different dimensions compared to input DWI/mask files. Why is this the case?

Hello all,

My lab has recently completed the AFD workthrough, which means we have an FOD template of 15 subjects in specific dimensions (93x112x88).

I’ve created a white matter template based off of these 15 subjects, and the DWI and mask images used as input were all transformed into the FOD template space.

What’s peculiar is that although the input DWI and mask images shared the same dimensions, the output FA and WM template files had changed dimensions. Rather than being like the DWI/mask inputs of 93x112x88, the FA and WM template files were in the dimensions of 86x108x84.

The specific commands I used are as follows:

Transforming DWI images to FOD template space:
for i in sub*; do mrtransform ${i}/cbed${i}_dwi.nii.gz -warp ${i}/subject2template_warp.nii.gz dwi_in_template_space_dir/dwi_${i}.nii.gz -fslgrad ${i}/e${i}_dwi.bvec ${i}/e${i}_dwi.bval; done

Converting DWI images to .mif format to retain bvec/bval information (the directories were changed from the one referenced above):
for i in sub*; do mrconvert template_dwi_2/PRE_${i}.nii.gz template_dwi_3_mif/PRE_${i}.mif -fslgrad ${i}/e${i}_dwi.bvec ${i}/e${i}_dwi.bval; done

dwiintensitynorm template_dwi_3_mif/ template_mask_2/ dwiintensitynorm_dir_2/ new_population_FA_template.nii.gz new_population_WM_mask_template.nii.gz -force

I then warped the WM mask template into FOD template space as follows:

I used only one subject’s subject2template_warp file - please let me know if this is an error & if it’s necessary to somehow use all subjects’ subject2template_warp files.

Was there an error in the way I created the WM template file which caused the dimension mismatch?

Thank you very much,

The template’s coordinate system and voxel grid can and most likely are different from that of any input image (discussion here). You can use mrtransform's -template argument to change the voxel grid.

Not sure I understand what you are tryin to do but you seem to align DWI images, not FOD images. This will result in wrong intensities in the DWIs because reorientation of the gradient directions and associated DW signal changes are not accounted for. dwiintensitynorm takes non-aligned images as input. You’d then compute FODs which then get aligned using population_template.