<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:10pt"><DIV>Hello!</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV id=result_box dir=ltr>I wanted my 3D watershed segmentation combine with VTK and&nbsp;to show it in a VTK window. For the connection between ITK and VTK, I used itkImageToVTKImageFilter. But it gives following error. </DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr><SPAN lang=DE-AT><SPAN lang=DE-AT>
<P>/home/hno4d/Desktop/MIRCIT/MIRCIT.cpp: In member function »virtual void MIRCIT::imageDisplayingWatershed()«:</P>
<P>/home/hno4d/Desktop/MIRCIT/MIRCIT.cpp:1719: Fehler: keine passende Funktion für Aufruf von »itk::ImageToVTKImageFilter&lt;itk::OrientedImage&lt;unsigned char, 3u&gt; &gt;::SetInput(itk::Image&lt;itk::RGBPixel&lt;unsigned char&gt;, 3u&gt;*)«</P>
<P>/home/hno4d/Desktop/MIRCIT/itkImageToVTKImageFilter.txx:79: Anmerkung: Kandidaten sind: void itk::ImageToVTKImageFilter&lt;TInputImage&gt;::SetInput(const TInputImage*) [with TInputImage = itk::OrientedImage&lt;unsigned char, 3u&gt;]</P>
<P>make[2]: *** [CMakeFiles/MIRCIT.dir/MIRCIT.o] Fehler 1</P>
<P>make[1]: *** [CMakeFiles/MIRCIT.dir/all] Fehler 2</P>
<P>make: *** [all] Fehler 2</P>
<P>&nbsp;</P></SPAN></SPAN></DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>How can I use my code with the following ITK VTK connection?</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>My code:</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr>&nbsp;</DIV>
<DIV dir=ltr><SPAN lang=DE-AT>
<P>typedef unsigned char PixelType;</P>
<P>const unsigned int Dimension = 3;</P>
<P>&nbsp;</P>
<P>typedef itk::OrientedImage&lt; PixelType, Dimension &gt; ImageType;</P>
<P>typedef itk::ImageSeriesReader&lt; ImageType &gt; ReaderType;</P>
<P>&nbsp;</P>
<P>ReaderType::Pointer reader = ReaderType::New();</P>
<P>&nbsp;</P>
<P>typedef itk::GDCMImageIO ImageIOType;</P>
<P>ImageIOType::Pointer dicomIO = ImageIOType::New();</P>
<P>&nbsp;</P>
<P></P>
<P>reader-&gt;SetImageIO( dicomIO );</P>
<P>typedef itk::GDCMSeriesFileNames NamesGeneratorType;</P>
<P>&nbsp;</P>
<P>NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();</P>
<P>nameGenerator-&gt;SetUseSeriesDetails( true );</P>
<P>nameGenerator-&gt;AddSeriesRestriction("0008|0021" );</P>
<P>nameGenerator-&gt;SetDirectory( selectedDirectory);</P>
<P>&nbsp;</P>
<P>typedef std::vector&lt; std::string &gt; SeriesIdContainer;</P>
<P></P>
<P>const SeriesIdContainer &amp; seriesUID = nameGenerator-&gt;GetSeriesUIDs();</P>
<P></P>
<P>SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();</P>
<P>SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();</P>
<P>while( seriesItr != seriesEnd )</P>
<P>{</P>
<P>seriesItr++;</P>
<P>}</P>
<P>std::string seriesIdentifier;</P>
<P>seriesIdentifier = seriesUID.begin()-&gt;c_str();</P>
<P>typedef std::vector&lt; std::string &gt; FileNamesContainer;</P>
<P>FileNamesContainer fileNames;</P>
<P>fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier );</P>
<P>reader-&gt;SetFileNames( fileNames );</P>
<P>reader-&gt;Update();</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>typedef float InternalPixelType;</P>
<P>typedef itk::RGBPixel&lt;unsigned char&gt; RGBPixelType;</P>
<P>typedef itk::Image&lt; RGBPixelType, Dimension &gt; RGBImageType;</P>
<P>// typedef itk::ImageFileWriter&lt; RGBImageType &gt; WriterType;</P>
<P>typedef itk::WatershedImageFilter&lt; ImageType &gt; WatershedFilterType;</P>
<P>typedef itk::Functor::ScalarToRGBPixelFunctor&lt; unsigned long&gt; ColorMapFunctorType;</P>
<P>typedef WatershedFilterType::OutputImageType LabeledImageType;</P>
<P>typedef itk::UnaryFunctorImageFilter&lt; LabeledImageType,RGBImageType,ColorMapFunctorType &gt; ColorMapFilterType;</P>
<P>typedef itk::ImageToVTKImageFilter &lt;ImageType&gt; ConnectorType;</P>
<P>typedef itk::GradientMagnitudeImageFilter&lt;ImageType, ImageType&gt; GradientMagnitudeFilterType;</P>
<P>&nbsp;</P>
<P></P>
<P>GradientMagnitudeFilterType::Pointer magnitudeFilter = GradientMagnitudeFilterType::New();</P>
<P>magnitudeFilter-&gt;SetInput(reader-&gt;GetOutput());</P>
<P>&nbsp;</P>
<P>WatershedFilterType::Pointer watershedFilter = WatershedFilterType::New();</P>
<P>watershedFilter-&gt;SetInput( magnitudeFilter-&gt;GetOutput() );</P>
<P>watershedFilter-&gt;SetThreshold(this-&gt;sliderLevelWatershed-&gt;value());</P>
<P>watershedFilter-&gt;SetLevel(this-&gt;sliderThresholdWatershed-&gt;value());</P>
<P>&nbsp;</P>
<P>ColorMapFilterType::Pointer colorMapFilter = ColorMapFilterType::New();</P>
<P>colorMapFilter-&gt;SetInput( watershedFilter-&gt;GetOutput() );</P>
<P>&nbsp;</P>
<P>ConnectorType::Pointer connector = ConnectorType::New();</P>
<P>connector-&gt;SetInput(colorMapFilter-&gt;GetOutput());</P>
<P>&nbsp;</P>
<P>vtkImageActor* actor = vtkImageActor::New();</P>
<P>actor-&gt;SetInput(connector-&gt;GetOutput());</P>
<P>&nbsp;</P>
<P>vtkInteractorStyleImage * interactorStyle = vtkInteractorStyleImage::New();</P>
<P>&nbsp;</P>
<P>vtkRenderer* renderer = vtkRenderer::New();</P>
<P>vtkRenderWindow* renWin = vtkRenderWindow::New();</P>
<P>vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::New();</P>
<P>&nbsp;</P>
<P>renWin-&gt;SetSize(500, 500);</P>
<P>renWin-&gt;AddRenderer(renderer);</P>
<P>iren-&gt;SetRenderWindow(renWin);</P>
<P>iren-&gt;SetInteractorStyle( interactorStyle );</P>
<P>renderer-&gt;AddActor(actor);</P>
<P>&nbsp;</P>
<P>renWin-&gt;Render();</P>
<P>iren-&gt;Start();</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>Thank you!</P></SPAN></DIV></DIV></div><br>


      </body></html>