How to open sct?

Dear all

Now I think I’ve installed it successfully through Ubuntu
How can I open and use SCT now?

Hi @chang,

Thank you for reaching out, and congratulations on the SCT installation. Please see our documentation on how to get started with using SCT. Notably, I strongly encourage you to follow the latest SCT course. If you have any question, please don’t hesitate to reach out to us!


1 Like

Dear jcohenadad
Thank you very much for your reply, and according to your suggestion, I watched your course in London. But I didn’t get the same result as you。I ran the following code based on your course(Since I have tried it once before, I have downloaded and unzipped it)

At the same time, I found several errors in the running process

And finally I got stuck here

A picture pops up at the same time

When I run sct_testing there is an error


At the same time, I found several errors in the running process

I do not see errors in your screenshot (just warning mentioning that files will be overwritten). Which errors are you referring to?

And finally I got stuck here
A picture pops up at the same time

The script is on pause until you click at the posterior tip of C2/C3. So, you need to click, then save and quit, and the script will resume. This is all explained in the latest course video recording. I invite you to run the script while following the video, otherwise you might not understand the various aspects of the processing. This is a fairly complex pipeline, so it is very important to take the time to watch the video.

When I run sct_testing there is an error

Thank you for reporting this error. The first thing I notice, is that the SCT installation points to “git-HEAD-95e66…”, which suggests that you are not using a stable version of SCT. Could you please install the latest SCT release, then re-run sct_testing again?


When I chose to re install another version, the installation failed

Is it a network problem?


I don’t see what you typed in your terminal window (you are only showing the output). It would be easier if instead of taking a screenshot, you copy/paste the terminal content and add “~~~” above and below your screenshot, as per the instructions of this forum (see above).

Now, here is what you can do to update your SCT version:

git checkout 5.2.0

Hope that helps!

When try cord segmentation using deep learning

(venv_sct) forest@DESKTOP-DM8SQ21:~/sct_course_london20/single_subject/data/t1$ sct_deepseg_sc -i t1.nii.gz -c t1 -ofolder deepseg -qc ~/qc_singleSubj

Spinal Cord Toolbox (git-HEAD-95e66208c9d6937fbe00e86db6176e4001196e56)

sct_deepseg_sc -i t1.nii.gz -c t1 -ofolder deepseg -qc /home/forest/qc_singleSubj

Config deepseg_sc:
  Centerline algorithm: svm
  Brain in image: True
  Kernel dimension: 2d
  Contrast: t1
  Threshold: 0.15
Creating temporary folder (/tmp/sct-20210313131110.557150-fcycbjnc)
Reorient the image to RPI, if necessary...
Finding the spinal cord centerline...
Creating temporary folder (/tmp/sct-20210313131204.361284-dm3wb9er)
Remove temporary files...
rm -rf /tmp/sct-20210313131204.361284-dm3wb9er
Cropping the image around the spinal cord...
Normalizing the intensity...
Segmenting the spinal cord using deep learning on 2D patches...
Traceback (most recent call last):
  File "/home/forest/sct/spinalcordtoolbox/scripts/", line 214, in <module>
  File "/home/forest/sct/spinalcordtoolbox/scripts/", line 199, in main
    threshold_seg=threshold, remove_temp_files=remove_temp_files, verbose=verbose)
  File "/home/forest/sct/spinalcordtoolbox/deepseg_sc/", line 506, in deep_segmentation_spinalcord
  File "/home/forest/sct/spinalcordtoolbox/deepseg_sc/", line 347, in segment_2d
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/keras/engine/", line 2656, in load_weights
    f, self.layers, reshape=reshape)
  File "/home/forest/sct/python/envs/venv_sct/lib/python3.6/site-packages/keras/engine/", line 3328, in load_weights_from_hdf5_group
    original_keras_version = f.attrs['keras_version'].decode('utf8')
AttributeError: 'str' object has no attribute 'decode

I can’t get the same results as you

Another question
Why is my slice different from the tutorial

Looking forward to your reply!

This is a different issue than this issue thread (which is about “how to open SCT”). For the sake of clarity for users going through this forum, and help us manage the different issues, please open a new issue for every new topic.

Again, this is a different issue. Please document exactly what you did to obtain this result. It is impossible for me to help if I don’t know exactly what you did, and at what stage in the tutorial you are at.

Also, it would be appreciated to know if the solution I gave you here solves your problem (ie: the one that started this thread).

no news after 24d, so i am flagging this issue as “resolved”