Hello to all,<br><br>I had used the itkLabelOverlayImageFilter in 2D and I didn;t have any problem. No I am trying to use tis filter in 3D. I have written exactly the same code but for 3D, and I get this error which I don't know what exactly means.<br>
<br>the error is the following:<br>error C2440: 'initializing' : cannot convert from 'itk::Concept::Detail::UniqueType_unsigned_int<__formal>' to 'itk::Concept::Detail::UniqueType_unsigned_int<__formal>'<br>
<br>I hope someone could help me. <br>Thanks in advance<br><br>///////////// code///////////<br> typedef itk::Image<unsigned char, 3> ImageType;<br> ImageType::Pointer image1 = ImageType::New();<br> ImageType::Pointer image_label = ImageType::New();<br>
<br> typedef unsigned char InternalPixelType_add;<br> const unsigned int Dimension = 3;<br> typedef itk::Image< InternalPixelType_add, Dimension > InternalImageType_add;<br> typedef itk::ImageFileReader< InternalImageType_add > ReaderType_add;<br>
<br> ReaderType_add::Pointer reader1 = ReaderType_add::New();<br> reader1->SetFileName( fileName.toStdString() );<br> reader1->Update();<br> image1 = reader1->GetOutput();<br><br> ReaderType_add::Pointer reader2 = ReaderType_add::New();<br>
reader2->SetFileName( "result.hdr" );<br> reader2->Update();<br> image_label = reader2->GetOutput();<br><br><br> typedef itk::RGBPixel<unsigned char> RGBPixelType;<br> typedef itk::Image<RGBPixelType> RGBImageType;<br>
<br> typedef itk::LabelOverlayImageFilter<ImageType, ImageType, RGBImageType> <br> LabelOverlayImageFilterType;<br> LabelOverlayImageFilterType::Pointer labelOverlayImageFilter = LabelOverlayImageFilterType::New();<br>
labelOverlayImageFilter->SetInput(image1);<br> labelOverlayImageFilter->SetLabelImage(image_label);<br> // labelOverlayImageFilter->SetOpacity(.5);<br> labelOverlayImageFilter->SetOpacity(1.0);<br> labelOverlayImageFilter->ResetColors(); // reset color map<br>
labelOverlayImageFilter->AddColor(0, 0, 255); // fill color map with blue<br> labelOverlayImageFilter->SetBackgroundValue(0); // don't overlay the background, i.e., label 0<br> labelOverlayImageFilter->Update();<br>
<br> typedef itk::ImageFileWriter< RGBImageType > WriterType;<br> WriterType::Pointer writer = WriterType::New();<br> writer->SetFileName("output.hdr");<br> writer->SetInput(labelOverlayImageFilter->GetOutput());<br>
writer->Update();<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>