Source of errors:<br><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><i> labelOverlayFilter->SetInput(reader1);<br> labelOverlayFilter-></i></span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><i>SetLabelImage("result.png");</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"><<a href="mailto:mkitkinsightuser@gmail.com">mkitkinsightuser@gmail.com</a>></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< InternalPixelType, Dimension > InternalImageType;<br> typedef itk::ImageFileReader< InternalImageType > ReaderType;<br> ReaderType::Pointer reader1 = ReaderType::New();<br>
reader1->SetFileName(fileName.toStdString());</i><br><br>The result of my segmentation is a binary image , which is been saved wih name "result.png", and I use a reader to read this file:<br><br><i>ReaderType::Pointer reader2 = ReaderType::New();<br>
reader2->SetFileName("result.png");</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<unsigned char> RGBPixelType;<br> typedef itk::Image<RGBPixelType> RGBImageType;<br><br> typedef itk::LabelOverlayImageFilter<OutputImageType, OutputImageType, RGBImageType> LabelOverlayFilterType;<br>
LabelOverlayFilterType::Pointer labelOverlayFilter = LabelOverlayFilterType::New();<br> labelOverlayFilter->SetInput(reader1);<br> labelOverlayFilter->SetLabelImage("result.png");<br> labelOverlayFilter->SetOpacity(1.0);<br>
labelOverlayFilter->ResetColors(); // reset color map<br> labelOverlayFilter->AddColor(0, 0, 255); // fill color map with blue<br> labelOverlayFilter->SetBackgroundValue(0); // don't overlay the background, i.e., label 0<br>
labelOverlayFilter->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>