I have seen that this issue has been already mentioned here Data download problem while installing SCT 4.2.2 and I got the same error (only copying the last part where I got an error message):
Unzip data to: /tmp/sct-20210117190328.519415-t7alz396 Traceback (most recent call last):
File “/home/willi/sct_4.2.2/scripts/sct_download_data.py”, line 248, in *
res = main()*
File “/home/willi/sct_4.2.2/scripts/sct_download_data.py”, line 140, in main*
unzip(tmp_file, dest_tmp_folder, verbose)*
File “/home/willi/sct_4.2.2/scripts/sct_download_data.py”, line 174, in unzip*
if compressed.endswith(‘zip’):* AttributeError: ‘NoneType’ object has no attribute ‘endswith’
ERROR: Command failed.
Installation failed!
However, I would like to download the 4.2.2 (I need this version specifically). I also tried to download SCT version 4.2.1 and got the same error.
Is there way to circumvent the issue?
If you absolutely need SCT 4.2.2, then you could manually download the PAM50 template (and other data files) by clicking on the link shown in the error with your browser, and unzipping the files under your SCT installation folder (put those unzipped files under the data/ sub-folder).
After you installed all data, please run the following commands to make sure your SCT installation works:
sct_check_dependencies
sct_testing
And please report back to us, we will be happy to further assist you
Thank you very much for your quick reply!
As you said, I added the PAM50 folder to data/ subfolder and sct_check_dependencies does not produce any errors whereas with sct_testing command I get the following errors (I am copying the error messages for sct_get_centerline and sct_propseg):
**Failures: sct_deepseg_gm sct_deepseg_lesion sct_deepseg_sc sct_detect_pmj sct_get_centerline sct_propseg**
sct_get_centerline -i t2s/t2s.nii.gz -c t2s
====================================================================================================
--
Spinal Cord Toolbox (4.2.2)
Traceback (most recent call last):
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/scripts/sct_get_centerline.py", line 147, in <module>
run_main()
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/scripts/sct_get_centerline.py", line 137, in run_main
verbose=verbose)
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/spinalcordtoolbox/centerline/core.py", line 151, in get_centerline
im_centerline = optic.detect_centerline(im_seg, param.contrast, verbose)
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/spinalcordtoolbox/centerline/optic.py", line 119, in detect_centerline
sct.run(cmd_optic, is_sct_binary=True, verbose=0)
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/scripts/sct_utils.py", line 311, in run
raise RunError(output)
sct_utils.RunError: OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
terminate called after throwing an instance of 'cv::Exception'
what(): /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp:3214: error: (-215) dsize.area() > 0 in function resize
terminate called recursively
Checking sct_image..................................[OK]
Checking sct_label_utils............................[OK]
Checking sct_label_vertebrae........................[OK]
Checking sct_maths..................................[OK]
Checking sct_merge_images...........................[OK]
Checking sct_process_segmentation...................[OK]
Checking sct_propseg................................[FAIL]
====================================================================================================
sct_propseg -i t2/t2.nii.gz -c t2 -qc testing-qc
====================================================================================================
--
Spinal Cord Toolbox (4.2.2)
Folder testing-qc has been created.
Create temporary folder (/tmp/sct-20210118113703.236996-label_vertebrae-2psfktwc)...
Traceback (most recent call last):
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/scripts/sct_propseg.py", line 626, in <module>
res = main(arguments)
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/scripts/sct_propseg.py", line 610, in main
img_seg = propseg(img_input, arguments)
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/scripts/sct_propseg.py", line 550, in propseg
image_centerline = optic.detect_centerline(image_input, contrast_type, verbose)
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/spinalcordtoolbox/centerline/optic.py", line 119, in detect_centerline
sct.run(cmd_optic, is_sct_binary=True, verbose=0)
File "/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/scripts/sct_utils.py", line 311, in run
raise RunError(output)
sct_utils.RunError: OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
OpenCV Error: Assertion failed (dsize.area() > 0) in resize, file /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp, line 3214
terminate called after throwing an instance of 'cv::Exception'
what(): /myopt/opencv/opencv-3.0.0/modules/imgproc/src/imgwarp.cpp:3214: error: (-215) dsize.area() > 0 in function resize
Hi @Merve. I’ve spoken with @jcohenadad, and to add onto his suggestion here, it turns out there are some additional things that need to be downloaded to the data/ subfolder. (They weren’t downloaded because the installation was interrupted by the initial error.)
I have written a tiny script for you to do it automatically. download_data.sh (590 Bytes)
Please download this script then run the following commands:
# chmod is needed because files uploaded to the forum lose +x permission
chmod +x download_data.sh
./download_data.sh
First of all, thank you very much for all the help and writing a script!
Unfortunately, I get an error while running the script.
I am attaching the output: download_data_output.txt (4.9 KB)
My apologies! The error was because I had added an unnecessary step to download_data.sh. So, feel free to ignore the warning from my script and run sct_testing.
Thank you very much for your reply and I am sorry for asking so many questions! But unfortunately, I still get an error.
Actually, I would not need the deepseg related commands but I would definitely need the propseg…
I am attaching the output of sct_testing after I ran your script.
You will want to make sure that your .bashrc file matches whichever location you copied the PAM50 template to in your earlier comment. (My guess is that this was /home/willi/sct_4.2.2.) You can edit the .bashrc file by running:
nano ~/.bashrc
Then, near the bottom you should see something similar to the following lines:
In my case, both PATH and SCT_DIR point to /home/joshua/sct_4.2.2. In your case, the file should be edited to say, for example, /home/willi/sct_4.2.2 instead.
Once the correct locations have been set, exit out of the text editor, and reload the configuration using this command:
source ~/.bashrc
Then, please run this updated script to download the missing models: download_data_v2.sh (355 Bytes)
Thank you very much for all the help, detailed explanations and for your time! Now it works
Actually it is very interesting because in my bashrc profile I had the correct SCT location (I had to add this manually because it was not automatically added, probably because the installation was interrupted).
and I manually copied the PAM50 models (as Dr Cohen-Adad suggested) to this folder: /data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/data/
and when I used the download_data bash script to download the remaining data, I have seen that, the folders were actually placed inside the correct folder (/data/u_mkaptan_software/SpinalCord_version422/spinalcordtoolbox-4.2.2/data/) as well.
Now it worked (after running the second version of download data)!