synthseg fails on data with three slices
Closed this issue · 1 comments
dangom commented
Hi,
first time ever trying mri_synthseg. Input is the mean volume of an EPI series. The volume has dimensions 64x64x3, so definitely 3D. SynthSeg complains the data is 2D.
base ❯ mri_synthseg --i mean.nii.gz --o seg.nii.gz
SynthSeg 2.0
using 1 thread
DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
predicting 1/1
Error: input should have 3 dimensions, had 2
BBillot commented
HI, I've just seen this, sorry for the late answer.
Considering the dimensions of your image, it's either very tightly cropped around a particular region, or at extremely low resolution. Either way SynthSeg is likely going to return a pretty bad segmentation (I mean, I'd be surprised if a segmentation algorithm would work on this type of data...).
So I fixed the printed message:
- if your image is 3D with less than 3 slices the program will refuse to segment it,
- if your image is 3D with a number of slices between 4 and 10, the program will run but will print a warning
- if your image is 3D with more than 10 slices, it will run normally.
Hope this helps,
Closing this for now.