]> Creatis software - gdcm.git/blob - src/gdcmDicomDirElement.h
ENH: Still remove some sprintf and rework internals
[gdcm.git] / src / gdcmDicomDirElement.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirElement.h,v $
5   Language:  C++
6   Date:      $Date: 2004/10/09 03:21:55 $
7   Version:   $Revision: 1.11 $
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 //-----------------------------------------------------------------------------
27 typedef struct
28 {
29    /// DicomGroup number
30    unsigned short int Group;
31    /// DicomElement number
32    unsigned short int Elem;
33    /// value (coded as a std::string) of the Element
34    std::string Value;
35 } gdcmElement;
36
37 typedef std::list<gdcmElement> ListDicomDirMetaElem;
38 typedef std::list<gdcmElement> ListDicomDirPatientElem;
39 typedef std::list<gdcmElement> ListDicomDirStudyElem;
40 typedef std::list<gdcmElement> ListDicomDirSerieElem;
41 typedef std::list<gdcmElement> ListDicomDirImageElem;
42
43 //-----------------------------------------------------------------------------
44 /**
45  * \ingroup gdcmDicomDirElement
46  * \brief    gdcmDicomDirElement represents elements contained in a dicom dir
47  *           Class for the chained lists from the file 'Dicts/DicomDir.dic'
48  */
49 class GDCM_EXPORT gdcmDicomDirElement
50 {
51 public:
52    gdcmDicomDirElement();
53    ~gdcmDicomDirElement();
54
55   /**
56     * \brief   canonical Printer 
57     * \sa    SetPrintLevel
58     */ 
59    void Print(std::ostream &os);
60
61    /**
62     * \ingroup gdcmDicomDirElement
63     * \brief   returns a reference to the chained List 
64     *          related to the META Elements of a DICOMDIR.
65     */
66    ListDicomDirMetaElem    &GetDicomDirMetaElements()
67       { return DicomDirMetaList; };
68
69    /**
70     * \ingroup gdcmDicomDirElement
71     * \brief   returns a reference to the chained List 
72     *          related to the PATIENT Elements of a DICOMDIR.
73     */      
74    ListDicomDirPatientElem &GetDicomDirPatientElements()
75       { return DicomDirPatientList; };
76
77    /**
78     * \ingroup gdcmDicomDirElement
79     * \brief   returns a reference to the chained List 
80     *          related to the STUDY Elements of a DICOMDIR.
81     */      
82    ListDicomDirStudyElem   &GetDicomDirStudyElements()
83       { return DicomDirStudyList; };
84
85    /**
86     * \ingroup gdcmDicomDirElement
87     * \brief   returns a reference to the chained List 
88     *          related to the SERIE Elements of a DICOMDIR.
89     */
90    ListDicomDirSerieElem   &GetDicomDirSerieElements()
91       { return DicomDirSerieList; };
92
93    /**
94     * \ingroup gdcmDicomDirElement
95     * \brief   returns a reference to the chained List 
96     *          related to the IMAGE Elements of a DICOMDIR.
97     */
98    ListDicomDirImageElem   &GetDicomDirImageElements()
99       { return DicomDirImageList; };
100
101 private:
102    /// gdcmElements chained list, related to the MetaElements of DICOMDIR
103    ListDicomDirMetaElem    DicomDirMetaList;
104    /// gdcmElements chained list, related to the PatientElements of DICOMDIR
105    ListDicomDirPatientElem DicomDirPatientList;
106    /// gdcmElements chained list, related to the StudyElements of DICOMDIR
107    ListDicomDirStudyElem   DicomDirStudyList;
108    /// gdcmElements chained list, related to the SerieElements of DICOMDIR
109    ListDicomDirSerieElem   DicomDirSerieList;
110    /// gdcmElements chained list, related to the ImageElements of DICOMDIR
111    
112    ListDicomDirImageElem   DicomDirImageList;
113 };
114
115 //-----------------------------------------------------------------------------
116 #endif