]> Creatis software - gdcm.git/blob - src/gdcmDicomDirElement.h
Normalization
[gdcm.git] / src / gdcmDicomDirElement.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirElement.h,v $
5   Language:  C++
6   Date:      $Date: 2005/02/01 13:11:49 $
7   Version:   $Revision: 1.24 $
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 /**
31  * \brief internal structure, not end user intended
32  *        shouln't appear here
33  */  
34 GDCM_EXPORT typedef struct
35 {
36    /// DicomGroup number
37    unsigned short int Group;
38    /// DicomElement number
39    unsigned short int Elem;
40    /// value (coded as a std::string) of the Element
41    std::string Value;
42 } Element;
43
44 typedef std::list<Element> ListDicomDirElem;
45 typedef std::list<Element> ListDicomDirMetaElem;
46 typedef std::list<Element> ListDicomDirPatientElem;
47 typedef std::list<Element> ListDicomDirStudyElem;
48 typedef std::list<Element> ListDicomDirSerieElem;
49 typedef std::list<Element> ListDicomDirImageElem;
50
51 //-----------------------------------------------------------------------------
52 /**
53  * \brief   Represents elements contained in a DicomDir
54  *           class for the chained lists from the file 'Dicts/DicomDir.dic'
55  */
56 class GDCM_EXPORT DicomDirElement
57 {
58 public:
59    DicomDirElement();
60    ~DicomDirElement();
61
62   /**
63     * \brief   canonical Printer 
64     */ 
65    void Print(std::ostream &os);
66
67    /**
68     * \brief   returns a reference to the chained List 
69     *          related to the META Elements of a DICOMDIR.
70     */
71    ListDicomDirMetaElem const &GetDicomDirMetaElements() const
72       { return DicomDirMetaList; };
73
74    /**
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     * \brief   returns a reference to the chained List 
83     *          related to the STUDY Elements of a DICOMDIR.
84     */      
85    ListDicomDirStudyElem const &GetDicomDirStudyElements() const
86       { return DicomDirStudyList; };
87
88    /**
89     * \brief   returns a reference to the chained List 
90     *          related to the SERIE Elements of a DICOMDIR.
91     */
92    ListDicomDirSerieElem const &GetDicomDirSerieElements() const
93       { return DicomDirSerieList; };
94
95    /**
96     * \brief   returns a reference to the chained List 
97     *          related to the IMAGE Elements of a DICOMDIR.
98     */
99    ListDicomDirImageElem const &GetDicomDirImageElements() const
100       { return DicomDirImageList; };
101
102    // Public method to add an element
103    bool AddEntry(DicomDirType type, Element const &elem);
104
105 private:
106    /// Elements chained list, related to the MetaElements of DICOMDIR
107    ListDicomDirMetaElem    DicomDirMetaList;
108    /// Elements chained list, related to the PatientElements of DICOMDIR
109    ListDicomDirPatientElem DicomDirPatientList;
110    /// Elements chained list, related to the StudyElements of DICOMDIR
111    ListDicomDirStudyElem   DicomDirStudyList;
112    /// Elements chained list, related to the SerieElements of DICOMDIR
113    ListDicomDirSerieElem   DicomDirSerieList;
114    /// Elements chained list, related to the ImageElements of DICOMDIR
115    ListDicomDirImageElem   DicomDirImageList;
116 };
117 } // end namespace gdcm
118 //-----------------------------------------------------------------------------
119 #endif