Source of errors:<br><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><i>  labelOverlayFilter-&gt;SetInput(reader1);<br>  labelOverlayFilter-&gt;</i></span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><i>SetLabelImage(&quot;result.png&quot;);</i></span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><i><br></i></span></font></div><div><div class="gmail_quote">On Wed, Jun 29, 2011 at 1:11 PM, john smith <span dir="ltr">&lt;<a href="mailto:mkitkinsightuser@gmail.com">mkitkinsightuser@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br><br>I am trying to use itkLabelOverlayImageFilter. My initial image (which I segment) is a greyscale image  (with values 0-255) and I load it using a dialog box of Qt, as it seems<br>
<br><i>  typedef   float           InternalPixelType;<br>
  const     unsigned int    Dimension = 2;<br>  typedef itk::Image&lt; InternalPixelType, Dimension &gt;  InternalImageType;<br>  typedef  itk::ImageFileReader&lt; InternalImageType &gt; ReaderType;<br>  ReaderType::Pointer reader1 = ReaderType::New();<br>

  reader1-&gt;SetFileName(fileName.toStdString());</i><br><br>The result of my segmentation is a binary image , which is been saved wih name &quot;result.png&quot;, and I use a reader to read this file:<br><br><i>ReaderType::Pointer reader2 = ReaderType::New();<br>


  reader2-&gt;SetFileName(&quot;result.png&quot;);</i><br><br>I want to ask how I could use itkLabelOverlayImageFilter and what changes I should make in order to work properly. Any example whould be very useful , as I am confused with the image type casting.<br>

<br>I have tried something like this, But I got errors:<br><br><i>   typedef itk::RGBPixel&lt;unsigned char&gt; RGBPixelType;<br>  typedef itk::Image&lt;RGBPixelType&gt; RGBImageType;<br><br> typedef itk::LabelOverlayImageFilter&lt;OutputImageType, OutputImageType, RGBImageType&gt; LabelOverlayFilterType;<br>

  LabelOverlayFilterType::Pointer labelOverlayFilter = LabelOverlayFilterType::New();<br>  labelOverlayFilter-&gt;SetInput(reader1);<br>  labelOverlayFilter-&gt;SetLabelImage(&quot;result.png&quot;);<br>  labelOverlayFilter-&gt;SetOpacity(1.0);<br>

  labelOverlayFilter-&gt;ResetColors(); // reset color map<br>  labelOverlayFilter-&gt;AddColor(0, 0, 255); // fill color map with blue<br>  labelOverlayFilter-&gt;SetBackgroundValue(0); // don&#39;t overlay the background, i.e., label 0<br>

  labelOverlayFilter-&gt;Update();</i><br><br>Thanks in advance<br><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">

</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.html" target="_blank">http://www.kitware.com/products/protraining.html</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://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>