WCHN/CTseg

Error running CTseg in Docker

Closed this issue · 3 comments

  1. correction in running the docker image should be to use ubuntu:ctseg instead of ubuntu/ctseg for the image name.

  2. I had to wrap function spm_CTseg('/data/CT.nii') in double quotes to avoid getting the error:
    bash: syntax error near unexpected token ('`

  3. With the above correction implemented, when I try to run CTseg I get the following errors:
    docker run --rm -it -v /data/CT.nii:/data/CT.nii ubuntu:ctseg function "spm_CTseg('/data/CT.nii')"

Error using spm_cli (line 56)
Cannot find module function spm_CTseg('/data/CT.nii').

Error in spm_cli (line 56)
Error in spm_standalone (line 157)

I tried another spm function (spm_get_space) and got the same error. However, spm_get_space works if a use eval instead of function
e.g.
docker run --rm -it -v /data/CT.nii:/data/CT.nii ubuntu:ctseg eval "spm_get_space('/data/CT.nii')"

but when I try it with CTSeg I get:

docker run --rm -it -v /data/CT.nii:/data/CT.nii ubuntu:ctseg eval "spm_CTSeg('/data/CT.nii')"

Error using eval
Undefined function 'spm_CTSeg' for input arguments of type 'char'.
Error in spm_standalone (line 146)

Any thoughts?

Just realized the last error was because I was calling spm_CTSeg instead of spm_CTseg. It is now working with the docker command:

docker run --rm -it -v /data/CT.nii:/data/CT.nii ubuntu:ctseg eval "spm_CTseg('/data/CT.nii')"

Thanks @maloneytc, it should also work like this:

docker run ... function spm_CTseg /data/CT.nii

Thanks! The run command is now fixed.