X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDefaultDicts.cxx.in;h=78873a29c9a3324ecb802d199d2b8b69bad55578;hb=0416947420d9168401c99e7fbf0dca0a081c9175;hp=1b54f0b19b9e581554ba7be8a68a230c5c4901d7;hpb=616fe6757e5e27ce6ebb48e9e3bf3b42ab15be1c;p=gdcm.git diff --git a/src/gdcmDefaultDicts.cxx.in b/src/gdcmDefaultDicts.cxx.in index 1b54f0b1..78873a29 100644 --- a/src/gdcmDefaultDicts.cxx.in +++ b/src/gdcmDefaultDicts.cxx.in @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDefaultDicts.cxx.in,v $ Language: C++ - Date: $Date: 2004/11/03 18:08:56 $ - Version: $Revision: 1.1 $ + Date: $Date: 2005/01/24 14:14:10 $ + Version: $Revision: 1.7 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -30,11 +30,11 @@ namespace gdcm typedef struct { - uint16_t group; - uint16_t element; - char *vr; - char *fourth; - char *name; + uint16_t group; + uint16_t element; + const char *vr; + const char *vm; + const char *name; } DICT_ENTRY; static DICT_ENTRY datadir[] = { @@ -43,14 +43,14 @@ static DICT_ENTRY datadir[] = { void FillDefaultDataDict(Dict *d) { - unsigned int i = 0; - DICT_ENTRY n = datadir[i]; - while( n.name != 0 ) - { - const DictEntry e( n.group, n.element, n.vr, n.fourth, n.name); - d->AddNewEntry( e ); - n = datadir[++i]; - } + unsigned int i = 0; + DICT_ENTRY n = datadir[i]; + while( n.name != 0 ) + { + const DictEntry e( n.group, n.element, n.vr, n.vm, n.name); + d->AddEntry( e ); + n = datadir[++i]; + } } void FillDefaultTSDict(TSHT & ts) @@ -65,48 +65,44 @@ void FillDefaultVRDict(VRHT & vr) typedef struct { - char *type; - unsigned short group; - unsigned short element; - char *value; + const char *type; + unsigned short group; + unsigned short element; + const char *value; } ELEMENT; -static ELEMENT dataelement[] = { +static ELEMENT dataElement[] = { @DICOM_DIR_DICTIONARY@ }; void FillDefaultDIRDict(DicomDirElement *dde) { - unsigned int i = 0; - ELEMENT e = dataelement[i]; - Element elem; - while( e.type != 0 ) - { - elem.Group = e.group; - elem.Elem = e.element; - elem.Value = e.value; - if( strcmp(e.type, "metaElem" ) == 0 ) - { - dde->GetDicomDirMetaElements().push_back(elem); - } - else if( strcmp(e.type, "patientElem" ) == 0 ) - { - dde->GetDicomDirPatientElements().push_back(elem); - } - else if( strcmp(e.type, "studyElem" ) == 0 ) - { - dde->GetDicomDirStudyElements().push_back(elem); - } - else if( strcmp(e.type, "serieElem" ) == 0 ) - { - dde->GetDicomDirSerieElements().push_back(elem); - } - else if( strcmp(e.type, "imageElem" ) == 0 ) - { - dde->GetDicomDirImageElements().push_back(elem); - } - e = dataelement[++i]; - } + unsigned int i = 0; + ELEMENT e = dataElement[i]; + Element elem; + DicomDirType type; + + while( e.type != 0 ) + { + if( e.type == "metaElem" ) + type = DD_META; + else if( e.type == "patientElem" ) + type = DD_PATIENT; + else if( e.type == "studyElem" ) + type = DD_STUDY; + else if( e.type == "serieElem" ) + type = DD_SERIE; + else if( e.type == "imageElem" ) + type = DD_IMAGE; + else + type = DD_UNKNOWN; + + elem.Group = e.group; + elem.Elem = e.element; + elem.Value = e.value; + dde->AddEntry( type, elem); + e = dataElement[++i]; + } } } //end gdcm namespace