[Insight-users] user initialization of Level Set segmentation using SpatialObjects (and correction to example SpatialObjectToImage3.cxx)

Juan Cardelino juan.cardelino at gmail.com
Mon Jun 27 10:32:27 EDT 2011


Dear all,
            I'm using some level set algorithms segmentation
algorithms, and I want to initialize them with an user-drawn contour.
In addition, I will be passing countours back and forth from the user
to the algorithm. I've been looking at the SpatialObject framework and
seem the way to go. In a simple case, I could use a
PolygonSpatialObject, transform it to an image (mask), and use any of
the signed distance computation filters (i.e. Danielsson). If I want
to handle the case of non conected shapes, I guess I need to switch to
a ContourSpatialObject. My question here is the following: what's
inside for this kind of objects? Only the points over the contour are
inside or also the pixels in the region delimited by the contour?

This is a very common task while working with level-sets, so if anyone
has a simple/cleaner solution I will be glad to hear suggestions.

While playing with this, I found that the example
SpatialObjectToImage3.cxx outputs an image with 0 and 1 values. If you
look at it without care, you will see a black image. I think this
could confuse the user, maybe it is better to just output a 0-255
image. Adding these simple lines to the example it can be improved:

  polygon->SetDefaultInsideValue(255);
  polygon->SetDefaultOutsideValue(0);
  imageFilter->SetUseObjectValue( true );
  imageFilter->SetOutsideValue( 0 );

I could contribute with this new example but I'm still confused about
the organization of examples in ITK. There are at least 3 places for
examples:
1) Inside the ITK source tree: <itk
path>/ITK/Examples/Filtering/SpatialObjectToImage3.cxx
2) ITK wiki: http://www.itk.org/Wiki/ITK/Examples (BTW, I guess
http://www.vtk.org/Wiki  and http://www.paraview.org/Wiki are just the
same wiki right?)
3) GIT: git://gitorious.org/itkwikiexamples/itkwikiexamples.git

So, where the heck should I put my examples, I guess the wiki is the
only place I have write access. And more important, where should I
look for examples as the main place?

As usual, thanks for your time.
Best regards,
                   Juan


More information about the Insight-users mailing list