]> Creatis software - clitk.git/blobdiff - common/clitkDicomRT_StructureSet.h
dicom structure in cmd line
[clitk.git] / common / clitkDicomRT_StructureSet.h
index 77d164d29175c84089a36738a39d671489f1677c..d1cc37c2364b3451f9ad0b495b9de409a80c3425 100644 (file)
@@ -4,7 +4,7 @@
 
   Authors belongs to: 
   - University of LYON           http://www.universite-lyon.fr/
-  - Léon Bérard cancer center    http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center    http://www.centreleonberard.fr
   - CREATIS CNRS laboratory      http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
 #ifndef CLITKDICOMRT_STRUCTURESET_H
 #define CLITKDICOMRT_STRUCTURESET_H
 
+// clitk
 #include "clitkCommon.h" 
 #include "clitkDicomRT_ROI.h"
+
+// vv
 #include "vvImage.h"
 
+// gdcm
+#if GDCM_MAJOR_VERSION == 2
+#include "gdcmReader.h"
+#include "gdcmWriter.h"
+#include "gdcmAttribute.h"
+#endif
+
 namespace clitk {
 
-  //--------------------------------------------------------------------
-  class DicomRT_StructureSet {
-    
-  public:
-    DicomRT_StructureSet();
-    ~DicomRT_StructureSet();
-
-    void Print(std::ostream & os = std::cout) const;
-    void Read(const std::string & filename);
-
-    const std::vector<clitk::DicomRT_ROI*> & GetListOfROI() const;
-    clitk::DicomRT_ROI * GetROI(int n);
-    const std::string & GetStudyID() const;
-    const std::string & GetStudyTime() const;
-    const std::string & GetStudyDate() const;
-    const std::string & GetLabel() const;
-    const std::string & GetName() const;
-    const std::string & GetDate() const;
-    const std::string & GetTime() const;
-
-    int AddBinaryImageAsNewROI(vvImage::Pointer i, std::string name);
-    
-  protected:
-    std::string mStudyID;
-    std::string mStudyTime;
-    std::string mStudyDate;
-    std::string mLabel;
-    std::string mName;
-    std::string mDate;
-    std::string mTime;
-    std::map<int, std::string> mMapOfROIName;
-    std::map<int, int> mMapOfROIIndex;
-    std::vector<clitk::DicomRT_ROI*> mListOfROI;
-
-  };
-  //--------------------------------------------------------------------
+//--------------------------------------------------------------------
+class DicomRT_StructureSet : public itk::LightObject{
+  
+public:
+  typedef DicomRT_StructureSet Self;
+  typedef itk::SmartPointer<Self> Pointer;
+  itkNewMacro(Self);
+
+  typedef std::map<int, clitk::DicomRT_ROI::Pointer>::iterator ROIIteratorType;
+  typedef std::map<int, clitk::DicomRT_ROI::Pointer>::const_iterator ROIConstIteratorType;
+
+  void Print(std::ostream & os = std::cout) const;
+  void Read(const std::string & filename);
+  void Write(const std::string & filename);
+
+  clitk::DicomRT_ROI * GetROIFromROINumber(int n);
+  std::map<int, clitk::DicomRT_ROI::Pointer> & GetROIs() { return mROIs; }
+  const std::string & GetStudyID() const;
+  const std::string & GetStudyTime() const;
+  const std::string & GetStudyDate() const;
+  const std::string & GetLabel() const;
+  const std::string & GetName() const;
+  const std::string & GetDate() const;
+  const std::string & GetTime() const;
+
+  int AddBinaryImageAsNewROI(vvImage * i, std::string name);
+  
+#if GDCM_MAJOR_VERSION == 2
+  // Static
+  static int ReadROINumber(const gdcm::Item & item);
+#endif
+
+protected:
+  std::string mStudyID;
+  std::string mStudyTime;
+  std::string mStudyDate;
+  std::string mLabel;
+  std::string mName;
+  std::string mDate;
+  std::string mTime;
+
+  std::map<int, clitk::DicomRT_ROI::Pointer> mROIs;
+  std::map<int, std::string> mMapOfROIName;
+#if GDCM_MAJOR_VERSION == 2
+  gdcm::Reader * mReader;
+  gdcm::SmartPointer<gdcm::SequenceOfItems> mROIInfoSequenceOfItems;
+  gdcm::SmartPointer<gdcm::SequenceOfItems> mROIContoursSequenceOfItems;  
+#endif
+  gdcm::File * mFile;
+
+private:
+  DicomRT_StructureSet();
+  ~DicomRT_StructureSet();
+};
+//--------------------------------------------------------------------
 
 } // end namespace clitk
 #endif // CLITKDICOMRT_STRUCTURESET_H