1 /*=========================================================================
4 Module: $RCSfile: gdcmDicomDir.h,v $
6 Date: $Date: 2004/10/25 04:47:43 $
7 Version: $Revision: 1.35 $
9 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10 l'Image). All rights reserved. See Doc/License.txt or
11 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notices for more information.
17 =========================================================================*/
19 #ifndef GDCMDICOMDIR_H
20 #define GDCMDICOMDIR_H
22 #include "gdcmCommon.h"
23 #include "gdcmDocument.h"
24 #include "gdcmDicomDirPatient.h"
25 #include "gdcmDicomDirMeta.h"
26 #include "gdcmDicomDirElement.h"
33 //-----------------------------------------------------------------------------
34 typedef std::list<DicomDirPatient*> ListDicomDirPatient;
35 typedef std::vector<Document*> VectDocument;
37 typedef GDCM_EXPORT void(Method)(void* = NULL);
38 //-----------------------------------------------------------------------------
42 * \brief DicomDir defines an object representing a DICOMDIR in memory.
45 class GDCM_EXPORT DicomDir: public Document
48 DicomDir( std::string const & filename, bool parseDir = false );
53 /// \brief canonical Printer
55 void Print(std::ostream &os = std::cout);
57 /// Informations contained in the parser
58 virtual bool IsReadable();
60 /// Returns a pointer to the DicomDirMeta for this DICOMDIR.
61 DicomDirMeta* GetDicomDirMeta() { return MetaElems; };
63 /// Returns the PATIENT chained List for this DICOMDIR.
64 ListDicomDirPatient const & GetDicomDirPatients() const { return Patients; };
67 void ParseDirectory();
69 void SetStartMethod(Method*, void* = NULL, Method* = NULL);
70 void SetStartMethodArgDelete(Method*);
71 void SetProgressMethod(Method* ,void* = NULL, Method* = NULL);
72 void SetProgressMethodArgDelete(Method*);
73 void SetEndMethod(Method*, void* = NULL,Method* = NULL);
74 void SetEndMethodArgDelete(Method*);
76 /// GetProgress GetProgress
77 float GetProgress() { return Progress; };
79 /// AbortProgress AbortProgress
80 void AbortProgress() { Abort = true; };
82 /// IsAborted IsAborted
83 bool IsAborted() { return Abort; };
86 DicomDirMeta* NewMeta();
87 DicomDirPatient* NewPatient();
90 bool WriteDicomDir(std::string const & fileName);
92 /// Types of the DicomDirObject within the DicomDir
97 GDCM_DICOMDIR_PATIENT,
104 void CreateDicomDirChainedList(std::string const & path);
105 void CallStartMethod();
106 void CallProgressMethod();
107 void CallEndMethod();
111 void CreateDicomDir();
112 void AddDicomDirMeta();
113 void AddDicomDirPatientToEnd(SQItem* s);
114 void AddDicomDirStudyToEnd (SQItem* s);
115 void AddDicomDirSerieToEnd (SQItem* s);
116 void AddDicomDirImageToEnd (SQItem* s);
118 void SetElements(std::string const & path, VectDocument const &list);
119 void SetElement (std::string const & path, DicomDirType type,
122 static bool HeaderLessThan(Document* header1, Document* header2);
126 /// Pointer on *the* DicomDirObject 'DicomDirMeta Elements'
127 DicomDirMeta* MetaElems;
129 /// Chained list of DicomDirPatient (to be exploited recursively)
130 ListDicomDirPatient Patients;
132 /// pointer to the initialisation method for any progress bar
134 /// pointer to the incrementation method for any progress bar
135 Method* ProgressMethod;
136 /// pointer to the termination method for any progress bar
138 /// pointer to the ??? method for any progress bar
139 Method* StartMethodArgDelete;
140 /// pointer to the ??? method for any progress bar
141 Method* ProgressMethodArgDelete;
142 /// pointer to the ??? method for any progress bar
143 Method* EndMethodArgDelete;
144 /// pointer to the ??? for any progress bar
146 /// pointer to the ??? for any progress bar
148 /// pointer to the ??? for any progress bar
150 /// value of the ??? for any progress bar
152 /// value of the ??? for any progress bar
155 } // end namespace gdcm
156 //-----------------------------------------------------------------------------