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="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; 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%;" id="avg_ls_inline_popup">
</div>