]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDir.h
* FIX : Set the elements to create the DicomDir in a dictionary file
[gdcm.git] / src / gdcmDicomDir.h
index ed91ea9658282cab962a1eb682c6784b635a797e..3eb1b625fa05a962bb7a3983e593141eafb410dd 100644 (file)
@@ -1,4 +1,4 @@
-// gdcmDICOMDIR.h
+// gdcmDicomDir.h
 //-----------------------------------------------------------------------------
 #ifndef GDCMDICOMDIR_H
 #define GDCMDICOMDIR_H
@@ -6,9 +6,11 @@
 #include "gdcmHeader.h"
 #include "gdcmCommon.h"
 #include "gdcmPatient.h"
+#include "gdcmDicomDirElement.h"
 
 //-----------------------------------------------------------------------------
 typedef std::list<gdcmPatient *> ListPatient;
+typedef std::list<gdcmHeader *>  ListHeader;
 
 //-----------------------------------------------------------------------------
 /*
@@ -16,11 +18,11 @@ typedef std::list<gdcmPatient *> ListPatient;
  * \brief    gdcmDicomDir defines an object representing a DICOMDIR in memory.
  *
  */
-class GDCM_EXPORT gdcmDicomDir: public gdcmParser 
+class GDCM_EXPORT gdcmDicomDir: public gdcmParser
 {
 public:
-   gdcmDicomDir(bool exception_on_error = false);
-   gdcmDicomDir(std::string &FileName,bool exception_on_error = false );
+   gdcmDicomDir(ListTag *l,           bool exception_on_error = false);
+   gdcmDicomDir(const char *FileName,bool exception_on_error = false);
    
    ~gdcmDicomDir(void);
 
@@ -28,6 +30,7 @@ public:
    virtual void Print(std::ostream &os = std::cout);
 
    inline ListPatient &GetPatients() {return patients;};
+   bool   Write(std::string fileName);
 
    typedef enum
    {
@@ -38,6 +41,9 @@ public:
       GDCM_IMAGE,
    } gdcmDicomDirType;
    
+protected:
+   void NewDicomDir(std::string path);
+
 private:
    void CreateDicomDir(void);
    void AddObjectToEnd(gdcmDicomDirType type,ListTag::iterator begin,ListTag::iterator end);
@@ -46,6 +52,9 @@ private:
    void AddSerieToEnd(ListTag::iterator begin,ListTag::iterator end);
    void AddImageToEnd(ListTag::iterator begin,ListTag::iterator end);
 
+   void SetElements(std::string &path,ListHeader &list);
+   void SetElement(std::string &path,gdcmDicomDirType type,gdcmHeader *header);
+
    ListPatient patients;
 };