<div dir="ltr">That's correct. <div><br></div><div>Apart from looking at the number of label objects to confirm the correctness of the labeling, it is also usually useful to convert the label map to a label image and display/save that image (especially when the input binary image is not coming from an internal binarization process).</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 10, 2015 at 3:11 PM, Chr. Rossmanith <span dir="ltr"><<a href="mailto:cr@neuro.ma.uni-heidelberg.de" target="_blank">cr@neuro.ma.uni-heidelberg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Hi,<br>
      <br>
      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.<br>
      <br>
      Christina Rossmanith<div><div class="h5"><br>
      <br>
      <br>
      <br>
      On 10.04.2015 14:32, Francisco Lopez de la Franca wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>Hi all.<br>
                  </div>
                  I've just tested itk::BinaryImageToShapeLabelMapFilter
                  with an B/W image (see attachment) containing only 3
                  object.<br>
                </div>
                <br>
                I call the following methods:<br>
                <br>
                >
                binaryImageToShapeLabelMapFilter->ComputePerimeterOn();<br>
                >
                binaryImageToShapeLabelMapFilter->SetInputForegroundValue(255);<br>
                >
                binaryImageToShapeLabelMapFilter->SetOutputBackgroundValue(0);<br>
                > binaryImageToShapeLabelMapFilter->Update();<br>
                <br>
                > LabelMapType::Pointer labelMap =
                binaryImageToShapeLabelMapFilter->GetOutput();<br>
                <br>
                > int nrOfLabelObjects =
                labelMap->GetNumberOfLabelObjects();<br>
                <br>
              </div>
              When I display the number of of label objects, the result
              is 246.<br>
              <br>
            </div>
            Does anybody know why this behaviour?<br>
            <br>
          </div>
          Thanks a lot.<br>
        </div>
        My best regards.<br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_____________________________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>

Kitware offers ITK Training Courses, for more information visit:
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a>

Please keep messages on-topic and check the ITK FAQ at:
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Regards,<br>Girish</div></div>
</div>