Centerline for each volume

Hello
I am trying to get the centerline for each volume from fMRI data. my data has 230 volumes.
I use sct_get_centerline but I encountered an error.
can anyone help me with this?
Thank you
M.MA

Hi Mahdi. Could you please share the full terminal output (including the command you ran and the error message) that happens when you run sct_get_centerline?

Also, in your reply on this forum, you can use ~~~ at the start and end of the terminal output to format the output nicely:

~~~
like this
~~~

Thanks!

Hi
my error was this:

(base) mahdi@mpluss:~/Desktop/second case$ sct_get_centerline -i SP_S05_D1_RND.nii -c t2s

--
Spinal Cord Toolbox (4.3)

Traceback (most recent call last):
  File "/home/mahdi/sct_4.3/scripts/sct_get_centerline.py", line 153, in <module>
    run_main()
  File "/home/mahdi/sct_4.3/scripts/sct_get_centerline.py", line 143, in run_main
    verbose=verbose)
  File "/home/mahdi/sct_4.3/spinalcordtoolbox/centerline/core.py", line 151, in get_centerline
    im_centerline = optic.detect_centerline(im_seg, param.contrast, verbose)
  File "/home/mahdi/sct_4.3/spinalcordtoolbox/centerline/optic.py", line 119, in detect_centerline
    sct.run(cmd_optic, is_sct_binary=True, verbose=0)
  File "/home/mahdi/sct_4.3/scripts/sct_utils.py", line 310, in run
    raise RunError(output)
sct_utils.RunError: OpenCV Error: Assertion failed (_img.dims() <= 2) in minMaxLoc, file /myopt/opencv/opencv-3.0.0/modules/core/src/stat.cpp, line 2338
terminate called after throwing an instance of 'cv::Exception'
what():  /myopt/opencv/opencv-3.0.0/modules/core/src/stat.cpp:2338: error: (-215) _img.dims() <= 2 in function minMaxLoc

but I found the problem, this command just use in one volume.
thank you.

1 Like

Thank you for sharing an update! Iā€™m glad to hear your issue is resolved. :slightly_smiling_face: