InsightSoftwareConsortium / ITKThickness3D

An ITK module to compute 3D thickness
Apache License 2.0
39 stars 18 forks source link

Import error with new itk version 5.3.0 #47

Closed mbrei closed 1 year ago

mbrei commented 1 year ago

Description

With the latest release of itk (version 5.3.0) the BinaryThinningImageFilter3D does not work anymore, and the import fails with an AttributeError.

Steps to reproduce

Package versions:

itk==5.3.0
itk-core==5.3.0
itk-filtering==5.3.0
itk-io==5.3.0
itk-numerics==5.3.0
itk-registration==5.3.0
itk-segmentation==5.3.0
itk-thickness3d==5.2.0

Minimal example:

import itk

PixelType = itk.ctype("unsigned char")
ImageType = itk.Image[PixelType, 3]
image = ImageType.New()

skeleton = itk.binary_thinning_image_filter3_d(image)

fails with the following error message:

Traceback (most recent call last):
    skeleton = itk.binary_thinning_image_filter3_d(image)
  File "/Users/mariebrei/opt/anaconda3/envs/test_env/lib/python3.9/site-packages/itk/support/lazy.py", line 138, in __getattribute__
    base.itk_load_swig_module(module, namespace)
  File "/Users/mariebrei/opt/anaconda3/envs/test_env/lib/python3.9/site-packages/itk/support/base.py", line 132, in itk_load_swig_module
    l_module = loader.load(swig_module_name)
  File "/Users/mariebrei/opt/anaconda3/envs/test_env/lib/python3.9/site-packages/itk/support/base.py", line 291, in load
    l_spec.loader.exec_module(l_module)  # pytype: disable=attribute-error
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/mariebrei/opt/anaconda3/envs/test_env/lib/python3.9/site-packages/itk/support/../Thickness3DPython.py", line 13, in <module>
    from . import _Thickness3DPython
AttributeError: PyCapsule_Import "_ITKCommonPython._C_API" is not valid

With itk==5.2.1.post1 everything works as expected.

Jingnan-Jia commented 1 year ago

Any update till now?

thewtex commented 1 year ago

Hi,

Thanks for the report.

Please upgrade to itk-thickness3d 5.3.0 to address this issue (just released).