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