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"
31 #include "clitkConfiguration.h"
32 #if CLITK_USE_SYSTEM_GDCM == 1
33 #include <vtkGDCMPolyDataReader.h>
34 #include <vtkRTStructSetProperties.h>
38 #if GDCM_MAJOR_VERSION == 2
39 // This is not use if CLITK_USE_SYSTEM_GDCM==1
40 #include "gdcmReader.h"
41 #include "gdcmWriter.h"
42 #include "gdcmAttribute.h"
47 //--------------------------------------------------------------------
48 class DicomRT_StructureSet : public itk::LightObject{
51 typedef DicomRT_StructureSet Self;
52 typedef itk::SmartPointer<Self> Pointer;
55 typedef std::map<int, clitk::DicomRT_ROI::Pointer> ROIMapContainer;
56 typedef ROIMapContainer::iterator ROIIteratorType;
57 typedef ROIMapContainer::const_iterator ROIConstIteratorType;
59 void Print(std::ostream & os = std::cout) const;
60 void Read(const std::string & filename);
61 bool IsDicomRTStruct(const std::string & filename);
62 void Write(const std::string & filename);
64 clitk::DicomRT_ROI * GetROIFromROINumber(int n);
65 clitk::DicomRT_ROI* GetROIFromROIName(const std::string& name);
66 //clitk::DicomRT_ROI* GetROIFromROINameRegEx(const std::string& regEx);
67 clitk::DicomRT_ROI* GetROIFromROINameSubstr(const std::string& s);
68 ROIMapContainer * GetROIsFromROINameSubstr(const std::string& s);
69 ROIMapContainer & GetROIs() { return mROIs; }
70 const std::string & GetStudyID() const;
71 const std::string & GetStudyTime() const;
72 const std::string & GetStudyDate() const;
73 const std::string & GetLabel() const;
74 const std::string & GetName() const;
75 const std::string & GetDate() const;
76 const std::string & GetTime() const;
78 int AddBinaryImageAsNewROI(vvImage * i, std::string name);
80 #if GDCM_MAJOR_VERSION == 2
82 static int ReadROINumber(const gdcm::Item & item);
87 std::string mStudyTime;
88 std::string mStudyDate;
94 std::map<int, clitk::DicomRT_ROI::Pointer> mROIs;
95 std::map<int, std::string> mMapOfROIName;
96 #if GDCM_MAJOR_VERSION == 2
97 gdcm::Reader * mReader;
98 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIInfoSequenceOfItems;
99 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIContoursSequenceOfItems;
104 DicomRT_StructureSet();
105 ~DicomRT_StructureSet();
107 //--------------------------------------------------------------------
109 } // end namespace clitk
110 #endif // CLITKDICOMRT_STRUCTURESET_H