- from >> std::hex >> elem.group >> elem.elem;
-
- eatwhite(from);
- from.getline(buff, 1024, '"');
- eatwhite(from);
- from.getline(buff, 1024, '"');
- elem.value = buff;
-
- if(type=="metaElem")
- MetaList.push_back(elem);
- else if(type=="patientElem")
- PatientList.push_back(elem);
- else if(type=="studyElem")
- StudyList.push_back(elem);
- else if(type=="serieElem")
- SerieList.push_back(elem);
- else if(type=="imageElem")
- ImageList.push_back(elem);
+ from >> std::ws;
+ from.getline(buff, 1024, ' ');
+ strType = buff;
+
+ if ( strType == "imageElem" )
+ type = DD_IMAGE;
+ else if ( strType == "serieElem" )
+ type = DD_SERIE;
+ else if ( strType == "studyElem" )
+ type = DD_STUDY;
+ else if ( strType == "patientElem" )
+ type = DD_PATIENT;
+ else if ( strType == "metaElem" )
+ type = DD_META;
+ else
+ {
+ gdcmWarningMacro("Unknown type (" << strType
+ << ") found in the file : "
+ << filename.c_str());
+ type = DD_UNKNOWN;
+ }
+
+ if ( type!=DD_UNKNOWN )
+ {
+ from >> std::hex >> elem.Group >> elem.Elem;// >> elem.VR;
+
+ from.getline(buff2, 1024, '"');
+ from >> std::ws;
+ from.getline(buff2, 1024, '"');
+ elem.VR[0] = buff2[0];
+ elem.VR[1] = buff2[1];
+ // std::cout << "VR : [" << elem.VR[0] << elem.VR[1] << "]" << std::endl; // JPR
+ from >> std::ws;
+ from.getline(buff, 1024, '"');
+ from >> std::ws;
+ from.getline(buff, 1024, '"');
+ elem.Value = buff;
+
+ AddEntry(type, elem);
+ }
+ from.getline(buff, 1024, '\n');