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>::iterator ROIIteratorType;
48 typedef std::map<int, clitk::DicomRT_ROI::Pointer>::const_iterator ROIConstIteratorType;
50 void Print(std::ostream & os = std::cout) const;
51 void Read(const std::string & filename);
52 bool IsDicomRTStruct(const std::string & filename);
53 void Write(const std::string & filename);
55 clitk::DicomRT_ROI * GetROIFromROINumber(int n);
56 std::map<int, clitk::DicomRT_ROI::Pointer> & GetROIs() { return mROIs; }
57 const std::string & GetStudyID() const;
58 const std::string & GetStudyTime() const;
59 const std::string & GetStudyDate() const;
60 const std::string & GetLabel() const;
61 const std::string & GetName() const;
62 const std::string & GetDate() const;
63 const std::string & GetTime() const;
65 int AddBinaryImageAsNewROI(vvImage * i, std::string name);
67 #if GDCM_MAJOR_VERSION == 2
69 static int ReadROINumber(const gdcm::Item & item);
74 std::string mStudyTime;
75 std::string mStudyDate;
81 std::map<int, clitk::DicomRT_ROI::Pointer> mROIs;
82 std::map<int, std::string> mMapOfROIName;
83 #if GDCM_MAJOR_VERSION == 2
84 gdcm::Reader * mReader;
85 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIInfoSequenceOfItems;
86 gdcm::SmartPointer<gdcm::SequenceOfItems> mROIContoursSequenceOfItems;
91 DicomRT_StructureSet();
92 ~DicomRT_StructureSet();
94 //--------------------------------------------------------------------
96 } // end namespace clitk
97 #endif // CLITKDICOMRT_STRUCTURESET_H