lchdl / DeepWMH

DeepWMH: Annotation-free white matter hyperintensity (WMH) lesion segmentation tool using deep learning.
Apache License 2.0
9 stars 1 forks source link

_parallel_ROBEX_masking crash #3

Closed FHannan-UWO closed 6 months ago

FHannan-UWO commented 7 months ago

Hi,

Having a bit of an issue with the script that I'm not sure how to fix. I'll paste the end of the terminal below:

This worker has ended successfully, no errors to report
predicting /home/lab2/WMH/testdata/output/002_Segmentations/001_raw/P3V1.nii.gz
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 255, 255, 223)
patch size: [112 160 128]
steps (x, y, and z): [[0, 48, 95, 143], [0, 48, 95], [0, 48, 95]]
number of tiles: 36
computing Gaussian
prediction done
inference done. Now waiting for the segmentation export to finish...
force_separate_z: None interpolation order: 1
separate z: False lowres axis None
3mm postproc : |==================| 100% << 1s|0s
masking : |                  | 0% << 0s -

==========
One of the worker process crashed due to unhandled exception.
Worker function name is: "_parallel_ROBEX_masking".

** Here is the traceback message:

Traceback (most recent call last):
  File "/home/lab2/WMH/DeepWMH/deepwmh/utilities/parallelization.py", line 30, in __call__
    result = self.__callable_object(*args, **kwargs)
  File "/home/lab2/WMH/DeepWMH/deepwmh/main/predict.py", line 43, in _parallel_ROBEX_masking
    run_shell('%s %s %s %s' % (ROBEX_sh, in_flair, brain_out, brain_mask), print_output=False)
  File "/home/lab2/WMH/DeepWMH/deepwmh/utilities/external_call.py", line 72, in run_shell
    exit('Error occurred (code %s) when executing command:\n"%s"' % (s, command))
  File "/usr/lib/python3.10/_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: Error occurred (code 126) when executing command:
"/home/lab2/WMH/ROBEX/runROBEX.sh /home/lab2/WMH/testdata/output/001_Preprocessed_Images/P3V1_0000.nii.gz /home/lab2/WMH/testdata/output/002_Segmentations/003_postproc_fov/P3V1_brain.nii.gz /home/lab2/WMH/testdata/output/002_Segmentations/003_postproc_fov/P3V1_mask.nii.gz"

** Main process will exit now.

This was the input I used, testing it on one dataset:

DeepWMH_predict -i ~/WMH/testdata/P3V1.nii.gz -n P3V1 -m ~/WMH/model -o ~/WMH/testdata/output -g 0

lchdl commented 7 months ago

Hi @FHannan-UWO,

You can paste and execute the following command

/home/lab2/WMH/ROBEX/runROBEX.sh /home/lab2/WMH/testdata/output/001_Preprocessed_Images/P3V1_0000.nii.gz /home/lab2/WMH/testdata/output/002_Segmentations/003_postproc_fov/P3V1_brain.nii.gz /home/lab2/WMH/testdata/output/002_Segmentations/003_postproc_fov/P3V1_mask.nii.gz

into your bash shell to see what actually happened. It may give you some detailed error information.

lchdl commented 7 months ago

Also, from the error code 126 returned from your bash call, it seems that you don't have "execute" permission for the script /home/lab2/WMH/ROBEX/runROBEX.sh. Use the following command:

chmod 755 /home/lab2/WMH/ROBEX/runROBEX.sh

to grant execute permission on that script. Then, run the same inference again to see if that solves the problem.

FHannan-UWO commented 7 months ago

@lchdl

Thanks for the suggestions, I managed to solve the problem by also giving execute permissions to the ROBEX file as follows:

chmod 755 /home/lab2/WMH/ROBEX/ROBEX

Also curious, do you plan to incorporate T1 images alongside FLAIR in the future?

lchdl commented 7 months ago

@FHannan-UWO, we actually considered adding T1-weighted images in the past, but decided against it for the following reasons: