- 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;
- dde->AddNewEntry( e.type, elem);
- e = dataelement[++i];
- }
+ unsigned int i = 0;
+ ELEMENT e = dataElement[i];
+ DicomElement elem;
+ DicomDirType type;
+ std::string strType;
+
+ while( e.type != 0 )
+ {
+ // Force to use the string comparison operator ==
+ strType = e.type;
+ if( strType == "metaElem" )
+ type = DD_META;
+ else if( strType == "patientElem" )
+ type = DD_PATIENT;
+ else if( strType == "studyElem" )
+ type = DD_STUDY;
+ else if( strType == "serieElem" )
+ type = DD_SERIE;
+ else if( strType == "imageElem" )
+ type = DD_IMAGE;
+ else
+ type = DD_UNKNOWN;
+
+ elem.Group = e.group;
+ elem.Elem = e.element;
+ elem.VR = e.vr;
+ elem.Value = e.value;
+ dde->AddEntry( type, elem);
+ e = dataElement[++i];
+ }