Trouble warping to template

Hi Adriana,

could you please post this in a new issue? the title of this thread is “Trouble warping to template”, so your latest issue is out of scope (it is important to keep issues organized, so others can easily find them based on their title)-- thanks!

Absolutely, thank you!

Hi @jcohenadad and SCT team!

I am currently trying to analyse DMRI data using spinalcordtoolbox commands as suggested by the tutorial online. Everything has gone smoothly until we have gotten to the warping to PAM50 template command:

sct_warp_template -d dmri_moco_dwi_mean.nii -w warp_template2dmri.nii.gz -qc …/qc

Basically, the warping templates are either incomplete or not accurately aligned with the cord. I wonder whether the sct_register_multimodal has worked properly either.

It is worth noting that the dmri data was acquired using ZOOMit as suggested by the generic acquisition protocol, and the FOV/slice acquisition of the T2 and DWI images are different.

I am unsure of how to resolve this issue if anyone has any solutions it would be much appreciated.

Thanks,

Alex

Hi Alexandra,

Thank you for reaching out. The issue you are experiencing could be caused by multiple things, so it is difficult for me to know what went wrong, without knowing exactly how the processing was done, and how the data look like.

As a first step, I suggest you look at the QC report of all steps (SC segmentation on the anat image, register multimodal, SC segmentation on the DWI scan, etc.). You could ZIP the QC folder and upload it here, so we can have a look and let you know if we notice something suspicious.

Cheers
Julien

Hi Julien,

Thank you for getting back to me. I have included the zip QC report for one of our patients. I just also wanted to mentiuon that the T2 labelling has been incorrect in some of our patients and we wondered if this has anything to do with it?

Kind regards,
Alex
qc.zip (1.8 MB)

This is definitely suspicious, given that the segmentation and labeling went well:

One possible source of error is that the qform/sform is corrupted, and/or the T2 and DWI scans were note acquired in the same patient coordinate (eg: participant was re-positioned in between). To verify this, can you open your T2w and dwi_mean data and overlay them on a viewer (using appropriate opacity level).

Hi Julien,

I used mcverter to convert the dicom files to nifti before preprocessing with sct toolbox using command: mcverter -o . -f fsl -n -d SubjDir/

Also, in regards to the sform and qform, whilst labelling th vertebrae in t2 Ubuntu would not let me label the vertebrae without running the sform command: sct_image -i (t2.nii or t2_seg.nii) -set-sform-to-qform

kind regards,
Alex

Hi Alex,

The fact that your images have different slice orientation is not the issue here. For example, see below an overlay of a T2w and a DWI scan, also acquired different slice orientation, number of slices, resolution, etc.:

The issue, as I suspected, is that either the q/sform is corrupted (eg: lost absolute coordinate system when converting from DICOM or after applying preprocessing methods with third-party software), and/or the patient was repositioned between the scans (laser marking re-done).

If this happens with most of your subjects, then there is something in your pipeline that is systematically wrong. To understand what is wrong, I suggest you describe the procedure to go from your DICOM data to your NIFTI images that then go into SCT’s software.

1 Like