Some questions about the registering template to dMRI of lumbar enlargement area

“sct_deepseg -task seg_sc_contrast_agnostic”and “motion correction”for dmri were performed before registering to the template. Some labels could be matched satisfactorily during registering, as shown in Figure 1; but executing the same command -“ - param
step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,slicewise=1,iter=3”
some matching resluts were very poorly. As shown in Figure 2. Considering the image deformation,We tried to change the command to“step=1,type=seg,algo=centermassrot:step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,metric=MeanSquares,iter=3,slicewise=0:step=3,type=im,algo=syn,metric=CC,iter=3,slicewise=0”, but the effect was not good, as shown in Figure 3.
We would be very pleased if we could receive your response.
figure1 :


figure 2

Figure 3

Dear @dingdong971108,

Thank you for your question!

I appreciate that you have provided the -param settings and figures. That said, it is still a bit difficult to debug the issue with the current information. The issue could be with the spinal cord segmentation, the vertebral labels, the registration, etc. but it is hard to tell given the information provided.

So, I would like to ask for additional information:

  • What are the exact commands that you have used for every step of the procedure? (For example, are you following the dMRI tutorial?)
  • Do you have additional contrasts (e.g. T2w) for these subjects, or do you have only dMRI data?
  • Are you able to provide sample images for us to test with?
    • If not, are you able to share the entire QC report (including the QC for any intermediate steps such as segmentation and labeling)? QC report folders can be compressed into .zip files and shared.

This information will help us to identify the problem. :slight_smile:

Thank you kindly,
Joshua

