<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:"Times New Roman", serif;font-size:12pt"><DIV>Hello! <BR><BR>I wanted my watershed-segmentation result (from ITK) through vtkVolumeProMapper 3D So make a volume. I have used vtkVolumeProMapper and vtkVolume. But I always get the error "undefined reference to vtkVolumeProMapper". Where is my mistake? I would be glad if you can help. <BR><BR>Thank you! <BR><BR>My code and CMakeList:<BR><BR>void MIRCIT::imageDisplayingWatershed(){<BR><BR> this->displayImage3D->show();<BR> this->displayImage3D->redraw();<BR><BR> typedef unsigned char PixelType;<BR> const unsigned int Dimension = 3;<BR><BR> typedef itk::OrientedImage< PixelType, Dimension > ImageType;<BR> typedef itk::ImageSeriesReader< ImageType > ReaderType;<BR> ReaderType::Pointer reader = ReaderType::New();<BR><BR> typedef itk::GDCMImageIO ImageIOType;<BR>
ImageIOType::Pointer dicomIO = ImageIOType::New();<BR> <BR> reader->SetImageIO( dicomIO );<BR><BR> typedef itk::GDCMSeriesFileNames NamesGeneratorType;<BR> NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<BR><BR> nameGenerator->SetUseSeriesDetails( true );<BR> nameGenerator->AddSeriesRestriction("0008|0021" );<BR> nameGenerator->SetDirectory( selectedDirectory);<BR><BR> typedef std::vector< std::string > SeriesIdContainer;<BR> <BR> const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();<BR> SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<BR> SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<BR><BR> while( seriesItr != seriesEnd )<BR> {<BR> seriesItr++;<BR> }<BR><BR> std::string seriesIdentifier;<BR> seriesIdentifier = seriesUID.begin()->c_str();<BR><BR> typedef std::vector< std::string > FileNamesContainer;<BR>
FileNamesContainer fileNames;<BR><BR> fileNames = nameGenerator->GetFileNames( seriesIdentifier );<BR> reader->SetFileNames( fileNames );<BR> reader->Update();<BR><BR> typedef float InternalPixelType;<BR> typedef itk::RGBPixel<unsigned char> RGBPixelType;<BR> typedef itk::Image< RGBPixelType, Dimension > RGBImageType;<BR> typedef itk::ImageFileWriter< RGBImageType > WriterType;<BR> typedef itk::WatershedImageFilter< ImageType > WatershedFilterType;<BR> typedef itk::Functor::ScalarToRGBPixelFunctor< unsigned long> ColorMapFunctorType;<BR> typedef WatershedFilterType::OutputImageType LabeledImageType;<BR> typedef itk::UnaryFunctorImageFilter<LabeledImageType,RGBImageType,ColorMapFunctorType > ColorMapFilterType;<BR> typedef itk::ImageToVTKImageFilter <LabeledImageType> ConnectorType;<BR> typedef itk::GradientMagnitudeImageFilter<ImageType, ImageType>
GradientMagnitudeFilterType;<BR> <BR> GradientMagnitudeFilterType::Pointer magnitudeFilter = GradientMagnitudeFilterType::New();<BR> magnitudeFilter->SetInput(reader->GetOutput());<BR><BR> WatershedFilterType::Pointer watershedFilter = WatershedFilterType::New();<BR> watershedFilter->SetInput( magnitudeFilter->GetOutput() );<BR> watershedFilter->SetLevel(this->sliderLevelWatershed->value());<BR> watershedFilter->SetThreshold(this->sliderLevelWatershed->value());<BR><BR> ColorMapFilterType::Pointer colorMapFilter = ColorMapFilterType::New();<BR> colorMapFilter->SetInput( watershedFilter->GetOutput() );<BR><BR> ConnectorType::Pointer connector = ConnectorType::New();<BR> connector->SetInput(watershedFilter->GetOutput());<BR><BR> vtkImageShiftScale *shift = vtkImageShiftScale::New();<BR> shift->SetInput(connector->GetOutput());<BR>
shift->SetOutputScalarTypeToUnsignedChar();<BR><BR> vtkVolumeProMapper *mapperb = vtkVolumeProMapper::New();<BR> mapperb->SetInputConnection(shift->GetOutputPort());<BR><BR> vtkVolume *volumeb = vtkVolume::New();<BR> volumeb->SetMapper(mapperb);<BR><BR> camera3D = vtkCamera::New();<BR> camera3D->SetViewUp(0, 0, -1);<BR> camera3D->SetPosition(0, 1, 0);<BR> camera3D->SetFocalPoint(0, 0, 0);<BR> camera3D->ComputeViewPlaneNormal();<BR> camera3D->Azimuth(20);<BR><BR> renderer3DWaterShed = vtkRenderer::New();<BR> renderWindow3DWaterShed = vtkRenderWindow::New();<BR> renderWindow3DWaterShed->AddRenderer(renderer3DWaterShed);<BR><BR> displayImage3D->SetRenderWindow(renderWindow3DWaterShed);<BR> displayImage3D->SetInteractorStyle(mode3DWaterShed);<BR> displayImage3D->Initialize();<BR><BR> renderer3DWaterShed->AddViewProp(volumeb);<BR>
renderer3DWaterShed->SetActiveCamera(camera3D);<BR> renderer3DWaterShed->ResetCamera();<BR> camera3D->Dolly(1.3);<BR> renderer3DWaterShed->ResetCameraClippingRange();<BR> renderer3DWaterShed->Render();<BR><BR> this->displayImage3D->show();<BR> this->displayImage3D->redraw();<BR><BR> WriterType::Pointer writer = WriterType::New();<BR> writer->SetInput( colorMapFilter->GetOutput() );<BR> writer->SetFileName("fds.tiff" );<BR> writer->Update();<BR>}</DIV><DIV></DIV><DIV></DIV><DIV><BR>project (MIRCIT)<BR><BR>#<BR>#FIND ITK<BR>#<BR>FIND_PACKAGE(ITK)<BR>IF (USE_ITK_FILE)<BR> INCLUDE (${USE_ITK_FILE})<BR>ELSE (USE_ITK_FILE)<BR> MESSAGE( FATAL_ERROR "This application requires ITK. One of these components is missing. Please verify configuration")<BR>ENDIF (USE_ITK_FILE)<BR><BR><BR>#<BR>#FIND VTK<BR>#<BR>FIND_PACKAGE(VTK)<BR>IF(USE_VTK_FILE)<BR> INCLUDE(${USE_VTK_FILE})<BR>ELSE
(USE_VTK_FILE)<BR> MESSAGE( FATAL_ERROR "This app. req. VTK. One of these comp. is. missing. Please verify conf.")<BR>ENDIF (USE_VTK_FILE)<BR><BR><BR>#<BR>#FIND FLTK<BR>#<BR>FIND_PACKAGE(FLTK)<BR> IF (FLTK_FOUND)<BR> INCLUDE_DIRECTORIES (${FLTK_INCLUDE_DIR})<BR> LINK_LIBRARIES( ${FLTK_LIBRARIES} ${OPENGL_LIBRARIES} )<BR> ELSE (FLTK_FOUND)<BR> MESSAGE( FATAL_ERROR "This application requires FLTK. One of these components is missing. Please verify configuration")<BR>ENDIF (FLTK_FOUND)<BR><BR>add_executable (MIRCIT main.cpp MIRCIT.cpp MIRCIT.h MIRCITGui.cpp MIRCITGui.h info.cpp vtkFlRenderWindowInteractor.cpp)<BR><BR><BR>TARGET_LINK_LIBRARIES(MIRCIT vtkCommon vtkexpat vtkFiltering vtkfreetype vtkftgl vtkGraphics vtkHybrid vtkImaging vtkIO vtkjpeg vtkpng vtkVolumeRendering vtkRendering vtktiff vtkzlib ITKBasicFilters ITKCommon ITKIO ${ITK_LIBRARIES})<BR><BR></DIV></div><br>
</body></html>