X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkDicomRT_ROI.cxx;h=67e534108187a743313a373db6a9ef88c99753ba;hb=c69e6ac8e16ac42d32f3a13d60396ddf65616188;hp=6bb2e25c7ff4dd51bba141ce16846764f5657dfe;hpb=24fb0576a860ea843722b1d84561186542b62fd5;p=clitk.git diff --git a/common/clitkDicomRT_ROI.cxx b/common/clitkDicomRT_ROI.cxx index 6bb2e25..67e5341 100644 --- a/common/clitkDicomRT_ROI.cxx +++ b/common/clitkDicomRT_ROI.cxx @@ -39,7 +39,6 @@ clitk::DicomRT_ROI::DicomRT_ROI() //-------------------------------------------------------------------- clitk::DicomRT_ROI::~DicomRT_ROI() { - mImage->Delete(); } //-------------------------------------------------------------------- @@ -130,6 +129,8 @@ double clitk::DicomRT_ROI::GetForegroundValueLabelImage() const //-------------------------------------------------------------------- +#if GDCM_MAJOR_VERSION == 2 +#else void clitk::DicomRT_ROI::Read(std::map & rois, gdcm::SQItem * item) { @@ -152,7 +153,7 @@ void clitk::DicomRT_ROI::Read(std::map & rois, gdcm::SQItem * bool delta_computed=false; double last_z=0; for(gdcm::SQItem* j=contours->GetFirstSQItem(); j!=0; j=contours->GetNextSQItem()) { - DicomRT_Contour * c = new DicomRT_Contour; + DicomRT_Contour::Pointer c = DicomRT_Contour::New(); bool b = c->Read(j); if (b) { mListOfContours.push_back(c); @@ -168,6 +169,7 @@ void clitk::DicomRT_ROI::Read(std::map & rois, gdcm::SQItem * } } } +#endif //-------------------------------------------------------------------- @@ -196,12 +198,14 @@ clitk::DicomRT_Contour * clitk::DicomRT_ROI::GetContour(int n) //-------------------------------------------------------------------- void clitk::DicomRT_ROI::ComputeMesh() { - vtkAppendPolyData * append = vtkAppendPolyData::New(); + vtkSmartPointer append = vtkSmartPointer::New(); for(unsigned int i=0; iAddInput(mListOfContours[i]->GetMesh()); } append->Update(); - mMesh = append->GetOutput(); + + mMesh = vtkSmartPointer::New(); + mMesh->DeepCopy(append->GetOutput()); mMeshIsUpToDate = true; } //--------------------------------------------------------------------