suyashkumar / dicom

⚡High Performance DICOM Medical Image Parser in Go.
MIT License
950 stars 138 forks source link

Return a sentinel error for unsupported BitsAllocated #210

Closed suyashkumar closed 3 years ago

suyashkumar commented 3 years ago

This ensures that we return a recognizable sentinel error when we are trying to parse a file with an unexpected BitsAllocated.

Previously, we would spin through the readNativeFrames loop without reading forward in the file, leading to an incorrect file offset when parsing the rest of the file which is not desirable.

Longer term, we should aim to possibly support non-standard bitsAllocated (not supported by binary.ByteOrder), though we need to understand what exactly that would mean