[Insight-users] Chan & Vese Level Set Segmentation

Amy C mathematical.coffee at gmail.com
Tue Feb 23 04:34:59 EST 2010


Hi,

For a while I've been using the Chan & Vese level set segmentation classes
from http://www.insight-journal.org/browse/publication/322 and
http://www.insight-journal.org/browse/publication/323. (kudos to the
authors!)
For anyone planning to use this code in the future, here are some bugs I
noticed (I didn't really look at the sparse implementation, this is for the
function/dense filter code only):

-        itkAtanRegularizedHeavisideStepFunction.h - in CalculateDerivative:
derivative should be 1/pi*1/epsilon*1/(1+(x/epsilon)^2), not
1/pi*1/(1+(x/epsilon)^2)   (most people use epsilon==1 so there may be no
noticable difference)

-        itkRegionBasedLevelSetFunction.txx - in ComputeGlobalTerm: in the
part that calculates the overlap term of the update, there's a call to
ComputeOverlapParameters which is only calculated when the overlap penalty
weight is non-zero. However ComputeOverlapParameters also calculates an
extra value called 'product' in the code, which holds product_{ i != current
function id } (1-Heaviside(level set i)). This term is required to calculate
the background term of the update (u_0 - backgroundAverage)^2*product. This
means that if the overlap penalty isn't 0 the background intensity term is
calculated correctly, but if the overlap penalty is 0, then '1' is used for
'product' instead of product_{ i != current function id } (1-Heaviside(level
set i)). Should be modified so that product is calculated regardless of the
overlap penalty.

-        itkMultiphaseDenseFiniteDifferenceImageFilter - in ApplyUpdate: has
a variable m_ReinitializeCounter that is meant to reinitalise the level set
function to a signed distance function every m_ReinitalizeCounter
iterations. However at the moment if the filter doesn't reinitalize the
level set function, it won't update it either. (It should update every
iteration, reinitalize every m_ReinitializeCounter iterations instead of
only update & reinitalize every m_ReinitializeCounter iterations, and do
nothing on the other iterations). At the moment users won't notice a
difference because you can't set m_ReinitializeCounter with public access.

-        itkMultiphaseDenseFiniteDifferenceImageFilter - in
CopyInputToOutput - at the moment calling GetOutput() on the dense level set
filter will return the segmentation given by the highest-index level set
function. It should really give the segmentation given by all level sets -
according to the sparse filter, GetOutput() should return an image that is
default 0, and takes the value i where the i'th level set indicates this
region is foreground (value < 0). In the case of overlap the highest index
wins. Just need to initialise the output with FillBuffer(0) and remove the
'else' clause from 'if (in.Get() < 0)'

- possibly want to make ComputeHessian virtual in
itkRegionBasedLevelSetFunction.h so that subclasses could override it
(debatable, not really a bug)

If unwilling to change the original files you could create a subclass and
override the respective functions with the fixes.

cheers,
Amy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100223/e050efff/attachment-0001.htm>


More information about the Insight-users mailing list