[Insight-users] Mask boundary to ordered set of points
Benjamin King
king.benjamin at mh-hannover.de
Thu Nov 4 05:00:34 EST 2004
Hi Radhika,
I needed such a thing and made it myself als follows:
1) Find bounding box of the object, cut with itk::RegionOfInterestImageFilter
2) Erode
3) Get border pixels by subtracting the erosion from the original
4) Iterate the result image and push all points in a std::vector
I iterated the whole region, but probably you can use a variant of
itk::FloodFilledFunctionConditionalConstIterator as well.
> Or is there any function, where if you start from a boundary point, you
> can move in a specified direction (clockwise or counterclockwise) and
> get an ordered set of indices visited?
This requires a border that is equivalent to a circle. Only two-dimensional
objects with just one component, no holes and no thin (i.e. one pixel wide)
areas meet this requirement. I don't think, there is a special class in ITK
for those.
Hope it helps,
Benjamin
--
Benjamin King
Institut für Medizinische Informatik
Medizinische Hochschule Hannover
Tel.: +49 511 532-2663
More information about the Insight-users
mailing list