[ITK] Getting a pixel in a labelled region

Girish, Gavaskar Ruturaj gavaskar.ruturaj.girish at philips.com
Thu Jun 12 02:37:43 EDT 2014


Dear all,

If I want to get any random index of a particular label in a labelled binary image, how do I go about it? As an example, let's say have a labelled binary image containing 8 objects labelled 1,2,....,8. I want get the indices of any random pixel with label 5, i.e. any pixel which belongs to the region labelled 5. I tried getting the centroid using LabelGeometryImageFilter, but for objects which are not convex, the centroid may not lie inside the region. Is there any method to get a random pixel index?

Thanks as always & Regards,
Ruturaj

________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140612/1f5a12c5/attachment.html>


More information about the Community mailing list