Create centerline using FSLEyes

Hello.

I am trying to perform a segmentation using Spinal Cord Toolbox, but I am getting an error message that the automatic detection of the centerline using Optic failed. I am not sure why that is happening, but anyway I wanted to provide the centerline as an argument in order to help the program do the segmentation.
I read about how to do that using FSLView, but I only fave FSLEyes and I don’t know how to create a file with the points for the centerline using FSLEyes.

Can anyone help me with this?

Thank you

Hi @fernandatcosta,

You can use the function sct_get_centerline -method viewer, which enables you to manually select a few points along the spinal cord, which is then followed by smooth regularization. I just made a video tutorial.

You can then use this centerline for propseg or deepseg.

Note however that if the automatic centerline failed, I am not too optimistic that the segmentation will go well. What kind of contrast are you working with?

Cheers,
Julien

Dear Julien,
I tried doing that and I got this error message:

sct_propseg -i A04_crop.nii.gz -c t2 -init-centerline A04_crop_viewer_centerline.nii.gz


Spinal Cord Toolbox (version: 3.2.7)
Running /home/fernanda/sct_3.2.7/scripts/sct_propseg.py -i A04_crop.nii.gz -c t2 -init-centerline A04_crop_viewer_centerline.nii.gz
isct_propseg -t t2 -o ./ -verbose -init-centerline A04_crop_viewer_centerline.nii.gz -i /home/fernanda/Documentos/A04_crop.nii.gz -centerline-binary # in /home/fernanda/Documentos
Exception caught while reading input image

itk::MemoryAllocationError (0x28cae30)
Location: “unknown”
File: /usr/local/itk/include/ITK-4.6/itkImportImageContainer.hxx
Line: 199
Description: Failed to allocate memory for image.

Automatic cord detection failed. Please initialize using -init-centerline or -init-mask (see help).
Sentry is attempting to send 1 pending error messages
Waiting up to 10 seconds
Press Ctrl-C to quit
Note: you can opt out of Sentry reporting by editing the file ${SCT_DIR}/bin/sct_launcher and delete the line starting with “export SENTRY_DSN”
Total processing time: 1 min 37 s

Do you know what is the problem?

hi,

looks like a memory issue. Could you copy/paste the output of:

ls /home/fernanda/Documentos/A04_crop.nii.gz
sct_check_dependencies

Hi Julien, here is the output:

fernanda@Fernanda:~$ ls /home/fernanda/Documentos/A04_crop.nii.gz sct_check_dependencies
ls: não foi possível acessar ‘sct_check_dependencies’: Arquivo ou diretório inexistente
/home/fernanda/Documentos/A04_crop.nii.gz

I’m sorry it is written in portuguese. It says that it was not possible to access sct_check_dependencies because the file or directory does not exist. Did I give the right commands?

hi,
it should be two separated commands (and outputs);

first:

ls -la /home/fernanda/Documentos/A04_crop.nii.gz

then:

sct_check_dependencies

best

Hi

Here are the outputs:

fernanda@Fernanda:~$ ls -la /home/fernanda/Documentos/A04_crop.nii.gz
-rw-r–r-- 1 fernanda fernanda 244879264 ago 6 08:59 /home/fernanda/Documentos/A04_crop.nii.gz

fernanda@Fernanda:~$ sct_check_dependencies


Spinal Cord Toolbox (version: 3.2.7)
Running /home/fernanda/sct_3.2.7/scripts/sct_check_dependencies.py
SCT info:

  • version: 3.2.7
  • path: /home/fernanda/sct_3.2.7
    OS: linux (Linux-4.15.0-45-generic-x86_64-with-debian-buster-sid)
    CPU cores: Available: 4, Used by SCT: 4
    RAM: MemTotal: 8024540 kB
    total usada livre compart. buff/cache disponível
    Mem.: 7836 1392 5248 333 1195 5865
    Swap: 2047 0 2047
    Check Python executable…[OK]
    Using bundled python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:42:40)
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] at /home/fernanda/sct_3.2.7/python/bin/python
    Check if data are installed…[OK]
    Check if xlwt (1.0.0) is installed…[OK]
    Check if xlutils (1.7.1) is installed…[OK]
    Check if cryptography (1.6) is installed…[OK]
    Check if scikit-learn (0.17.1) is installed…[OK]
    Check if scikit-image (0.12.3) is installed…[OK]
    Check if pyqt (4.11.4) is installed…[OK]
    Check if psutil (5.2.2) is installed…[OK]
    Check if matplotlib (1.5.1) is installed…[OK]
    Check if pip (9.0.1) is installed…[OK]
    Check if requests (2.12.4) is installed…[OK]
    Check if xlrd (0.9.4) is installed…[OK]
    Check if pandas (0.18.1) is installed…[OK]
    Check if dipy (0.11.0) is installed…[OK]
    Check if tqdm (4.11.2) is installed…[OK]
    Check if nibabel (2.1.0) is installed…[OK]
    Check if Keras (2.0.6) is installed…[OK]
    Check if futures (3.2.0) is installed…[OK]
    Check if pytest-cov (2.5.1) is installed…[OK]
    Check if pytest (3.5.0) is installed…[OK]
    Check if nipy (0.4.1) is installed…[OK]
    Check if h5py (2.7.0) is installed…[OK]
    Check if tensorflow (1.3.0) is installed…[OK]
    Check if raven (6.2.1) is installed…[OK]
    Check if numpy is installed (1.11.2)…[OK]
    Check if scipy is installed (0.18.1)…[OK]
    Check if spinalcordtoolbox is installed…[OK]
    Check ANTs compatibility with OS …[OK]
    Check PropSeg compatibility with OS …[OK]
    Check if figure can be opened…QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.
    [OK]

Total processing time: 0 min 30 s

Hi Fernanda,

Looks like you have enough RAM. Would you mind sending me the data (could be in private message) so I can try to replicate the error on my end?

Cheers,
Julien