]> Creatis software - clitk.git/commitdiff
Replace vvImage::Pointer with raw pointer for function
authordsarrut <dsarrut>
Thu, 10 Mar 2011 16:00:09 +0000 (16:00 +0000)
committerdsarrut <dsarrut>
Thu, 10 Mar 2011 16:00:09 +0000 (16:00 +0000)
common/clitkDicomRT_ROI.cxx
common/clitkDicomRT_ROI.h
common/clitkDicomRT_StructureSet.cxx
common/clitkDicomRT_StructureSet.h

index 6c9e9777bebfd372168c55d1dbee3caf8b0b21ab..6bb2e25c7ff4dd51bba141ce16846764f5657dfe 100644 (file)
@@ -39,7 +39,7 @@ clitk::DicomRT_ROI::DicomRT_ROI()
 //--------------------------------------------------------------------
 clitk::DicomRT_ROI::~DicomRT_ROI()
 {
-
+  mImage->Delete();
 }
 //--------------------------------------------------------------------
 
@@ -208,7 +208,7 @@ void clitk::DicomRT_ROI::ComputeMesh()
 
 
 //--------------------------------------------------------------------
-void clitk::DicomRT_ROI::SetFromBinaryImage(vvImage::Pointer image, int n,
+void clitk::DicomRT_ROI::SetFromBinaryImage(vvImage * image, int n,
                                            std::string name,
                                            std::vector<double> color, 
                                            std::string filename)
@@ -234,7 +234,7 @@ void clitk::DicomRT_ROI::SetFromBinaryImage(vvImage::Pointer image, int n,
 
 
 //--------------------------------------------------------------------
-const vvImage::Pointer clitk::DicomRT_ROI::GetImage() const
+vvImage * clitk::DicomRT_ROI::GetImage() const
 {
   return mImage;
 }
index c1cf9778f2ca13838137b43b4b0f441ce32e6bfe..7fde1bf23de734dc660ca254c0507d2bf0b99224 100644 (file)
@@ -34,7 +34,7 @@ namespace clitk {
 
     void Print(std::ostream & os = std::cout) const;
     void Read(std::map<int, std::string> & rois, gdcm::SQItem * item);
-    void SetFromBinaryImage(vvImage::Pointer image, int n, 
+    void SetFromBinaryImage(vvImage * image, int n, 
                            std::string name, 
                            std::vector<double> color, 
                            std::string filename);
@@ -44,7 +44,7 @@ namespace clitk {
     const std::string & GetFilename() const;
     const std::vector<double> & GetDisplayColor() const;
     vtkPolyData * GetMesh();
-    const vvImage::Pointer GetImage() const;
+    vvImage * GetImage() const;
 
     void SetDisplayColor(double r, double v, double b);
     std::vector<double> & GetDisplayColor() { return mColor; }
@@ -69,7 +69,7 @@ namespace clitk {
     std::vector<DicomRT_Contour*> mListOfContours;
     vtkPolyData * mMesh;
     bool mMeshIsUpToDate;
-    vvImage::Pointer mImage;
+    vvImage * mImage;
     double mBackgroundValue;
     double mForegroundValue;
     ///Spacing between two contours
index c3771570e9e6dfc35927994cc33394d42265c112..41cddc2178405df13dd5222af0f09b595e355ac3 100644 (file)
@@ -37,7 +37,9 @@ clitk::DicomRT_StructureSet::DicomRT_StructureSet()
 //--------------------------------------------------------------------
 clitk::DicomRT_StructureSet::~DicomRT_StructureSet()
 {
-
+  for(uint i=0; i<mListOfROI.size(); i++) {
+    delete mListOfROI[i];
+  }
 }
 //--------------------------------------------------------------------
 
@@ -211,7 +213,7 @@ void clitk::DicomRT_StructureSet::Read(const std::string & filename)
 
 
 //--------------------------------------------------------------------
-int clitk::DicomRT_StructureSet::AddBinaryImageAsNewROI(vvImage::Pointer im, std::string n)
+int clitk::DicomRT_StructureSet::AddBinaryImageAsNewROI(vvImage * im, std::string n)
 {
   //DD("AddBinaryImageAsNewROI");
   // Search max ROI number
index 77d164d29175c84089a36738a39d671489f1677c..541a91c5d0a6a362e5dcec8df9aba8fc7acb44fc 100644 (file)
@@ -46,7 +46,7 @@ namespace clitk {
     const std::string & GetDate() const;
     const std::string & GetTime() const;
 
-    int AddBinaryImageAsNewROI(vvImage::Pointer i, std::string name);
+    int AddBinaryImageAsNewROI(vvImage * i, std::string name);
     
   protected:
     std::string mStudyID;