[ITK] MATLAB bwareaopen() equivalent in ITK

Jon Haitz Legarreta jhlegarreta at vicomtech.org
Tue May 20 05:08:35 EDT 2014


Dear Ruturaj,
did you try the filter?

The filter removes objects smaller than a structuring element in the image,
which as far as I understand, is your goal.

In principle, math morphology filters do not impose any a priori on your
object's shape.

Otherwise, you can use a filter to label the connected components [1] of
your binary image, then count the number of pixels corresponding to a
label, and delete some labels/connected components [2] according to a
threshold set on the number of pixels.

HTH,
JON HAITZ

[1]
http://www.itk.org/Doxygen/html/classitk_1_1BinaryImageToLabelMapFilter.html
[2]
http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/ManuallyRemovingLabels



On 20 May 2014 10:48, Girish, Gavaskar Ruturaj <
gavaskar.ruturaj.girish at philips.com> wrote:

>  Dear Jon,
>
> Thanks for your reply. I am looking for a filter which will remove all
> white objects containing less than a specified number of pixels, regardless
> of their shape. I am not sure if morphological operations, which the
> filters you mentioned are using, will be fully successful as the result
> will also depend on the objects’ shape. Is there a way to ‘threshold’
> objects based on their size (no. of pixels), possibly even involving
> multiple filters?
>
> Thanks & Regards,
>
> Ruturaj
>
>
>
> *From:* Jon Haitz Legarreta [mailto:jhlegarreta at vicomtech.org]
> *Sent:* Tuesday, May 20, 2014 2:06 PM
> *To:* Girish, Gavaskar Ruturaj
> *Cc:* community at itk.org
> *Subject:* Re: [ITK] MATLAB bwareaopen() equivalent in ITK
>
>
>
> 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/7ffddc07/attachment-0002.html>


More information about the Community mailing list