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


      </body></html>