# active contour without edge

**URL:** https://discourse.itk.org/t/active-contour-without-edge/1932
**Category:** Algorithms
**Tags:** python
**Created:** [May 31, 2019, 11:14pm UTC](https://discourse.itk.org/t/active-contour-without-edge/1932 "2019-05-31T23:14:16Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![Jianxu\_Chen](https://discourse.itk.org/user_avatar/discourse.itk.org/jianxu_chen/32/809_2.png) [@Jianxu\_Chen](https://discourse.itk.org/u/Jianxu_Chen)
#### Post date: [June 3, 2019, 5:26pm UTC](https://discourse.itk.org/t/active-contour-without-edge/1932/13 "2019-06-03T17:26:12Z")

</div>

@blowekamp thanks for pointing that out. That’s really helpful.

But, I am having a hard time to find any instruction on how to use it. What I found is [http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python\_html/300\_Segmentation\_Overview.html](http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/300_Segmentation_Overview.html)

But, it does not have a demo of ScalarChanVese, only saying it is supported. I tried a few different ways, my current one is

lsFilter = sitk.ScalarChanAndVeseDenseLevelSetImageFilter()  
lsFilter.SetMaximumRMSError(0.02)  
lsFilter.SetNumberOfIterations(20)  
ls = lsFilter.Execute(init\_levelset, itk\_img\_smooth)

But, I cannot any public member function to set other parameters like number of iterations and RMSError. I think there should be some paramter to control the curvature? Anyway, above code still gives me

Traceback (most recent call last):  
File “test\_ac.py”, line 110, in   
ls = lsFilter.Execute(init\_levelset, itk\_img\_smooth)  
File “/home/jianxuc/anaconda3/lib/python3.6/site-packages/SimpleITK/SimpleITK.py”, line 58659, in Execute  
return \_SimpleITK.ScalarChanAndVeseDenseLevelSetImageFilter\_Execute(self, \*args)  
NotImplementedError: Wrong number or type of arguments for overloaded function ‘ScalarChanAndVeseDenseLevelSetImageFilter\_Execute’.  
Possible C/C++ prototypes are:  
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::Execute(itk::simple::Image const &,itk::simple::Image const &)  
itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::Execute(itk::simple::Image const &,itk::simple::Image const &,double,uint32\_t,double,double,double,double,double,double,double,double,itk::simple::ScalarChanAndVeseDenseLevelSetImageFilter::HeavisideStepFunctionType,bool)

Other info:  
raw is a np.float32 3D numpy array.

itk\_img = itk.GetImageFromArray(raw)  
gradientAnisotropicDiffusionFilter = itk.GradientAnisotropicDiffusionImageFilter.New(itk\_img)  
gradientAnisotropicDiffusionFilter.SetNumberOfIterations(5)  
gradientAnisotropicDiffusionFilter.SetTimeStep(0.0625)  
gradientAnisotropicDiffusionFilter.SetConductanceParameter(1.2)  
gradientAnisotropicDiffusionFilter.Update()  
itk\_img\_smooth = gradientAnisotropicDiffusionFilter.GetOutput()

Any thoughts? Or any advice on documentation or intructions?

Many thanks!

---

_[View the full topic](https://discourse.itk.org/t/active-contour-without-edge/1932)._
