Problem 2101 - Skipping one pixel for implicit VR DICOM files
Summary: Skipping one pixel for implicit VR DICOM files
Status: RESOLVED FIXED
Alias: None
Product: Examples/Extended
Classification: Unclassified
Component: medical/DICOM (show other problems)
Version: 10.4
Hardware: All All
: P4 minor
Assignee: Jonathan Madsen
URL:
Depends on:
Blocks:
 
Reported: 2018-11-13 00:36 CET by Ken Sutherland
Modified: 2018-11-13 12:13 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.