]> Creatis software - clitk.git/blobdiff - common/clitkImage2DicomRTStructFilter.txx
Ensure compatibility with VTK6 for Image2DicomRTStruct tool
[clitk.git] / common / clitkImage2DicomRTStructFilter.txx
index 77c5e07044f1684b502021b8196c13ec15c5c975..9ebde04d0c878cd8dac885da978c7e9ea332af67 100644 (file)
@@ -52,6 +52,8 @@
 #include <itkVTKImageToImageFilter.h>
 
 // gdcm
+#include <vtkRTStructSetProperties.h>
+#include <vtkGDCMPolyDataReader.h>
 #include <vtkGDCMPolyDataWriter.h>
 
 //--------------------------------------------------------------------
@@ -178,7 +180,11 @@ void clitk::Image2DicomRTStructFilter<PixelType>::Update()
     
   // Copy previous contours
   for (unsigned int i = 0; i < numMasks-m; ++i) {
+#if VTK_MAJOR_VERSION <= 5
     writer->SetInput(i, reader->GetOutput(i));
+#else
+    writer->SetInputData(i, reader->GetOutput(i));
+#endif
     std::string theString = reader->GetRTStructSetProperties()->GetStructureSetROIName(i);
     roiNames->InsertValue(i, theString);
     theString = reader->GetRTStructSetProperties()->GetStructureSetROIGenerationAlgorithm(i);
@@ -189,7 +195,11 @@ void clitk::Image2DicomRTStructFilter<PixelType>::Update()
 
   // Add new ones
   for (unsigned int i = numMasks-m; i < numMasks; ++i) {
+#if VTK_MAJOR_VERSION <= 5
     writer->SetInput(i, meshes[i-numMasks+m]);
+#else
+    writer->SetInputData(i, meshes[i-numMasks+m]);
+#endif
     roiNames->InsertValue(i, m_ROINames[i-numMasks+m]);
     roiAlgorithms->InsertValue(i, "CLITK_CREATED");
     roiTypes->InsertValue(i, m_ROIType);