Please see link for previous conversations.
Unfortunately I am still receiving the following error even after changes all 3 image sets as instructed. It seems as if though the temporary file is creating it to where the sform and qform do not match. I can look through the dog template to ensure that they match.
--
Spinal Cord Toolbox (git-master-4220101576d7b18a5b1af18a8b211d8a849ec2ef)
sct_register_to_template -i T2w.nii.gz -s T2w_label-SC_seg.nii.gz -ldisc T2w_labels-disc.nii.gz -t data/template-dog -c t2 -s-template-id 2 -param step=1,type=seg,algo=centermassrot:step=2,type=im,algo=syn,metric=CC,iter=3 -ofolder HB_to_temp -qc qc_HB_to_temp
--
Check template files...
OK: data/template-dog/template/templatedog_t2w.nii.gz
OK: data/template-dog/template/templatedog_label_disc.nii.gz
OK: data/template-dog/template/templatedog_cord.nii.gz
Check parameters:
Data: T2w.nii.gz
Landmarks: T2w_labels-disc.nii.gz
Segmentation: T2w_label-SC_seg.nii.gz
Path template: data/template-dog
Remove temp files: 1
Check input labels...
Creating temporary folder (/var/folders/zz/m4pgv4k94xn25p3h22kdhw1m0000gp/T/sct_2024-10-30_13-46-55_register-to-template_lyth7fo8)
Copying input data to tmp folder and convert to nii...
Check if provided labels are available in the template
Binarize segmentation
Change orientation of input images to RPI...
Resample data to 1mm isotropic...
load data...
Done! To view results, type:
fsleyes data_rpi_1mm.nii &
load data...
Converting image from type 'uint8' to type 'float64' for linear interpolation
Done! To view results, type:
fsleyes seg_bin_rpi_1mm.nii.gz &
To avoid intensity overflow due to convertion to +uint8+, intensity will be rescaled to the maximum quantization scale
Straighten the spinal cord using centerline/segmentation...
Creating temporary folder (/var/folders/zz/m4pgv4k94xn25p3h22kdhw1m0000gp/T/sct_2024-10-30_13-46-57_straighten-spinalcord_ep78v4k8)
Copy files to tmp folder...
Image /private/var/folders/zz/m4pgv4k94xn25p3h22kdhw1m0000gp/T/sct_2024-10-30_13-46-55_register-to-template_lyth7fo8/seg_bin_rpi_1mm_crop.nii.gz has different qform and sform matrices. This can produce incorrect results. Please use 'sct_image -i /private/var/folders/zz/m4pgv4k94xn25p3h22kdhw1m0000gp/T/sct_2024-10-30_13-46-55_register-to-template_lyth7fo8/seg_bin_rpi_1mm_crop.nii.gz -header' to check that both affine matrices are valid. Then, consider running either 'sct_image -set-sform-to-qform' or 'sct_image -set-qform-to-sform' to fix any discrepancies you may find.
Traceback (most recent call last):
File "/Users/richardshinn/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_register_to_template.py", line 815, in <module>
main(sys.argv[1:])
File "/Users/richardshinn/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_register_to_template.py", line 564, in main
sc_straight.straighten()
File "/Users/richardshinn/spinalcordtoolbox/spinalcordtoolbox/straightening.py", line 108, in straighten
Image(fname_anat, check_sform=True).save(os.path.join(path_tmp, "data.nii"))
File "/Users/richardshinn/spinalcordtoolbox/spinalcordtoolbox/image.py", line 343, in __init__
raise ValueError("Image sform does not match qform")
ValueError: Image sform does not match qform