itk_seed = itk.GetImageFromArray(init_levelset.astype(np.float32))
InternalImageType = itk.Image[itk.F, 3]
geodesicActiveContour = itk.GeodesicActiveContourLevelSetImageFilter[InternalImageType,InternalImageType,itk.F].New(itk_seed)
geodesicActiveContour.SetPropagationScaling(10.0)
geodesicActiveContour.SetCurvatureScaling(1.0)
geodesicActiveContour.SetAdvectionScaling(1.0)
geodesicActiveContour.SetMaximumRMSError(0.02)
geodesicActiveContour.SetNumberOfIterations(60)
geodesicActiveContour.SetFeatureImage(itk_img_sigmoid)
geodesicActiveContour.Update()
itk_GAC = geodesicActiveContour.GetOutput()
I used this piece of code for a 3d level set segmentation step. It worked okay previously. After updating to 5.0 today, I got the following error:
AttributeError Traceback (most recent call last)
in
5 InternalImageType = itk.Image[itk.F, 3]
6
----> 7 geodesicActiveContour = itk.GeodesicActiveContourLevelSetImageFilter[InternalImageType,InternalImageType,itk.F].New(itk_seed)
8 geodesicActiveContour.SetPropagationScaling(10.0)
9 geodesicActiveContour.SetCurvatureScaling(1.0)
c:\users\jianxuc\appdata\local\continuum\anaconda3\envs\segmenter\lib\site-packages\itkLazy.py in getattribute(self, attr)
42 module = self.__belong_lazy_attributes[attr]
43 namespace = {}
—> 44 itkBase.LoadModule(module, namespace)
45 for k, v in namespace.items():
46 setattr(self, k, v)
c:\users\jianxuc\appdata\local\continuum\anaconda3\envs\segmenter\lib\site-packages\itkBase.py in LoadModule(name, namespace)
61 else:
62 swig = namespace.setdefault(‘swig’, imp.new_module(‘swig’))
—> 63 swig.dict.update(this_module.swig.dict)
64
65 # don’t worry about overwriting the symbols in namespace – any
AttributeError: module ‘ITKLevelSets’ has no attribute ‘swig’
BTW, is there a more detailed documentation about new pythonic interface? For example, I want to use itk.GeodesicActiveContourLevelSetImageFilter. What is the pythonic way to use it?
Many thanks,
Jianxu