[Insight-users] Questions about the fast marching and level set filters

Lydia Ng lng at insightful . com
Thu, 6 Jun 2002 11:09:46 -0700


Dear Bjorn,

> Finally, a question about the FastMarchingImageFilter: I have been
> using this for shape detection as well, growing a shape from a user
> selected seed point.  The problem I have here is that if the potential
> image has pixel values zero (if only infinitesimally), the region
> doesn't expand (even over time) to include these pixels in the region.
> This means that if I have a well defined region, with sharp edges
> around it, and some very small variations in the (practically)
> monotonous region inside, the fast marching filter fails to detect the
> entire region.  Is there a remedy for this, or is a limitation of this
> filter?

I think the FastMarchingImageFilter is doing exactly what is suppose
to in this case.
Options I can suggest are:
[1] Preprocessing: denoise or smooth the image before taking the =
gradient.
[2] Postprocessing: use morphology to close the holes.

-------------------------------
What the ShapeDetectionLevelSetFilter buys you is the ability to do
incorporate some smoothing into the process - that is what
the LengthPenaltyStrength term is about. It will try to limit the
length of the contour forces small holes to close up.

> How can I do, say, 5-10 iterations with a narrow band of
> 5 each time, rather than a single iteration with a narrow band of 35

A narrowband width defines the range around the zero level set which
is updated at each iteration. So running 5-10 iterations with narrowband
of 5 is not equivalent to running a single iteration with narrow band of =
35.
If you have a edge potential map of all ones then in the first case the
zero level set has moved 5-10 pixels out but in the second case it has
moved only one pixel out.

Typically a narrowband of 10-12 should be sufficient.

NB:
Fast marching returns you a time-crossing map - i.e. it returns the
solution for all time. You then threshold the map at times you want to
inspect.

The ShapeDetectionLevelSetFilter returns you the state of the levelset
at time =3D timestep * no. of iteration.=20
You will need to threshold the levelset at zero. Negative values =3D
inside the contour, positive values =3D outside the contour
--------------------------------

> Also, do you recommend that I rather switch to the more recent(?) code
> instead (SparseFieldLevelSetImageFilter/LevelSet3DFunction for
> example)?  I'm slightly confused by the different level set filters
> present in ITK, I'm unsure of which one is preferable to use, and I'll
> be happy for some advice here.

Sorry about the confusion there.
The narrowband stuff was implemented very early in this project and
has not yet be ported over to the same framework as the sparse field
stuff. This is on my list of things to do towards end of the year.

-Lydia

> -----Original Message-----
> From: Bjorn Hanch Sollie [mailto:bhs@pvv.org]
> Sent: Saturday, June 01, 2002 3:10 PM
> To: insight-users
> Subject: [Insight-users] Questions about the fast marching=20
> and level set
> filters
>=20
>=20
> I have some questions I will really, really appreciate to get some
> answers to:
>=20
> I have been doing some level set filtering using the
> ShapeDetectionLevelSetFilter.  The filter works fine and has given me
> great results so far, except I haven't quite figured out how to
> properly use narrow-banding yet (code below), so the filter takes very
> long to run. How can I do, say, 5-10 iterations with a narrow band of
> 5 each time, rather than a single iteration with a narrow band of 35?
> Do I use the ReinitializeLevelSetImageFilter for this, and if so how?
>=20
> Also, do you recommend that I rather switch to the more recent(?) code
> instead (SparseFieldLevelSetImageFilter/LevelSet3DFunction for
> example)?  I'm slightly confused by the different level set filters
> present in ITK, I'm unsure of which one is preferable to use, and I'll
> be happy for some advice here.
>=20
> Finally, a question about the FastMarchingImageFilter: I have been
> using this for shape detection as well, growing a shape from a user
> selected seed point.  The problem I have here is that if the potential
> image has pixel values zero (if only infinitesimally), the region
> doesn't expand (even over time) to include these pixels in the region.
> This means that if I have a well defined region, with sharp edges
> around it, and some very small variations in the (practically)
> monotonous region inside, the fast marching filter fails to detect the
> entire region.  Is there a remedy for this, or is a limitation of this
> filter?
>=20
> Here is my current (working) ShapeDetectionLevelSetFilter code:
>=20
>   // Begin level set shape detection
>   std::cout << "Shape Detection filtering..." << std::endl;
>   typedef itk::ShapeDetectionLevelSetFilter<ImageType,=20
> ImageType> ShapeDetectorType;
>   ShapeDetectorType::Pointer shaper =3D ShapeDetectorType::New();
>   shaper->SetInput(initiallevelset);
>   shaper->SetEdgeImage(edgepotentialimage);
>   shaper->SetLengthPenaltyStrength(0.01);
>   shaper->SetNumberOfIterations(175);
>   shaper->SetNarrowBanding(true);
>   shaper->SetNarrowBandwidth(35.0);
>   shaper->SetTimeStepSize(3.0);
>   shaper->Update();
>   // End level set shape detection
>=20
> -Bjorn
> --=20
> The History of the Universe
> Chapter 1: Bang!  Chapter 2: Sss...  Chapter 3: Crunch!
> The End
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>=20
>=20