]> Creatis software - gdcm.git/blob - src/gdcmDefaultDicts.cxx.in
Removal out of the Dicom Dictionary of non dicom 'fourth' field
[gdcm.git] / src / gdcmDefaultDicts.cxx.in
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDefaultDicts.cxx.in,v $
5   Language:  C++
6   Date:      $Date: 2005/01/07 12:29:17 $
7   Version:   $Revision: 1.5 $
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 GDCMDEFAULTDICTS_H
20 #define GDCMDEFAULTDICTS_H
21
22 #include "gdcmDict.h"
23 #include "gdcmDictEntry.h"
24 #include "gdcmTS.h"
25 #include "gdcmVR.h"
26 #include "gdcmDicomDirElement.h"
27
28 namespace gdcm
29 {
30
31 typedef struct
32 {
33   uint16_t group;
34   uint16_t element;
35   const char *vr;
36   const char *vm;
37   const char *name;
38 } DICT_ENTRY;
39
40 static DICT_ENTRY datadir[] = {
41 @DICOM_DATA_DICTIONARY@
42 };
43
44 void FillDefaultDataDict(Dict *d)
45 {
46   unsigned int i = 0;
47   DICT_ENTRY n = datadir[i];
48   while( n.name != 0 )
49     {
50     const DictEntry e( n.group, n.element, n.vr, n.vm, n.name);
51     d->AddNewEntry( e );
52     n = datadir[++i];
53     }
54 }
55
56 void FillDefaultTSDict(TSHT & ts)
57 {
58 @DICOM_TS_DICTIONARY@
59 }
60
61 void FillDefaultVRDict(VRHT & vr)
62 {
63 @DICOM_VR_DICTIONARY@
64 }
65
66 typedef struct
67 {
68   const char *type;
69   unsigned short group;
70   unsigned short element;
71   const char *value;
72 } ELEMENT;
73
74 static ELEMENT dataelement[] = {
75 @DICOM_DIR_DICTIONARY@
76 };
77
78 void FillDefaultDIRDict(DicomDirElement *dde)
79 {
80   unsigned int i = 0;
81   ELEMENT e = dataelement[i];
82   Element elem;
83   while( e.type != 0 )
84     {
85     elem.Group = e.group;
86     elem.Elem  = e.element;
87     elem.Value = e.value;
88     dde->AddNewEntry( e.type, elem);
89     e = dataelement[++i];
90     }
91 }
92
93 } //end gdcm namespace
94 #endif
95