]> Creatis software - gdcm.git/blob - src/gdcmDicomDirElement.h
Remove useless accesses to the Dicom Dictionnary std::map
[gdcm.git] / src / gdcmDicomDirElement.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirElement.h,v $
5   Language:  C++
6   Date:      $Date: 2006/04/11 16:03:26 $
7   Version:   $Revision: 1.38 $
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 "gdcmRefCounter.h"
23 #include "gdcmVRKey.h"
24
25 #include <list>
26
27 namespace gdcm 
28 {
29
30 //-----------------------------------------------------------------------------
31
32 typedef std::list<DicomElement> ListDicomDirElem;
33 typedef std::list<DicomElement> ListDicomDirMetaElem;
34 typedef std::list<DicomElement> ListDicomDirPatientElem;
35 typedef std::list<DicomElement> ListDicomDirStudyElem;
36 typedef std::list<DicomElement> ListDicomDirVisitElem;
37 typedef std::list<DicomElement> ListDicomDirSerieElem;
38 typedef std::list<DicomElement> ListDicomDirImageElem;
39
40 // For future use (Full DICOMDIR)
41
42 /*
43 typedef std::list<DicomElement> ListDicomDirResultElem;
44 typedef std::list<DicomElement> ListDicomDirStudyComponentElem;
45
46 typedef std::list<DicomElement> ListDicomDirOverlayElem;
47 typedef std::list<DicomElement> ListDicomDirModalityLutElem;
48 typedef std::list<DicomElement> ListDicomDirModalityLutElem;
49 typedef std::list<DicomElement> ListDicomDirCurveElem;
50 typedef std::list<DicomElement> ListDicomDirStoredPrintElem;
51 typedef std::list<DicomElement> ListDicomDirRtDoseElem;
52 typedef std::list<DicomElement> ListDicomDirRtStructureSetElem;
53 typedef std::list<DicomElement> ListDicomDirRtPlanElem;
54 typedef std::list<DicomElement> ListDicomDirRtTreatRecordElem;
55 typedef std::list<DicomElement> ListDicomDirPresentationElem;
56 typedef std::list<DicomElement> ListDicomDirSrDocumentElem;
57 typedef std::list<DicomElement> ListDicomDirKeyObjectDocElem;
58 typedef std::list<DicomElement> ListDicomDirSpectroscopyElem;
59 typedef std::list<DicomElement> ListDicomDirRawDataElem;
60 typedef std::list<DicomElement> ListDicomDirRegistrationElem;
61 typedef std::list<DicomElement> ListDicomDirFiducialElem;
62 */
63
64 //-----------------------------------------------------------------------------
65 /**
66  * \brief   Represents elements contained in a DicomDir class
67  *          for the chained lists from the file 'Dicts/DicomDir.dic'
68  */
69 class GDCM_EXPORT DicomDirElement : public RefCounter
70 {
71    gdcmTypeMacro(DicomDirElement);
72
73 public:
74 /// \brief Contructs a DicomDirElement with a RefCounter
75    static DicomDirElement *New() {return new DicomDirElement();}
76
77    /**
78     * \brief   canonical Printer 
79     */ 
80    virtual void Print(std::ostream &os = std::cout, 
81                       std::string const &indent = "" );
82
83    /**
84     * \brief   returns a reference to the chained List 
85     *          related to the META Elements of a DICOMDIR.
86     */
87    ListDicomDirMetaElem const &GetDicomDirMetaElements() const
88       { return DicomDirMetaList; }
89
90    /**
91     * \brief   returns a reference to the chained List 
92     *          related to the PATIENT Elements of a DICOMDIR.
93     */      
94    ListDicomDirPatientElem const &GetDicomDirPatientElements() const
95       { return DicomDirPatientList; }
96
97    /**
98     * \brief   returns a reference to the chained List 
99     *          related to the STUDY Elements of a DICOMDIR.
100     */      
101    ListDicomDirStudyElem const &GetDicomDirStudyElements() const
102       { return DicomDirStudyList; }
103
104    /**
105     * \brief   returns a reference to the chained List 
106     *          related to the VISIT Elements of a DICOMDIR.
107     */      
108    ListDicomDirVisitElem const &GetDicomDirVisitElements() const
109       { return DicomDirVisitList; }
110    /**
111     * \brief   returns a reference to the chained List 
112     *          related to the SERIE Elements of a DICOMDIR.
113     */
114    ListDicomDirSerieElem const &GetDicomDirSerieElements() const
115       { return DicomDirSerieList; }
116
117    /**
118     * \brief   returns a reference to the chained List 
119     *          related to the IMAGE Elements of a DICOMDIR.
120     */
121    ListDicomDirImageElem const &GetDicomDirImageElements() const
122       { return DicomDirImageList; }
123
124    // Public method to add an element
125    bool AddEntry(DicomDirType type, DicomElement const &elem);
126
127    // Only one instance of ddElem 
128    void AddDicomDirElement(DicomDirType type,
129                            uint16_t group, uint16_t elem, VRKey vr);
130
131 protected:
132    DicomDirElement();
133    ~DicomDirElement();
134
135 private:
136    /// Elements chained list, related to the MetaElements of DICOMDIR
137    ListDicomDirMetaElem    DicomDirMetaList;
138    /// Elements chained list, related to the PatientElements of DICOMDIR
139    ListDicomDirPatientElem DicomDirPatientList;
140    /// Elements chained list, related to the StudyElements of DICOMDIR
141    ListDicomDirStudyElem   DicomDirStudyList;
142    /// Elements chained list, related to the VisitElements of DICOMDIR
143    ListDicomDirVisitElem   DicomDirVisitList;
144    /// Elements chained list, related to the SerieElements of DICOMDIR
145    ListDicomDirSerieElem   DicomDirSerieList;
146    /// Elements chained list, related to the ImageElements of DICOMDIR
147    ListDicomDirImageElem   DicomDirImageList;
148 };
149 } // end namespace gdcm
150 //-----------------------------------------------------------------------------
151 #endif