]> Creatis software - clitk.git/blob - common/clitkDicomRT_ROI.h
Mathieu Malaterre :
[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 #if GDCM_MAJOR_VERSION == 2
39 #else
40   void Read(std::map<int, std::string> & rois, gdcm::SQItem * item);
41 #endif
42   void SetFromBinaryImage(vvImage * image, int n, 
43         std::string name, 
44         std::vector<double> color, 
45         std::string filename);
46
47   int GetROINumber() const;
48   const std::string & GetName() const;
49   const std::string & GetFilename() const;
50   const std::vector<double> & GetDisplayColor() const;
51   vtkPolyData * GetMesh();
52   vvImage * GetImage() const;
53
54   void SetDisplayColor(double r, double v, double b);
55   std::vector<double> & GetDisplayColor() { return mColor; }
56   
57   double GetBackgroundValueLabelImage() const;
58   void SetBackgroundValueLabelImage(double bg);
59   
60   double GetForegroundValueLabelImage() const;
61   void SetForegroundValueLabelImage(double bg);
62   
63   void SetImage(vvImage * im);
64   DicomRT_Contour* GetContour(int n);
65
66   double GetContourSpacing() const {return mZDelta;}
67   
68 protected:
69   void ComputeMesh();
70   std::string mName;
71   std::string mFilename;
72   int mNumber;
73   std::vector<double> mColor;
74   std::vector<DicomRT_Contour::Pointer> mListOfContours;
75   vtkSmartPointer<vtkPolyData> mMesh;
76   bool mMeshIsUpToDate;
77   vvImage::Pointer mImage;
78   double mBackgroundValue;
79   double mForegroundValue;
80   ///Spacing between two contours
81   double mZDelta;
82
83 private:
84   DicomRT_ROI();
85   ~DicomRT_ROI();
86 };
87 //--------------------------------------------------------------------
88
89 } // end namespace clitk
90 #endif // CLITKDICOMRT_ROI_H
91