Sct_register_to_template: landmark error despite forcing labels to be UINT(

Hello SCT team
I still get this error in sct_register_to_template: “number of source and destination landmarks are not the same, so landmarks cannot be paired” after manually labeling the spinal cord. I work with the version 5.0.1 but the bug #3104 is already fixed in the script so the output in sct_label_utils should be forced to be UINT8 type. Where could the problem be?

Thank You in advance

Hi @coru,

Thank you for reporting this issue. In order to troubleshoot the problem, I think we may need a little more information. If possible, could you please provide:

  • The exact command you used for sct_register_to_template
  • The full output log of the processing (i.e. all of the terminal output after you run the command)
  • If possible, it would be helpful to provide all of the data files that were used in the sct_register_to_template command, too

Kind regards,

Hello @joshuacwnewton
Sure, so I did the commands again and I think I forgot the first time the -ref subject. So the error I get now is different. It stops by estimate transformation but I think there are problems before that.
Unfortunately I can’t provide the data files because they are to big to attach. I hope that is enough to understand the error I get.

Best regards

command and output (17.1 KB)

@coru I don’t see any error message in the Terminal output file you shared. The bottom of the file mentions the process:

Estimate transformation
/home/neuroimaging/sct_5.0.1/bin/isct_antsRegistration --dimensionality 3 --transform 'bsplinesyn[0.5,1,3]' --metric 'MeanSquares[dest_seg_RPI_pad.nii,src_seg_reg.nii,1,4]' --convergence 3 --shrink-factors 1 --smoothing-sigmas 1mm --restrict-deformation 1x1x0 --output '[step2,src_seg_reg_regStep2.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /media/neuroimaging/4D1D-BADB/MEDIC_month00/5mm/P21/sct-20220314161059.672655-register-ajk91cbp

This process is long (it can take a few minutes), so it is possible that it was just running and that you interrupted the process in the middle. How long has it been running for?

It was running quit long till runtime error when I didn’t interrupt it. In the attachment the next output. But it seems that the problem is perhaps on my computer when everything in the output looks fine.

Thank you for the fast answer

Runtime error (4.6 KB)

How long approximately?

To isolate the problem, you could try without the bsplinesyn step (which is computer-intensive):

sct_register_to_template -i avg_medic_oben_P21_month00.nii -s avg_medic_oben_P21_month00_seg_corr_E.nii -ldisc avg_medic_oben_P21_month00_seg_corr_labeled_discs.nii -c t2s -ref subject -param step=1,type=imseg,algo=centermassrot

Also, to get an idea of the hardware limitation, could you please run and give us the output of:


and what is the output of (you need to be in the folder that contains the image):

ls -l avg_medic_oben_P21_month00.nii

I would say about 10 to 15 minutes.
Without the bsplinesyn step it worked and took about minute
The output of: ls -l avg_medic_oben_P21_month00.nii
-rw-r–r-- 1 neuroimaging neuroimaging 4398592 Sep 6 2018 avg_medic_oben_P21_month00.nii

and attached the check dependencies:
sct_check_dependencies (2.8 KB)

OK, so the issue is likely related to the size and the data and the computer power. I would suggest switching to the SyN algorithm, which is a bit less computer intensive. Also you could try reducing the number of iterations and/or use slicewise=1.

So I have to set in the command sct_register_to_template the parameter algo in step=1 to bsplinesyn? Or how can I switch to to SyN algorithm?

that would be at step=2. See example in the tutorial, where you can replace bsplinesyn by syn. But the biggest change will be to add slicewise=1 under step=2 (as already present in this tutorial example).

Thank You very much, when I change to slicewise=1 in step=2 it works