KitwareMedical / ITKContourInterpolation

An implementation of morphological contour interpolation
http://hdl.handle.net/10380/3563
Apache License 2.0
30 stars 13 forks source link

Segmentation fault #110

Closed lorinczszabolcs closed 1 year ago

lorinczszabolcs commented 1 year ago

Hi!

I have been trying to make the interpolation work, but no matter what I try, it still returns segmentation fault, even for the official python example script with the provided sample data (SevenLabels.nrrd).

Package versions:

itk                                   5.3.0
itk-core                              5.3.0
itk-filtering                         5.3.0
itk-io                                5.3.0
itk-morphologicalcontourinterpolation 1.1.0
itk-numerics                          5.3.0
itk-registration                      5.3.0
itk-segmentation                      5.3.0

Script for reproducing error:

import itk
import sys

image = itk.imread('SevenLabels.nrrd', itk.UC)
filled = itk.morphological_contour_interpolator(image)
itk.imwrite(filled, 'Output.nrrd', compression=True)

Attached you can find the file just in case. SevenLabels.zip

EDIT: Upon debugging I found that this line is failing: https://github.com/InsightSoftwareConsortium/ITK/blob/835dc01388d22c4b4c9a46b01dbdfe394ec23511/Wrapping/Generators/Python/PyBase/pyBase.i#L389

Thank you for your help in advance!

dzenanz commented 1 year ago

What is the exact error message?

lorinczszabolcs commented 1 year ago

Hi! Thank you for getting back so quickly. Unfortunately, there is no output shown except Segmentation fault.

dzenanz commented 1 year ago

Which OS are you working on? Did you pip install everything, or did you use some other method? If you upgraded ITK from some previous version, it is worthwhile to manually clean up all itk* stuff in your site-pacakges, and then install again.

@tbirdso do you have further suggestions?

lorinczszabolcs commented 1 year ago

I'm working on Ubuntu 20.04.4 LTS inside WSL2. I created a new virtual env, and used

python -m pip install --upgrade pip
python -m pip install itk-morphologicalcontourinterpolation

I will start from scratch again, to see if I messed up something, will let you know if it worked.

lorinczszabolcs commented 1 year ago

Seems like a clean virtual env and only installing this package solved the issue, so I will close this for now. I will let you know if I find some package incompatibility meanwhile. Thank you for the quick help!