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_STRUCTURESET_H
21 #define CLITKDICOMRT_STRUCTURESET_H
24 #include "clitkCommon.h"
25 #include "clitkDicomRT_ROI.h"
28 #include "vtkMatrix4x4.h"
34 #include "clitkConfiguration.h"
35 #if CLITK_USE_SYSTEM_GDCM == 1
36 #include <vtkGDCMPolyDataReader.h>
37 #include <vtkRTStructSetProperties.h>
41 #if GDCM_MAJOR_VERSION == 2
42 // This is not use if CLITK_USE_SYSTEM_GDCM==1
43 #include "gdcmReader.h"
44 #include "gdcmWriter.h"
45 #include "gdcmAttribute.h"
50 //--------------------------------------------------------------------
51 class DicomRT_StructureSet : public itk::LightObject{
54 typedef DicomRT_StructureSet Self;
55 typedef itk::SmartPointer<Self> Pointer;
58 typedef std::map<int, clitk::DicomRT_ROI::Pointer> ROIMapContainer;
59 typedef ROIMapContainer::iterator ROIIteratorType;
60 typedef ROIMapContainer::const_iterator ROIConstIteratorType;
62 void Print(std::ostream & os = std::cout) const;
63 void Read(const std::string & filename);
64 void SetTransformMatrix(vtkMatrix4x4* matrix);
65 bool IsDicomRTStruct(const std::string & filename);
66 void Write(const std::string & filename);
68 clitk::DicomRT_ROI * GetROIFromROINumber(int n);
69 clitk::DicomRT_ROI* GetROIFromROIName(const std::string& name);
70 //clitk::DicomRT_ROI* GetROIFromROINameRegEx(const std::string& regEx);
71 clitk::DicomRT_ROI* GetROIFromROINameSubstr(const std::string& s);
72 ROIMapContainer * GetROIsFromROINameSubstr(const std::string& s);
73 ROIMapContainer & GetROIs() { return mROIs; }
74 const std::string & GetStudyID() const;
75 const std::string & GetStudyTime() const;
76 const std::string & GetStudyDate() const;
77 const std::string & GetLabel() const;
78 const std::string & GetName() const;
79 const std::string & GetDate() const;
80 const std::string & GetTime() const;
82 int AddBinaryImageAsNewROI(vvImage * i, std::string name);
84 #if GDCM_MAJOR_VERSION == 2
86 static int ReadROINumber(const gdcm::Item & item);
91 std::string mStudyTime;
92 std::string mStudyDate;
97 vtkSmartPointer<vtkMatrix4x4> mTransformMatrix;
99 std::map<int, clitk::DicomRT_ROI::Pointer> mROIs;
100 std::map<int, std::string> mMapOfROIName;
101 #if GDCM_MAJOR_VERSION == 2
102 gdcm::Reader * mReader;
103 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIInfoSequenceOfItems;
104 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIContoursSequenceOfItems;
109 DicomRT_StructureSet();
110 ~DicomRT_StructureSet();
112 //--------------------------------------------------------------------
114 } // end namespace clitk
115 #endif // CLITKDICOMRT_STRUCTURESET_H