[ITK] [ITK-users] Too many label objects detected when only 3

Chr. Rossmanith cr at neuro.ma.uni-heidelberg.de
Fri Apr 10 10:11:37 EDT 2015


Hi,

your image isn't a true binary image but has some gray values close to 0 
(black) and some gray values close to 255 (white). I've converted it to 
a pure black-white PNG and now three regions should be detected. I guess 
JPG does some anti aliasing which introduces the additional grey values.

Christina Rossmanith



On 10.04.2015 14:32, Francisco Lopez de la Franca wrote:
> Hi all.
> I've just tested itk::BinaryImageToShapeLabelMapFilter with an B/W 
> image (see attachment) containing only 3 object.
>
> I call the following methods:
>
> > binaryImageToShapeLabelMapFilter->ComputePerimeterOn();
> > binaryImageToShapeLabelMapFilter->SetInputForegroundValue(255);
> > binaryImageToShapeLabelMapFilter->SetOutputBackgroundValue(0);
> > binaryImageToShapeLabelMapFilter->Update();
>
> > LabelMapType::Pointer labelMap = 
> binaryImageToShapeLabelMapFilter->GetOutput();
>
> > int nrOfLabelObjects = labelMap->GetNumberOfLabelObjects();
>
> When I display the number of of label objects, the result is 246.
>
> Does anybody know why this behaviour?
>
> Thanks a lot.
> My best regards.
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150410/a67d7ada/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poligonos_bw.png
Type: image/png
Size: 758 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20150410/a67d7ada/attachment-0001.png>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users


More information about the Community mailing list