Spinal Cord T1 Image in Sagittal View is Misoriented

Hi SCT team,

I am reaching out for assistance with an issue I am encountering with my spinal cord T1 image data. The image appears to be misoriented in the sagittal view, lying horizontally, which is causing difficulties when attempting to use the sct_propseg (or sct_deep_sc) for segmentation.

I have used the fslswapdim and fslreorient2std functions in FSL, as well as nibabel in Python to manually adjust the orientation, but without success.

I would greatly appreciate any guidance or suggestions on how to properly reorient the images so that they are correctly displayed in the sagittal view, allowing SCT to perform the segmentation accurately.

Thanks in advance!

best


Hi @Xiaomin_Lin

Send us your image and we’ll tell you how to fix it

@jcohenadad Thank you very much for your help! I am very excited to learn how to handle this type of spinal cord data in the future.

t1_spinal.nii.gz (7.3 MB)

It was trickier than I thought. The problem was caused by uncommon subject positioning: the head was tilted such that the top of the head, which usually aligns with the ‘Superior’ dimension, was in fact pointing towards the bissectrice between the SI and AP dimensions.

The only good way I could think of was to simply rotate the image by about 45 degrees using programatically created labels:

# Create labels
sct_label_utils -i t1_spinal.nii.gz -create 104,215,0,1:104,168,32,2 -o label_src.nii.gz
sct_label_utils -i t1_spinal.nii.gz -create 104,128,0,1:104,128,55,2 -o label_dest.nii.gz
# Rotate MRI scan
sct_register_multimodal -i t1_spinal.nii.gz -ilabel label_src.nii.gz -d t1_spinal.nii.gz -dlabel label_dest.nii.gz -param step=0,type=label,dof=Ty_Tz_Rx:step=1,type=im,iter=0 -o t1_spinal_reg.nii.gz
# Segment spinal cord with sct_deepseg_sc
sct_deepseg_sc -i t1_spinal_reg.nii.gz -c t1 -qc qc
# Segment spinal cord with sct_deepseg contrast-agnostic model
sct_deepseg -i t1_spinal_reg.nii.gz -task seg_sc_contrast_agnostic -qc qc

Results (green: deepseg, red: deepseg_sc):
ezgif-5-9023d97fb0

QC report: qc.zip (1.5 MB)

Few notes:

  • The syntax for creating the labels should work on your other images if the field of view and acquisition protocol is similar
  • I recommend using the new sct_deepseg -task seg_sc_contrast_agnostic model, which is more performant than sct_deepseg_sc
1 Like

Hi Julien @jcohenadad. Thanks for your help! Following your guidance, I have successfully obtained segmentation data.

Hi Julien @jcohenadad . By the way, I have another question. I am currently using the sct_label_vertebrae for automated vertebral labeling. However, I have encountered a significant issue likely due to poor T1 data quality. Specifically, the majority of the data cannot be automatically recognized, resulting in the error message: “Automatic C2-C3 detection failed.”

To address this, I labeled the C2/C3, but this approach often resulted in poor identification of C3/C4 or C4/C5, as shown in the attached image.

Given this challenge, if there are any automated solutions or best practices that you could recommend for improving the accuracy of vertebral labeling. Is providing a discfile the only option available to enhance the identification process? (cuz I have hundreds of data :melting_face:)

Thanks!


t1_spinal.nii.gz (5.9 MB)
t1_spinal_seg.nii.gz (25.6 KB)

@Xiaomin_Lin can you please post your question in another (new) topic, and give a specific title to it, because the title of this current forum thread is “Spinal Cord T1 Image in Sagittal View is Misoriented”, which is not specific to your 2nd question. We try to keep this forum organized so that searching topic is more efficient and useful for the community in the long run. Thank you for your understanding.

For cross-referencing, here is the new issue: How to improve accuracy in automated vertebral labeling?