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 #if GDCM_MAJOR_VERSION == 2
32 #include "gdcmReader.h"
33 #include "gdcmWriter.h"
34 #include "gdcmAttribute.h"
39 //--------------------------------------------------------------------
40 class DicomRT_StructureSet : public itk::LightObject{
43 typedef DicomRT_StructureSet Self;
44 typedef itk::SmartPointer<Self> Pointer;
47 typedef std::map<int, clitk::DicomRT_ROI::Pointer> ROIMapContainer;
48 typedef ROIMapContainer::iterator ROIIteratorType;
49 typedef ROIMapContainer::const_iterator ROIConstIteratorType;
51 void Print(std::ostream & os = std::cout) const;
52 void Read(const std::string & filename);
53 bool IsDicomRTStruct(const std::string & filename);
54 void Write(const std::string & filename);
56 clitk::DicomRT_ROI * GetROIFromROINumber(int n);
57 clitk::DicomRT_ROI* GetROIFromROIName(const std::string& name);
58 //clitk::DicomRT_ROI* GetROIFromROINameRegEx(const std::string& regEx);
59 clitk::DicomRT_ROI* GetROIFromROINameSubstr(const std::string& s);
60 ROIMapContainer * GetROIsFromROINameSubstr(const std::string& s);
61 ROIMapContainer & GetROIs() { return mROIs; }
62 const std::string & GetStudyID() const;
63 const std::string & GetStudyTime() const;
64 const std::string & GetStudyDate() const;
65 const std::string & GetLabel() const;
66 const std::string & GetName() const;
67 const std::string & GetDate() const;
68 const std::string & GetTime() const;
70 int AddBinaryImageAsNewROI(vvImage * i, std::string name);
72 #if GDCM_MAJOR_VERSION == 2
74 static int ReadROINumber(const gdcm::Item & item);
79 std::string mStudyTime;
80 std::string mStudyDate;
86 std::map<int, clitk::DicomRT_ROI::Pointer> mROIs;
87 std::map<int, std::string> mMapOfROIName;
88 #if GDCM_MAJOR_VERSION == 2
89 gdcm::Reader * mReader;
90 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIInfoSequenceOfItems;
91 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIContoursSequenceOfItems;
96 DicomRT_StructureSet();
97 ~DicomRT_StructureSet();
99 //--------------------------------------------------------------------
101 } // end namespace clitk
102 #endif // CLITKDICOMRT_STRUCTURESET_H