Problem 2101

Summary: Skipping one pixel for implicit VR DICOM files
Product: Examples/Extended Reporter: Ken Sutherland <kensuth>
Component: medical/DICOMAssignee: Jonathan Madsen <jonathan.madsen>
Status: RESOLVED FIXED    
Severity: minor    
Priority: P4    
Version: 10.4   
Hardware: All   
OS: All   

Description Ken Sutherland 2018-11-13 00:36:13 CET
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()
      }
Comment 1 Jonathan Madsen 2018-11-13 12:13:24 CET
Thanks, I submitted the fix.