InsightSoftwareConsortium / ITKThickness3D

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

Not found MedicalThicknessImageFilter3D #50

Open chuanqiWen opened 1 year ago

chuanqiWen commented 1 year ago

Why I have installed itk and itk-thickness3d, but can't find MedicalThicknessImageFilter3D?

T4mmi commented 1 year ago

Hi, could you give us the code you use and the error you get ?
This filter is called MedialThicknessImageFilter3D not MedicalThicknessImageFilter3D and it is directly accessible at itk-level...

Have you tried the code sample given in the README ?

import itk

input_filename = sys.argv[1]
output_filename = sys.argv[2]

image = itk.imread(input_filename)
thickness_map = itk.MedialThicknessImageFilter3D.New(image)

itk.imwrite(thickness_map, output_filename)
chuanqiWen commented 1 year ago

I have tried the code sample given in the README, and got the same error.

Traceback (most recent call last): File "itk_sctipt.py", line 8, in thickness_map = itk.MedialThicknessImageFilter3D.New(image) File "D:\Anaconda3\lib\site-packages\itk\support\lazy.py", line 76, in getattribute base.itk_load_swig_module(module, namespace) File "D:\Anaconda3\lib\site-packages\itk\support\base.py", line 110, in itk_load_swig_module l_module = loader.load(swig_module_name) File "D:\Anaconda3\lib\site-packages\itk\support\base.py", line 259, in load l_spec.loader.exec_module(l_module) # pytype: disable=attribute-error File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "D:\Anaconda3\lib\site-packages\itk\support..\Thickness3DPython.py", line 13, in from . import _Thickness3DPython ImportError: DLL load failed:

T4mmi commented 1 year ago

Then you will have to investigate your python / conda versions and installations ...

The following samples will reproduce a minimal test case that should work on any platform (with conda ofc)

conda create --name dummy
conda activate dummy
python -m pip install itk itk-thickness3d
python -c "from itk  import MedialThicknessImageFilter3D"