A problem about co-register

Hello MRtrix experts,
I met a problem when I co-register “5tt-image” to DWI using a patient data acquired on Siemens Prisma 3T MRI system . I ran the command given in the "BATMAN-tutorial-update2020.


But the result in not good, the T1_raw.mif matches a litter better while T1_coreg.mif matches not good, meantime the 5tt_coreg.mif also matches badly.

How can I solve this problem, thank you for any kind of help.

This is indeed a tricky step. I’d made slightly different recommendations on this post – does this help?

Thanks for your suggestion, I had re-running according to your recommendation , but the result is still not good. Hope your further guidance .

This indeed doesn’t look ideal. It seems there might be some scaling and/or shearing going on there. Are you sure you provided the -dof 6 option to the flirt command…?

Otherwise, can you post the copy/paste of the exact commands you used? I assume you modified the command from the BATMAN tutorial (if nothing else, to replace the long dashes with hyphens -), we’d need to see the exact procedure you used here.

OK , I will upload the commands I used.

The first situation:

dwiextract dwi_den_unr_preproc_unbiased.mif - -bzero | mrmath - mean mean_b0_preprocessed.mif -axis 3
mrconvert mean_b0_preprocessed.mif mean_b0_preprocessed.nii.gz
mrconvert T1_raw.mif T1_raw.nii.gz
flirt -in mean_b0_preprocessed.nii.gz -ref T1_raw.nii.gz -dof 6 -omat diff2struct_fsl.mat
transformconvert diff2struct_fsl.mat mean_b0_preprocessed.nii.gz T1_raw.mif flirt_import diff2struct_mrtrix.txt
mrtransform T1_raw.mif -linear diff2struct_mrtrix.txt -inverse T1_coreg.mif
mrtransform 5tt_nocoreg.mif -linear diff2struct_mrtrix.txt -inverse 5tt_coreg.mif

These commands are from BATMAN_tutorial_update2020 , and the result is that,

The second situation:

dwiextract dwi_den_unr_preproc_unbiased.mif - -bzero | mrmath - mean mean_bo_preprocessed.mif -axis 3
 mrconvert mean_b0_preprocessed.mif mean_b0_preprocessed.nii.gz
mrconvert 5tt_nocoreg.mif 5tt_nocoreg.nii.gz
flirt -in mean_b0_preprocessed.nii.gz -ref 5tt_nocoreg.nii.gz -interp nearestneighbour -dof 6 -omat diff2struct_fsl.mat
transformconvert diff2struct_fsl.mat mean_b0_preprocessed.nii.gz 5tt_nocoreg.nii.gz flirt_import diff2struct_mrtrix.txt
mrtransform 5tt_nocoreg.mif -linear diff2struct_mrtrix.txt -inverse 5tt_coreg.mif

It’s according to old version tutorial , and occurred a warning: An input intended to be a single 3D volume has multiple timepoints. Input will be truncated to first volume, but this functionality is deprecated and will be removed in a future release. when run flirt -in mean_b0_preprocessed.nii.gz -ref 5tt_nocoreg.nii.gz -interp nearestneighbour -dof 6 -omat diff2struct_fsl.mat. The result is as following,

The third situation:

dwiextract dwi_den_unr_preproc_unbiased.mif - -bzero | mrmath - mean mean_bo_preprocessed.mif -axis 3
mrconvert mean_b0_preprocessed.mif -stride 1,2,3 mean_b0_preprocessed.nii.gz
mrconvert 5tt_nocoreg.mif -coord 3 0 -stride 1,2,3,4 5tt_gm.nii.gz
flirt -in mean_b0_preprocessed.nii.gz -ref 5tt_gm.nii.gz -dof 6 -omat diff2struct_fsl.mat
transformconvert diff2struct_fsl.mat mean_b0_preprocessed.nii.gz 5tt_gm.nii.gz flirt_import diff2struct_mrtrix.txt
mrtransform 5tt_nocoreg.mif -linear diff2struct_mrtrix.txt -inverse 5tt_coreg.mif

The result is also not good.

Anyway, thanks for any help anyone may provide!

Have you tried using a skull-stripped version of the T1-weighted image?

The trouble with using the full T1w is that the ideal alignment between the two images is merely a tiny valley among a huge multi-dimensional space where the two images can be made to “overlap” as far as the complex registration similarity metric is concerned. Sometimes imagining yourself being the registration similarity metric can assist in understanding why some things work and others don’t.

I would also take a look at your prior DWI pre-processing. There are some slightly funny-looking brain shapes going on, so there’s a small chance that EPI distortion correction may have gone awry, e.g. increasing rather than decreasing spatial distortions. This would make inter-modal rigid-body registration harder, because the ideal alignment would not stand out so much from non-ideal alignment.

I would also look at the actual 5tt_nocoreg.mif image itself. It looks like it might have been cropped in the frontal and cerebellar regions. Maybe the 5ttgen step didn’t work as expected? If the raw segmentations are not correct, then no amount of registration is going to help here…

Another thing you could try is to add the -stride 1,2,3 option to both mrconvert calls in your first situation (the raw T1). There’s a chance that could be throwing flirt off (not an issue with your last case though, I can see that’s been dealt with).

Thanks for your help, I checked my previous steps, the 5ttgen step certainly work with warning.


I 'm sorry for my careless .
My datasets is acquired from a glioma patient, if the tumor influence the result of 5ttgen or other reasons?

Ok, there’s a good chance the segmentation might fail in the presence of tumours… I’d recommend you take a look at the 5tt image overlaid on the T1 it was derived from, and check that everything matches expectation.

Yeah, the 5tt image is not match well to T1, it has been cropped after 5ttgen.


Is there any method to solve this problem?

If the 5ttgen fsl internal brain extraction does not work well, you can perform this extraction yourself using any method that works, and then run 5ttgen fsl using one of the -mask or -premasked options.