]> Creatis software - clitk.git/blobdiff - common/clitkDicomRTStruct2ImageFilter.cxx
Debug clitkImageConvert tool
[clitk.git] / common / clitkDicomRTStruct2ImageFilter.cxx
index 20a4b7009c14e8707b080b1225a615130ceec9b5..fcc9e2be26da9c02cfdcb1a94f10e5ff67874745 100644 (file)
@@ -31,7 +31,6 @@
 #include <vtkImageStencil.h>
 #include <vtkLinearExtrusionFilter.h>
 #include <vtkMetaImageWriter.h>
-#include <vtkVersion.h>
 
 
 //--------------------------------------------------------------------
@@ -203,18 +202,15 @@ void clitk::DicomRTStruct2ImageFilter::Update()
   mBinaryImage = vtkSmartPointer<vtkImageData>::New();
 #if VTK_MAJOR_VERSION <= 5
   mBinaryImage->SetScalarTypeToUnsignedChar();
+#endif
   mBinaryImage->SetOrigin(&origin[0]);
   mBinaryImage->SetSpacing(&mSpacing[0]);
   mBinaryImage->SetExtent(0, extend[0],
                           0, extend[1],
                           0, extend[2]);
+#if VTK_MAJOR_VERSION <= 5
   mBinaryImage->AllocateScalars();
 #else
-  mBinaryImage->SetOrigin(&origin[0]);
-  mBinaryImage->SetSpacing(&mSpacing[0]);
-  mBinaryImage->SetExtent(0, extend[0],
-                          0, extend[1],
-                          0, extend[2]);
   mBinaryImage->AllocateScalars(VTK_UNSIGNED_CHAR, 1);
 #endif
 
@@ -240,7 +236,7 @@ void clitk::DicomRTStruct2ImageFilter::Update()
 #if VTK_MAJOR_VERSION <= 5
   sts->SetInput(extrude->GetOutput());
 #else
-  sts->SetInputData(extrude->GetOutput());
+  sts->SetInputConnection(extrude->GetOutputPort(0));
 #endif
   //sts->SetInput(mesh);
 
@@ -248,7 +244,7 @@ void clitk::DicomRTStruct2ImageFilter::Update()
 #if VTK_MAJOR_VERSION <= 5
   stencil->SetStencil(sts->GetOutput());
 #else
-  stencil->SetStencilData(sts->GetOutput());
+  stencil->SetStencilConnection(sts->GetOutputPort(0));
 #endif
 #if VTK_MAJOR_VERSION <= 5
   stencil->SetInput(mBinaryImage);