[quote=“dingdong971108, post:1, topic:1426”]
We would be
[/quote
I was very pleased to receive your message.

Actually,every step from segmentation, vertebral labeling to registration was strictly followed according to dmri tutorial guidelines. Before data processing, we thoroughly studied the publicly available instructional videos, PowerPoint materials, and protocol documents and we use the SCT version 6.4.

  1. Segmentation: Each segmentation undergoes quality control (QC) checks. Suboptimal segmentations are manually corrected using ITK-SNAP

  2. Vertebral labeling: according to the ROI we labeled 18 and 20 and some cases also labeled 18;60.

  3. Registration: After successful validation of the above two steps, registrstion were conducted.
    After ensuring the accuracy of the above three steps, proceed with the dMRI analysis. During the dMRI segmentation, FSLeyes was used to review the segmentation results. For inadequately segmented regions, ITK-SNAP was used for manual corrections.
    We would be delighted to share both our dataset and the reference code we’re currently using. Approximately 7 cases have exhibited these specific issues. Could you please provide your email address and we could send our samples to you.

Thank you kindly

sunny

Thank you very much for the detailed response! I’m glad to hear that you’ve verified the segmentation and labeling. I would be happy to help debug the registration, then. :slight_smile:

I would be happy to! Please contact me at joshua.newton@polymtl.ca. :slight_smile:

I sincerely appreciate your support. The samples have been send last night via email address 514252263@qq.com. Please check accordingly. We look forward to your reply .
best wishes
Sunny

1 Like

Dear Sunny,

My apologies for the late reply! It was a 4-day weekend off in Canada, and I am just returning to work.

Also, my apologies, but I have not received your email (not in inbox or “junk email”). It is possible that it was caught by our university’s spam filter. Could you please try my Gmail address instead? It is: joshuacwnewton@gmail.com

Thank you kindly for your patience and understanding, and I apologize for the delay.
Joshua

Dear Joshua
I’m also very happy to receive your reply. The case files have been sent via the email mentioned above…Please let us know if further clarification is needed. We look forward to your insights on resolving these discrepancies.
Thank you for your time and assistance.
Sunny

Dear Sunny,

Thank you for sharing your sample data and commands with me. I had to make some small corrections to the commands you provided in the .zip (i.e. t2-l.txt and dmri_2.txt), but I mainly just tried to re-run your commands and make observations:

T2 commands

Here are the commands I tried for the T2 data:

# segment the spinal cord
export QC_FOLDER="path/to/output/qc"
sct_deepseg -i t2.nii.gz -task seg_lumbar_sc_t2w -qc "$QC_FOLDER"
# create a labeled segmentation
sct_label_utils -i t2.nii.gz -create-viewer 19 -o label_T11T12.nii.gz -msg "Click at the posterior tip of T11/T12 inter-vertebral disc"
sct_label_vertebrae -i t2.nii.gz -s t2_seg.nii.gz -c t2 -initlabel label_T11T12.nii.gz -qc "$QC_FOLDER"
# extract vert body labels
sct_label_utils -i t2_seg_labeled.nii.gz -vert-body 19 -o t2_labels_vert.nii.gz
sct_qc -i t2.nii.gz -s t2_labels_vert.nii.gz -p sct_label_utils -qc "$QC_FOLDER"
# use the labels to register to template
sct_register_to_template -i t2.nii.gz -s t2_seg.nii.gz -l t2_labels_vert.nii.gz -qc "$QC_FOLDER" -ofolder advanced_param -c t2 -param step=1,type=seg,algo=rigid:step=2,type=seg,metric=CC,algo=bsplinesyn,slicewise=1,iter=3:step=3,type=im,metric=CC,algo=syn,slicewise=1,iter=2
sct_warp_template -d t2_lumbar.nii.gz -w advanced_param/warp_template2anat.nii.gz -a 0 -qc "$QC_FOLDER"

Some notes:

  • To use the QC_FOLDER variable, you need to use $ syntax ($QC_FOLDER or "$QC_FOLDER")
  • sct_label_vertebrae failed at first when using label 18 (label_T10T11.nii.gz). I had to switch to label 19 instead.
  • The sct_label_vertebrae step excluded some of the top region of the cord segmentation (everything above the T12 vertebral level)
    image
  • The sct_label_utils command included “-vert-body 17,19” though 17 didn’t exist.
  • There were some commented-out commands identifying “label 60” (cauda equina). I have not tested your commands yet, but maybe “60” could be useful.

For sample subject 1, the T2 steps seem to go OK:

dMRI commands

Next, here are the commands I tried for the dMRI data:

# generate mask for moco
sct_dmri_separate_b0_and_dwi -i dmri.nii.gz -bvec bvecs.txt 
sct_deepseg_sc -i dmri_dwi_mean.nii.gz -c dwi -qc "$QC_FOLDER"
sct_create_mask -i dmri_dwi_mean.nii.gz -p centerline,dmri_dwi_mean_seg.nii.gz -size 35mm
# apply motion correction
sct_dmri_moco -i dmri.nii.gz -m mask_dmri_dwi_mean.nii.gz -bvec bvecs.txt 
# create "good" spinal cord mask on moco'd image
sct_deepseg -task seg_sc_contrast_agnostic -i dmri_moco_dwi_mean.nii.gz -qc "$QC_FOLDER"
# perform registration
sct_register_multimodal -i "${SCT_DIR}/data/PAM50/template/PAM50_t1.nii.gz" \
                        -iseg "${SCT_DIR}/data/PAM50/template/PAM50_cord.nii.gz" \
                        -d dmri_moco_dwi_mean.nii.gz \
                        -dseg dmri_moco_dwi_mean_seg.nii.gz \
                        -initwarp ../t2/advanced_param/warp_template2anat.nii.gz \
                        -initwarpinv ../t2/advanced_param/warp_anat2template.nii.gz \
                        -owarp warp_template2dmri.nii.gz \
                        -owarpinv warp_dmri2template.nii.gz \
                        -param step=1,type=seg,algo=centermass:step=2,type=seg,algo=bsplinesyn,slicewise=1,iter=3 \
                        -qc ~/qc_singleSubj

Some notes:

  • The motion correction and “sct_deepseg” step seemed to go (mostly) OK:
    Screencast from 2025-04-25 13-59-18
  • However, the initial files t2.nii.gz and dmri.nii.gz do not appear to be very well aligned:
    ezgif.com-animated-gif-maker(2)
  • So, when the T2 “-initwarp” file gets applied to the dMRI image at the start of the registration, the dMRI segmentation is also mis-aligned:
    image
  • For comparison, here is the sample data that SCT uses in its tutorials (sct_tutorial_data):
    ezgif.com-animated-gif-maker(3)

Based on the above notes, I think the alignment between the T2 and dMRI data may need to be double-checked first, prior to running sct_register_multimodal between the dMRI and the template.

I will also ask my colleagues for further input. Maybe there is set of registration parameters that will work OK without an initial alignment, so I will ask them.

Thank you kindly for your patience and understanding,
Joshua

Dear Joshua
Thanks for your assistance. As you said, the initial files t2.nii.gz and dmri.nii.gz do not to be very well aligned, I have double checked there cases which are some problems about dmri registration. there are truly some variation between initial t2 and dmri. we are not sure whether do the patient moved or the image deformation or some other reasons. I will discuss this problem with our GE engineers. What’s more, if there is set of registration parameters that will work OK without an initial alignment,please do not hesitate to contact us. We would greatly appreciate your assistance.
Sunny

1 Like