Multimodal registration error

Hello,

I am attempting to register a C2-T2 14 slice b0 DTI scan to its mFFE using the sct_register_multimodal tool. However, I am receiving the attached error that says that zmax is referenced before assignment and that the input image is empty. I am using the following command for the registration: `

sudo sct_register_multimodal -i dti_crop_moco_b0_mean.nii -d ~/Documents/Patient_Data_Folder/“$dirName”/DTI_Data/niftis/mFFE_crop.nii -o b02mFFE.nii.gz -owarp b02mFFE_warp.nii.gz -iseg dti_crop_moco_dwi_mean_seg_copy.nii.gz -dseg ~/Documents/Patient_Data_Folder/“$dirName”/DTI_Data/niftis/mFFE_crop_seg.nii.gz -param step=1,type=seg,algo=slicereg,metric=MeanSquares,gradStep=.5,iter=15:step=2,type=seg,algo=affine,metric=MeanSquares,gradStep=.05,iter=15, shrink=1:step=3,type=im,algo=syn,metric=MI,iter=15,shrink=1 -qc ~/Documents/Patient_Data_Folder/“$dirName”/Raw_Data/NIIX_Conv/DTI_Processing

The DTI and mFFE segmentation files used as the input image in the first parameter step have segmentation data and last for 14 slices. The respective mFFE and DTI images are similarly non-empty. I would appreciate some more clarification on the error and possible steps to remedy it. Appreciate your help.

Regards,
Ashwin

`

1 Like

Hi Ashwin,

Most probably, dti_crop_moco_b0_mean.nii and mFFE_crop.nii are not in the same physical space. What happens if you open the two images with a world-coordinate viewer (e.g., FSLeyes, ITKsnap, MITKWorkBench), do they overlap reasonably well?

If they do, could you please make sure that the segmentations mFFE_crop_seg.nii.gz and dti_crop_moco_dwi_mean_seg_copy.nii.gz look good?

If they do look good, could you send me (in private message if you prefer) the data so I can try to reproduce the error?

Cheers,
Julien

1 Like

Hi Dr. Cohen-Adad,

Sorry for my delayed reply. I uploaded the mFFE and DTI data for the volume here. Both the dti_crop_moco_b0_mean.niiand mFFE_crop.niioverlap well as well as the mFFE_crop_seg.nii and dwi_crop_moco_dwi_mean_seg.nii. Please let me know what you think.

Regards,
Ashwin

Hi Ashwin,

I was not able to reproduce your error (using the latest SCT 4.0.0-beta.5). I tried some combinations of parameters-- some work reasonably well (I prefer the last one):

cd 102/DTI
sct_register_multimodal -i dti_crop_moco_b0_mean.nii -d ../mFFE/mFFE_crop.nii -o b02mFFE.nii.gz -owarp b02mFFE_warp.nii.gz -iseg dti_crop_moco_dwi_mean_seg.nii -dseg ../mFFE/mFFE_crop_seg.nii -param step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=3 -qc qc-ashwin
sct_register_multimodal -i dti_crop_moco_b0_mean.nii -d ../mFFE/mFFE_crop.nii -o b02mFFE.nii.gz -owarp b02mFFE_warp.nii.gz -iseg dti_crop_moco_dwi_mean_seg.nii -dseg ../mFFE/mFFE_crop_seg.nii -param step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=5:step=3,type=im,algo=syn,metric=CC,iter=5 -qc qc-ashwin
sct_register_multimodal -i dti_crop_moco_b0_mean.nii -d ../mFFE/mFFE_crop.nii -o b02mFFE.nii.gz -owarp b02mFFE_warp.nii.gz -iseg dti_crop_moco_dwi_mean_seg.nii -dseg ../mFFE/mFFE_crop_seg.nii -param step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=10:step=3,type=im,algo=syn,metric=CC,iter=10 -qc qc-ashwin
sct_register_multimodal -i dti_crop_moco_b0_mean.nii -d ../mFFE/mFFE_crop.nii -o b02mFFE.nii.gz -owarp b02mFFE_warp.nii.gz -iseg dti_crop_moco_dwi_mean_seg.nii -dseg ../mFFE/mFFE_crop_seg.nii -param step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=10,slicewise=1:step=3,type=im,algo=syn,metric=CC,iter=10 -qc qc-ashwin
sct_register_multimodal -i dti_crop_moco_b0_mean.nii -d ../mFFE/mFFE_crop.nii -o b02mFFE.nii.gz -owarp b02mFFE_warp.nii.gz -iseg dti_crop_moco_dwi_mean_seg.nii -dseg ../mFFE/mFFE_crop_seg.nii -param step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=10,gradStep=1:step=3,type=im,algo=syn,metric=CC,iter=20 -qc qc-ashwin

And here is the QC report: qc-ashwin.zip (562.5 KB)

Note that some slices on the DWI scans are highly distorted, and could not reasonably be recovered by any registration method.

If you are not able to reproduce my results (using the exact same syntax), make sure you have the latest SCT version. Let us know how it goes.

Cheers,
Julien

1 Like

Hi Dr. Cohen-Adad,

Thanks for your reply and suggestion. I updated SCT and registration for the volume now works! I am however having an issue (attached screenshot) with sct_propseg segmenting the dmri data and motion-corrected mean dwi data for two volumes. I’ve provided sct_propseg with both the centerline and mask for segmentation, but it doesn’t segment along the centerline or near the mask. The command I am using is sudo sct_propseg -i dti_mean.nii -c dwi -init-centerline dti_mean_centerline.nii.gz -init-mask mask_dti_mean.nii. I’ve tried segmenting the volume using both prospeg and deepest_sc, but it doesn’t appear to segment near the centerline or provided mask. I did not experience this issue when using propseg or deepseg_sc with t2 contrast. Please let me know if you have any suggestions to fix this.

1 Like

hi,
would you be able to send me the problematic dti_mean.nii data?

I’ve uploaded the volume to here.

I’m not sure how you generated the centerline, but with three points (manually placed) it works fairly well:

sct_label_utils -i dti_mean.nii -create 114,109,3,1:114,104,5,1:114,94,8,1 -o points_cord.nii.gz
sct_propseg -i dti_mean.nii -c t1 -init-mask points_cord.nii.gz

Note: you can also generate the labels using sct_label_utils -create-viewer

1 Like

I was previously using sct_get_centerline, but manually choosing three points combined with propseg works better for me.