]> Creatis software - gdcm.git/blob - src/gdcmDicomDirElement.h
ENH: Now the dictionary is compiled into gdcm lib. This is a default behavior, thus...
[gdcm.git] / src / gdcmDicomDirElement.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirElement.h,v $
5   Language:  C++
6   Date:      $Date: 2004/11/03 18:08:56 $
7   Version:   $Revision: 1.15 $
8                                                                                 
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.
12                                                                                 
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.
16                                                                                 
17 =========================================================================*/
18
19 #ifndef GDCMDICOMDIRELEMENT_H
20 #define GDCMDICOMDIRELEMENT_H
21
22 #include "gdcmCommon.h"
23
24 #include <list>
25
26 namespace gdcm 
27 {
28
29 //-----------------------------------------------------------------------------
30 typedef struct
31 {
32    /// DicomGroup number
33    unsigned short int Group;
34    /// DicomElement number
35    unsigned short int Elem;
36    /// value (coded as a std::string) of the Element
37    std::string Value;
38 } Element;
39
40 typedef std::list<Element> ListDicomDirElem;
41 typedef std::list<Element> ListDicomDirMetaElem;
42 typedef std::list<Element> ListDicomDirPatientElem;
43 typedef std::list<Element> ListDicomDirStudyElem;
44 typedef std::list<Element> ListDicomDirSerieElem;
45 typedef std::list<Element> ListDicomDirImageElem;
46
47 //-----------------------------------------------------------------------------
48 /**
49  * \ingroup DicomDirElement
50  * \brief    DicomDirElement represents elements contained in a dicom dir
51  *           Class for the chained lists from the file 'Dicts/DicomDir.dic'
52  */
53 class GDCM_EXPORT DicomDirElement
54 {
55 public:
56    DicomDirElement();
57    ~DicomDirElement();
58
59   /**
60     * \brief   canonical Printer 
61     * \sa    SetPrintLevel
62     */ 
63    void Print(std::ostream &os);
64
65    /**
66     * \ingroup DicomDirElement
67     * \brief   returns a reference to the chained List 
68     *          related to the META Elements of a DICOMDIR.
69     */
70    ListDicomDirMetaElem const & GetDicomDirMetaElements() const
71       { return DicomDirMetaList; };
72
73    /**
74     * \ingroup DicomDirElement
75     * \brief   returns a reference to the chained List 
76     *          related to the PATIENT Elements of a DICOMDIR.
77     */      
78    ListDicomDirPatientElem const & GetDicomDirPatientElements() const
79       { return DicomDirPatientList; };
80
81    /**
82     * \ingroup DicomDirElement
83     * \brief   returns a reference to the chained List 
84     *          related to the STUDY Elements of a DICOMDIR.
85     */      
86    ListDicomDirStudyElem const & GetDicomDirStudyElements() const
87       { return DicomDirStudyList; };
88
89    /**
90     * \ingroup DicomDirElement
91     * \brief   returns a reference to the chained List 
92     *          related to the SERIE Elements of a DICOMDIR.
93     */
94    ListDicomDirSerieElem const & GetDicomDirSerieElements() const
95       { return DicomDirSerieList; };
96
97    /**
98     * \ingroup DicomDirElement
99     * \brief   returns a reference to the chained List 
100     *          related to the IMAGE Elements of a DICOMDIR.
101     */
102    ListDicomDirImageElem const & GetDicomDirImageElements() const
103       { return DicomDirImageList; };
104
105    /**
106     * Public method to add an element
107     */
108    bool AddNewEntry(std::string const & type, Element const & elem);
109
110 private:
111    /// Elements chained list, related to the MetaElements of DICOMDIR
112    ListDicomDirMetaElem    DicomDirMetaList;
113    /// Elements chained list, related to the PatientElements of DICOMDIR
114    ListDicomDirPatientElem DicomDirPatientList;
115    /// Elements chained list, related to the StudyElements of DICOMDIR
116    ListDicomDirStudyElem   DicomDirStudyList;
117    /// Elements chained list, related to the SerieElements of DICOMDIR
118    ListDicomDirSerieElem   DicomDirSerieList;
119    /// Elements chained list, related to the ImageElements of DICOMDIR
120    
121    ListDicomDirImageElem   DicomDirImageList;
122 };
123 } // end namespace gdcm
124 //-----------------------------------------------------------------------------
125 #endif