]> Creatis software - clitk.git/commitdiff
Debug RTStruct offset in z direction with vtk6 (next part)
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Wed, 14 Jun 2017 14:40:03 +0000 (16:40 +0200)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Wed, 14 Jun 2017 14:40:03 +0000 (16:40 +0200)
common/clitkDicomRTStruct2ImageFilter.cxx
common/clitkDicomRT_Contour.cxx

index 96fdea75ed2415c7b2d699e6ce7dfd620f1cdd80..fcc9e2be26da9c02cfdcb1a94f10e5ff67874745 100644 (file)
@@ -221,13 +221,11 @@ void clitk::DicomRTStruct2ImageFilter::Update()
   vtkSmartPointer<vtkLinearExtrusionFilter> extrude=vtkSmartPointer<vtkLinearExtrusionFilter>::New();
 #if VTK_MAJOR_VERSION <= 5
   extrude->SetInput(mesh);
-  ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !)
-  extrude->SetVector(0, 0, -0.5*mSpacing[2]);
 #else
   extrude->SetInputData(mesh);
-  ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !)
-  extrude->SetVector(0, 0, 0.5*mSpacing[2]);
 #endif
+  ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !)
+  extrude->SetVector(0, 0, -mSpacing[2]);
 
   // Binarization
   vtkSmartPointer<vtkPolyDataToImageStencil> sts=vtkSmartPointer<vtkPolyDataToImageStencil>::New();
index ee55e44bc704986ce736c82e19fa7a9c423b145b..7fc71114bc43c987ba9dd9756a5f037a2df99618 100644 (file)
@@ -82,7 +82,11 @@ void clitk::DicomRT_Contour::UpdateDicomItem()
     double * p = mData->GetPoint(i);
     points[i*3] = p[0];
     points[i*3+1] = p[1];
-    points[i*3+2] = p[2];
+#if VTK_MAJOR_VERSION <= 5
+    points[i*3+1] = p[2];
+#else
+    points[i*3+1] = p[2]-0.5;
+#endif
   }
 
   // Get attribute
@@ -157,7 +161,11 @@ bool clitk::DicomRT_Contour::Read(gdcm::Item * item)
     double p[3];
     p[0] = points[i*3];
     p[1] = points[i*3+1];
+#if VTK_MAJOR_VERSION <= 5
     p[2] = points[i*3+2];
+#else
+    p[2] = points[i*3+2]+0.5;
+#endif
     mData->SetPoint(i, p);
     if (mZ == -1) mZ = p[2];
     if (p[2] != mZ) {
@@ -204,7 +212,11 @@ bool clitk::DicomRT_Contour::Read(gdcm::SQItem * item)
     double p[3];
     p[0] = points[i*3];
     p[1] = points[i*3+1];
+#if VTK_MAJOR_VERSION <= 5
     p[2] = points[i*3+2];
+#else
+    p[2] = points[i*3+2]+0.5;
+#endif
     mData->SetPoint(i, p);
     if (mZ == -1) mZ = p[2];
     if (p[2] != mZ) {