X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_Contour.cxx;h=9a98045faf174182f8cd7cc0f23b1c45c4356988;hb=58f3178d52d0c1762a566b375354816e0cc4bb26;hp=7df4cfe3f33e8a9c64b966c6476a4addba17b001;hpb=303324c27d660280e3ed0a3f40b10bb1bbd5d0c8;p=clitk.git diff --git a/common/clitkDicomRT_Contour.cxx b/common/clitkDicomRT_Contour.cxx index 7df4cfe..9a98045 100644 --- a/common/clitkDicomRT_Contour.cxx +++ b/common/clitkDicomRT_Contour.cxx @@ -25,6 +25,7 @@ clitk::DicomRT_Contour::DicomRT_Contour() { mMeshIsUpToDate = false; mNbOfPoints = 0; + mZ = -1; } //-------------------------------------------------------------------- @@ -58,7 +59,7 @@ bool clitk::DicomRT_Contour::Read(gdcm::SQItem * item) return false; } if (mType == "POINT ") { - std::cout << "Warning: POINT type not fully supported. (don't use GetMesh() with this!)" + std::cerr << "Warning: POINT type not fully supported. (don't use GetMesh() with this!)" << std::endl; } @@ -71,23 +72,22 @@ bool clitk::DicomRT_Contour::Read(gdcm::SQItem * item) assert(points.size() == static_cast(mNbOfPoints)*3); // Organize values - mData = vtkPoints::New(); + mData = vtkSmartPointer::New(); mData->SetDataTypeToDouble(); mData->SetNumberOfPoints(mNbOfPoints); - double z = -1; for(unsigned int i=0; iSetPoint(i, p); - if (z == -1) z = p[2]; - if (p[2] != z) { + if (mZ == -1) mZ = p[2]; + if (p[2] != mZ) { DD(i); DD(p[2]); - DD(z); + DD(mZ); std::cout << "ERROR ! contour not in the same slice" << std::endl; - assert(p[2] == z); + assert(p[2] == mZ); } } @@ -111,9 +111,10 @@ vtkPolyData * clitk::DicomRT_Contour::GetMesh() void clitk::DicomRT_Contour::ComputeMesh() { // DD("ComputeMesh Contour"); - mMesh = vtkPolyData::New(); + mMesh = vtkSmartPointer::New(); mMesh->Allocate(); //for cell structures - mMesh->SetPoints(vtkPoints::New()); + mPoints = vtkSmartPointer::New(); + mMesh->SetPoints(mPoints); vtkIdType ids[2]; for (unsigned int idx=0 ; idxGetPoints()->InsertNextPoint(mData->GetPoint(idx)[0],