1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
3 Main authors : XX XX XX
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
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.
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
18 =========================================================================*/
20 #ifndef CLITKDICOMRT_ROI_H
21 #define CLITKDICOMRT_ROI_H
23 #include "clitkDicomRT_Contour.h"
28 //--------------------------------------------------------------------
29 class DicomRT_ROI : public itk::LightObject
33 typedef DicomRT_ROI Self;
34 typedef itk::SmartPointer<Self> Pointer;
37 void Print(std::ostream & os = std::cout) const;
38 void SetFromBinaryImage(vvImage * image, int n,
40 std::vector<double> color,
41 std::string filename);
43 int GetROINumber() const;
44 const std::string & GetName() const;
45 const std::string & GetFilename() const;
46 const std::vector<double> & GetDisplayColor() const;
47 vtkPolyData * GetMesh();
48 vvImage * GetImage() const;
50 void SetDisplayColor(double r, double v, double b);
51 std::vector<double> & GetDisplayColor() { return mColor; }
53 double GetBackgroundValueLabelImage() const;
54 void SetBackgroundValueLabelImage(double bg);
56 double GetForegroundValueLabelImage() const;
57 void SetForegroundValueLabelImage(double bg);
59 void SetImage(vvImage * im);
60 DicomRT_Contour* GetContour(int n);
62 // Compute a vtk mesh from the dicom contours
65 // Indicate if the mesh is uptodate according to the dicom
66 void SetDicomUptodateFlag(bool b) { m_DicomUptodateFlag = b; }
67 bool GetDicomUptoDateFlag() const { return m_DicomUptodateFlag; }
68 void SetName(std::string n) { mName = n; }
70 // Read from DICOM RT STRUCT
71 #if GDCM_MAJOR_VERSION == 2
72 bool Read(gdcm::Item * itemInfo, gdcm::Item * itemContour);
73 void UpdateDicomItem();
75 void Read(std::map<int, std::string> & rois, gdcm::SQItem * item);
80 std::string mFilename;
82 std::vector<double> mColor;
83 std::vector<DicomRT_Contour::Pointer> mListOfContours;
84 vtkSmartPointer<vtkPolyData> mMesh;
86 vvImage::Pointer mImage;
87 double mBackgroundValue;
88 double mForegroundValue;
89 bool m_DicomUptodateFlag;
91 #if GDCM_MAJOR_VERSION == 2
92 gdcm::Item * mItemInfo;
93 gdcm::Item * mItemContour;
100 //--------------------------------------------------------------------
102 } // end namespace clitk
103 #endif // CLITKDICOMRT_ROI_H