[Insight-users] Re: Curvature in Level Set
Sah Rayman
sahrayman at yahoo.com
Fri, 5 Mar 2004 18:16:24 -0800 (PST)
I think I eliminated the possibility that my code was
wrong. I did one more test using original ITK code.
1. Compile
ITK/Examples/Segmentation/ThresholdSegmentationLevelSetImageFilter.cxx.
2. Make the input image to have 2 values, one for
background, and the other for a R=80 binary circle.
Calculate upper and lower threshold so that level set
will grow inside the circle, and shrink otherwise.
3. Set initial radius to be 60, make sure after 400
iterations, level set converges to the true edge.
4. Set breakpoint in
itkSegmentationLevelSetImageFilter.h,
InitializeIteration() (Line 438), set it break only
after count >=399
5. After 4, set break point in
itkLevelSetFunction.txx, ComputeMeanCurvature() (Line
181)
6. Watch ( curvature_term / gd->m_GradMagSqr )
Theoretical curvature is: 1/80 = 0.0125
I observe a range from (-0.25, +0.5)
That's true for both curvatureweight = 1e-6 and 1
Now the question is, is that exactly what the
algorithm (Sethian Book, pp. 70, eq6.36) should behave
like, or there is some bug in ITK implementation?
I tried to had a look at some related ITK calculation,
but don't have a clue yet.
The algorithm itself has some space for calculation
errors. Especially, a numerical calculation for 2nd
order derivative could be away from truth. But still,
I am not really confident about this.
--- Sah Rayman <sahrayman at yahoo.com> wrote:
> I found some "wierd behavior" of the curvature
> calculated in SegmentationLevelSetFunction.
>
> While I expect the curvature to be 0.0125
> everywhere,
> the actual curvature has a mean of 0.0137 (which is
> good), but a s.t.d of 0.4. In another words, when
> the
> tangent circle is actually of radius 80, the
> calculation tells me the radius is 2 or 1 at some
> edge
> points, and even concave in some other points.
>
> Is it true that there are errors in curvature
> calculation in the range of my discription? Or,
> there
> must be something wrong in my application?
>
> ======================================
> Here is what I do in the test.
>
> Full image is 256x256, ground truth is a circle
> whose
> radius is 80 pixels, initial is a 60-pixel-radius
> circle with a same center.
>
> I disabled advection, curvature term, and there are
> only speed term. Speed is +1 inside my ground truth,
> and -1 otherwise. In fact, curvature weight is 1e-6
> to
> enable the curvature calculation.
>
> After 180 iterations, I observe the output of
> ComputeMeanCurvature() for one iteration, and take
> statistics.
>
> The output segmentation matches well with my ground
> truth.
> ======================================
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you’re looking for faster
> http://search.yahoo.com
>
__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com