]> Creatis software - clitk.git/blobdiff - common/clitkDicomRT_Contour.cxx
adapt power merge for osx
[clitk.git] / common / clitkDicomRT_Contour.cxx
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) {