]> Creatis software - clitk.git/blob - common/clitkDicomRT_ROI.h
Attempt to remove some leaks. DicomRT_Contour, DicomRT_ROI and DicomRT_StructureSet...
[clitk.git] / common / clitkDicomRT_ROI.h
1 /*=========================================================================
2   Program:         vv http://www.creatis.insa-lyon.fr/rio/vv
3   Main authors :   XX XX XX
4
5   Authors belongs to: 
6   - University of LYON           http://www.universite-lyon.fr/
7   - Léon Bérard cancer center    http://oncora1.lyon.fnclcc.fr
8   - CREATIS CNRS laboratory      http://www.creatis.insa-lyon.fr
9
10   This software is distributed WITHOUT ANY WARRANTY; without even
11   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12   PURPOSE.  See the copyright notices for more information.
13
14   It is distributed under dual licence
15   - BSD       http://www.opensource.org/licenses/bsd-license.php
16   - CeCILL-B  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17
18   =========================================================================*/
19
20 #ifndef CLITKDICOMRT_ROI_H
21 #define CLITKDICOMRT_ROI_H
22
23 #include "clitkDicomRT_Contour.h"
24 #include "vvImage.h"
25
26 namespace clitk {
27
28 //--------------------------------------------------------------------
29 class DicomRT_ROI : public itk::LightObject
30 {
31   
32 public:
33   typedef DicomRT_ROI Self;
34   typedef itk::SmartPointer<Self> Pointer;
35   itkNewMacro(Self);
36
37   void Print(std::ostream & os = std::cout) const;
38   void Read(std::map<int, std::string> & rois, gdcm::SQItem * item);
39   void SetFromBinaryImage(vvImage * image, int n, 
40         std::string name, 
41         std::vector<double> color, 
42         std::string filename);
43
44   int GetROINumber() const;
45   const std::string & GetName() const;
46   const std::string & GetFilename() const;
47   const std::vector<double> & GetDisplayColor() const;
48   vtkPolyData * GetMesh();
49   vvImage * GetImage() const;
50
51   void SetDisplayColor(double r, double v, double b);
52   std::vector<double> & GetDisplayColor() { return mColor; }
53   
54   double GetBackgroundValueLabelImage() const;
55   void SetBackgroundValueLabelImage(double bg);
56   
57   double GetForegroundValueLabelImage() const;
58   void SetForegroundValueLabelImage(double bg);
59   
60   void SetImage(vvImage * im);
61   DicomRT_Contour* GetContour(int n);
62
63   double GetContourSpacing() const {return mZDelta;}
64   
65 protected:
66   void ComputeMesh();
67   std::string mName;
68   std::string mFilename;
69   int mNumber;
70   std::vector<double> mColor;
71   std::vector<DicomRT_Contour::Pointer> mListOfContours;
72   vtkPolyData * mMesh;
73   bool mMeshIsUpToDate;
74   vvImage::Pointer mImage;
75   double mBackgroundValue;
76   double mForegroundValue;
77   ///Spacing between two contours
78   double mZDelta;
79
80 private:
81   DicomRT_ROI();
82   ~DicomRT_ROI();
83 };
84 //--------------------------------------------------------------------
85
86 } // end namespace clitk
87 #endif // CLITKDICOMRT_ROI_H
88