From fa3343f1df86c87e892cafbdda1f6b0b0b1874b0 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Wed, 14 Jun 2017 16:40:03 +0200 Subject: [PATCH] Debug RTStruct offset in z direction with vtk6 (next part) --- common/clitkDicomRTStruct2ImageFilter.cxx | 6 ++---- common/clitkDicomRT_Contour.cxx | 14 +++++++++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/common/clitkDicomRTStruct2ImageFilter.cxx b/common/clitkDicomRTStruct2ImageFilter.cxx index 96fdea7..fcc9e2b 100644 --- a/common/clitkDicomRTStruct2ImageFilter.cxx +++ b/common/clitkDicomRTStruct2ImageFilter.cxx @@ -221,13 +221,11 @@ void clitk::DicomRTStruct2ImageFilter::Update() vtkSmartPointer extrude=vtkSmartPointer::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 sts=vtkSmartPointer::New(); diff --git a/common/clitkDicomRT_Contour.cxx b/common/clitkDicomRT_Contour.cxx index ee55e44..7fc7111 100644 --- a/common/clitkDicomRT_Contour.cxx +++ b/common/clitkDicomRT_Contour.cxx @@ -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) { -- 2.47.1