Open jcohenadad opened 7 months ago
Updating here, currently facing a few issues but I suspect it is due to the template cord labeling and template disc labeling (I'll explain below)
Using SCT latest version: git-master-29476b99e05d59a2b42ed7d20d4f40a58a53c497
The command I am using for this task is:
sct_register_to_template -i /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/bids_data/sub-HarshmanDobby/anat/sub-HarshmanDobby_T1.nii.gz -s /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/bids_data_updated/derivatives/labels/sub-HarshmanDobby/anat/sub-HarshmanDobby_T1_label-SC_seg.nii.gz -l /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/bids_data_updated/derivatives/labels/sub-HarshmanDobby/anat/sub-HarshmanDobby_T1_labels-disc_updated.nii.gz -t /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/template-dog/templatedog-r20240112/ -c t1 -s-template-id 2 -ofolder /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/register_op
I am using the template files from the latest release: https://github.com/spinalcordtoolbox/template-dog/releases/tag/v2.1
I am getting the following error:
Exception: Error: number of source and destination landmarks are not the same, so landmarks cannot be paired.
When I investigated the temporary files created during the straightening during the registration, I found that template disc labeled values started from 2.0
and the cord labeling also started from the same place. The below image shows what I mean. It is missing the labels for the first disc.
I'm currently rectifying the above issue. Will keep updating here.
-l /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/bids_data_updated/derivatives/labels/sub-HarshmanDobby/anat/sub-HarshmanDobby_T1_labels-disc_updated.nii.gz
"-l" refers to vertebral levels, whereas you are using disc labels ("-ldisc")
if you have difficulties, maybe @joshuacwnewton can provide assistance.
As mentioned above, I made changes to the template cord file, template disc level file and template vertebrae file. Along with this, I also used -ldisc
instead of -l
. This solved the above issue that I was facing.
The updated command I used for the registration is as follows:
sct_register_to_template -i /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/bids_data/sub-HarshmanDobby/anat/sub-HarshmanDobby_T2.nii.gz -s /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/bids_data_updated/derivatives/labels/sub-HarshmanDobby/anat/sub-HarshmanDobby_T2_label-SC_seg.nii.gz -ldisc /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/bids_data_updated/derivatives/labels/sub-HarshmanDobby/anat/sub-HarshmanDobby_T2_labels-disc_updated.nii.gz -t /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/template-dog/templatedog-r20240112/ -c t2 -s-template-id 2 -ofolder /Users/rohanbanerjee/Documents/research/neuropoly/dog_template_updated/register_op
The output of the registrations are as follows:
For t2,
For t1,
For t1, the anat2template registration (registration done with default parameters) does not produce great results.
Attaching all the above mentioned files: All template related files: https://drive.google.com/file/d/1UT2tqePQulXSopJwxAkpjdlytkewHT5e/view?usp=sharing
All registration related files: https://drive.google.com/file/d/1TNtpVcZZ45nWyxamPTMhTXJ-Vu5WJua5/view?usp=sharing
clarification about disc labels:
Therefore, we CANNOT use the 26 labels disc file to register to the template.
that's fine, we will just do 2 labels.
my syntax to reproduce:
# only keep 2 disc labels
sct_label_utils -i ~/data.neuro/template_dog_virginiatech/derivatives/labels/sub-HarshmanDobby/anat/sub-HarshmanDobby_T2_labels-disc.nii.gz -keep 4,10 -o labels_4-10.nii.gz
# run registration (params not optimized)
sct_register_to_template -i ~/data.neuro/template_dog_virginiatech/sub-HarshmanDobby/anat/sub-HarshmanDobby_T2.nii.gz -s ~/data.neuro/template_dog_virginiatech/derivatives/labels/sub-HarshmanDobby/anat/sub-HarshmanDobby_T2_label-centerline.nii.gz -ldisc labels_4-10.nii.gz -t . -c t2 -s-template-id 2 -ofolder test_discs4-10 -param step=1,type=seg,algo=centermass:step=2,type=im,algo=syn,metric=CC,iter=3 -qc qc~~~
SCT version used: Spinal Cord Toolbox (git-jca/4298-flow-d396ad3a9090900cc62d4b6eb4ccbc6d63d4a6eb)
Context: https://forum.spinalcordmri.org/t/integrating-dog-template/1179/2