X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_Contour.cxx;h=7fc71114bc43c987ba9dd9756a5f037a2df99618;hb=d14e4a0c980c241ba87ba8bce7602028be5d0862;hp=861717002ea65fa76b0a19ae12d62d19ea42500e;hpb=8f785a7646e65eb73b28e274871b2aafcb34d85c;p=clitk.git diff --git a/common/clitkDicomRT_Contour.cxx b/common/clitkDicomRT_Contour.cxx index 8617170..7fc7111 100644 --- a/common/clitkDicomRT_Contour.cxx +++ b/common/clitkDicomRT_Contour.cxx @@ -53,6 +53,7 @@ void clitk::DicomRT_Contour::Print(std::ostream & os) const //-------------------------------------------------------------------- +#if GDCM_MAJOR_VERSION == 2 void clitk::DicomRT_Contour::UpdateDicomItem() { DD("DicomRT_Contour::UpdateDicomItem"); @@ -81,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 @@ -109,6 +114,7 @@ void clitk::DicomRT_Contour::UpdateDicomItem() DD(bb[0]); } +#endif //-------------------------------------------------------------------- @@ -144,15 +150,7 @@ bool clitk::DicomRT_Contour::Read(gdcm::Item * item) const gdcm::DataElement & contourdata = nestedds2.GetDataElement( tcontourdata ); at.SetFromDataElement( contourdata ); const double* points = at.GetValues(); -<<<<<<< Updated upstream -<<<<<<< variant A ->>>>>>> variant B - // unsigned int npts = at.GetNumberOfValues() / 3; -======= end -======= // unsigned int npts = at.GetNumberOfValues() / 3; ->>>>>>> Stashed changes - assert(at.GetNumberOfValues() == static_cast(mNbOfPoints)*3); // Organize values @@ -163,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) { @@ -210,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) {