When reading pixel data from a DICOM file, two bytes are skipped after the tag, but only for *explicit* VR transfer syntax files. I think the code should be like this: // beginning of the pixels if(tagDictionary == 0x7FE00010) { // Folling 2 fread's are modifications to original DICOM example //(Jonathan Madsen) if (fImplicitEndian == false) // NOTE: Only for explicit VR! rflag = std::fread(buffer,2,1,dicom); // Reserved 2 bytes // (not used for pixels) rflag = std::fread(buffer,4,1,dicom); // Element Length // (not used for pixels) break; // Exit to ReadImageData() }
Thanks, I submitted the fix.