[ITK] MATLAB bwareaopen() equivalent in ITK

Bradley Lowekamp blowekamp at mail.nih.gov
Tue May 20 07:28:10 EDT 2014


Hello,

You should look into the LabelMap Module and framework[1]. The ITK LabelMap class hold a Run Length Encoded (RLE) labeled image, which can be converted from a binary[2], or label image[3]. Additionally, there can be statistics associated with each of these label objects.

More specifically the BinaryShapeOpeningImageFilter[4] will do exactly what you need if you set the attribute to NUMBER_OF_PIXELS and the Lambda to the threshold value. This filter will convert you binary image to an ITK label map, compute the required statistics, remove the label objects below the threshold and then create the binary image. It should do the same that as bwareaopening. The LabelMap module has a lot of very useful and specific filters for manipulating objects based of shape and attributes.

The LabelMap module was contributed through the Insight Journal by Gaetan Lehman[6].

Hope that helps,
Brad

[1] http://www.itk.org/Doxygen/html/group__ITKLabelMap.html
[2] http://www.itk.org/Doxygen/html/classitk_1_1BinaryImageToLabelMapFilter.html
[3] http://www.itk.org/Doxygen/html/classitk_1_1LabelImageToLabelMapFilter.html
[4] http://www.itk.org/Doxygen/html/classitk_1_1BinaryShapeOpeningImageFilter.html
[5] http://www.itk.org/Doxygen/html/classitk_1_1ShapeLabelObject.html#ae0f49d30bbbe68d6d56d5192d7ace314
[6]  http://hdl.handle.net/1926/584

On May 20, 2014, at 4:35 AM, Jon Haitz Legarreta <jhlegarreta at vicomtech.org> wrote:

> Dear Ruturaj,
> binary math morphology filters [1] will be of help for this task. The itk::BinaryOpeningByReconstructionImageFilter [2] is probably the filter you are looking for.
> 
> HTH,
> JON HAITZ
> 
> [1] http://www.itk.org/Doxygen/html/group__ITKBinaryMathematicalMorphology.html
> [2] http://www.itk.org/Doxygen/html/classitk_1_1BinaryOpeningByReconstructionImageFilter.html
> 
> 
> On 20 May 2014 10:09, Girish, Gavaskar Ruturaj <gavaskar.ruturaj.girish at philips.com> wrote:
> Dear all,
> 
>  
> 
> Is there a class in ITK which provides functionality to remove small white objects in a binary image, similar to the function bwareaopen() in MATLAB? If not, how can this be done?
> 
>  
> 
> Thanks & 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.
> 
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
> 
> 
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140520/79b1e8db/attachment-0002.html>


More information about the Community mailing list