WCHN / CTseg

Brain CT image segmentation, normalisation, skull-stripping and total brain/intracranial volume computation.
GNU General Public License v3.0
62 stars 16 forks source link

Error when building Dockerfile, step18 #20

Closed Sichtermann closed 1 year ago

Sichtermann commented 1 year ago

I have an error when building the docker image. System is an Ubuntu 20.04 server. The error persists, also when I'm running the given docker command for segmentation. Is there an easy solution or fix? Thanks for sharing!

Step 18/20 : RUN /opt/spm12/spm12 eval "spm_CTseg(1)"; exit 0
 ---> Running in c38a6bc18c43
SPM12, version 8168 (standalone)
MATLAB, version 9.11.0.1769968 (R2021b)
 ___  ____  __  __                                            
/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM12 - https://www.fil.ion.ucl.ac.uk/spm/

Downloading model files (first use only)... done.
Extracting model files  (first use only)... done.
Error using nifti (line 101)
Invalid syntax.
Error in nifti (line 101)
Error in spm_CTseg (line 138)
Error in spm_standalone (line 146)
brudfors commented 1 year ago

Hi @Sichtermann

Thank you for reporting this issue. Could you please try the brudfors-patch-1 branch and see if that resolves it?

Thank you

gllmflndn commented 1 year ago

@brudfors I was looking at this too 😃 I guess the brudfors-patch-1 will make the installation step open the batch interface instead of downloading the files. Instead I added a try/catch in the Dockerfile to hide the harmless error message (the container should still be created correctly).

@Sichtermann Do you get the same error when running the docker image on some data? If so, could you show the command line that you are using?

Sichtermann commented 1 year ago

Hi! Thanks for the immidiate responses!

I just looked into it:

brudfors-patch-1 build is not running though, stopping at

Step 18/20 : RUN /opt/spm12/spm12 eval "spm_CTseg(1)"; exit 0
 ---> Running in 06c582e472ad
SPM12, version 8168 (standalone)
MATLAB, version 9.11.0.1769968 (R2021b)
 ___  ____  __  __                                            
/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM12 - https://www.fil.ion.ucl.ac.uk/spm/

Downloading model files (first use only)... done.
Extracting model files  (first use only)... done.
Error using nifti (line 101)
Invalid syntax.
Error in nifti (line 101)
Error in spm_CTseg (line 138)
Error in spm_standalone (line 146)
Removing intermediate container 06c582e472ad

The main branch has the same error however runs through.

When running the command the same error appears:

t@nrad-t550b:/mnt/fast_storage_sda/applications/segmentation/ctseg/CTseg_mainBranch$ docker run --rm -it -v dir_host:/data ubuntu:ctseg function spm_CTseg '../data/SPM_CT.nii'
SPM12, version 8168 (standalone)
MATLAB, version 9.11.0.1769968 (R2021b)
 ___  ____  __  __                                            
/ __)(  _ \(  \/  )                                           
\__ \ )___/ )    (   Statistical Parametric Mapping           
(___/(__)  (_/\/\_)  SPM12 - https://www.fil.ion.ucl.ac.uk/spm/

Error using read_hdr (line 39)
Error reading header file "../data/SPM_CT.nii".
Error in read_hdr (line 39)
Error in nifti (line 26)
Error in spm_CTseg (line 138)
Error in spm_standalone (line 132)
gllmflndn commented 1 year ago

Thanks for the update @Sichtermann. I think for now you can ignore the error when building the image as it finishes successfully - we will make some change to hide it.

For the error you get at runtime, it seems that it comes from the fact that the input image cannot be found. Have you replaces dir_host in the command line for the directory containing SPM_CT.nii? This is mandatory here and you could then specify the input NIfTI file as just SPM_CT.nii.

Sichtermann commented 1 year ago

Oh wow, how could I miss that.. Might have been distracted by the error message at build time. Working now. Thanks!

gllmflndn commented 1 year ago

Thanks - it's indeed a bit distracting. I pushed a change to hide the error message. Closing for now.