]> Creatis software - clitk.git/blob - common/clitkDicomRT_Contour.h
Merge branch 'master' into extentSimon
[clitk.git] / common / clitkDicomRT_Contour.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_CONTOUR_H
21 #define CLITKDICOMRT_CONTOUR_H
22
23 #include "clitkCommon.h" 
24 #include <gdcmFile.h>
25 #if GDCM_MAJOR_VERSION == 2
26 #else
27 #include <gdcm.h>
28 #include <gdcmSQItem.h>
29 #endif
30 #include <vtkPoints.h>
31 #include <vtkPolyData.h>
32 #include <vtkSmartPointer.h>
33
34 namespace clitk {
35
36 //--------------------------------------------------------------------
37 class DicomRT_Contour : public itk::LightObject{
38   
39 public:
40   typedef DicomRT_Contour Self;
41   typedef itk::SmartPointer<Self> Pointer;
42   itkNewMacro(Self);
43
44   void Print(std::ostream & os = std::cout) const;
45
46 #if GDCM_MAJOR_VERSION == 2
47   bool Read(gdcm::Item * item);
48   void UpdateDicomItem();
49 #else
50   bool Read(gdcm::SQItem * item);
51 #endif
52
53   vtkPolyData * GetMesh();
54   void SetMesh(vtkPolyData * mesh);
55   vtkPoints * GetPoints() {return mData;}
56   double GetZ() const {return mZ;}
57   
58   
59 protected:
60   void ComputeMeshFromDataPoints();
61   void ComputeDataPointsFromMesh();
62   unsigned int mNbOfPoints;
63   std::string mType;
64   vtkSmartPointer<vtkPoints> mData;
65   vtkSmartPointer<vtkPolyData> mMesh;
66   vtkSmartPointer<vtkPoints> mPoints;
67   bool mMeshIsUpToDate;
68   ///Z location of the contour
69   double mZ;
70   
71 #if GDCM_MAJOR_VERSION == 2
72   gdcm::Item * mItem;
73 #else
74   gdcm::SQItem * mItem;
75 #endif
76
77 private:
78   DicomRT_Contour();
79   ~DicomRT_Contour();
80 };
81 //--------------------------------------------------------------------
82
83
84
85 } // end namespace clitk
86 #endif // CLITKDICOMRT_CONTOUR_H
87