]> Creatis software - gdcm.git/blob - src/gdcmDicomDirElement.h
Typo
[gdcm.git] / src / gdcmDicomDirElement.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirElement.h,v $
5   Language:  C++
6   Date:      $Date: 2005/01/26 09:49:53 $
7   Version:   $Revision: 1.23 $
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     * \ingroup DicomDirElement
69     * \brief   returns a reference to the chained List 
70     *          related to the META Elements of a DICOMDIR.
71     */
72    ListDicomDirMetaElem const &GetDicomDirMetaElements() const
73       { return DicomDirMetaList; };
74
75    /**
76     * \brief   returns a reference to the chained List 
77     *          related to the PATIENT Elements of a DICOMDIR.
78     */      
79    ListDicomDirPatientElem const &GetDicomDirPatientElements() const
80       { return DicomDirPatientList; };
81
82    /**
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     * \brief   returns a reference to the chained List 
91     *          related to the SERIE Elements of a DICOMDIR.
92     */
93    ListDicomDirSerieElem const &GetDicomDirSerieElements() const
94       { return DicomDirSerieList; };
95
96    /**
97     * \brief   returns a reference to the chained List 
98     *          related to the IMAGE Elements of a DICOMDIR.
99     */
100    ListDicomDirImageElem const &GetDicomDirImageElements() const
101       { return DicomDirImageList; };
102
103    // Public method to add an element
104    bool AddEntry(DicomDirType type, Element const &elem);
105
106 private:
107    /// Elements chained list, related to the MetaElements of DICOMDIR
108    ListDicomDirMetaElem    DicomDirMetaList;
109    /// Elements chained list, related to the PatientElements of DICOMDIR
110    ListDicomDirPatientElem DicomDirPatientList;
111    /// Elements chained list, related to the StudyElements of DICOMDIR
112    ListDicomDirStudyElem   DicomDirStudyList;
113    /// Elements chained list, related to the SerieElements of DICOMDIR
114    ListDicomDirSerieElem   DicomDirSerieList;
115    /// Elements chained list, related to the ImageElements of DICOMDIR
116    ListDicomDirImageElem   DicomDirImageList;
117 };
118 } // end namespace gdcm
119 //-----------------------------------------------------------------------------
120 #endif