suyashkumar / dicom

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

Check for Signed Integers in Native Pixel Data #294

Open suyashkumar opened 11 months ago

suyashkumar commented 11 months ago

The Pixel Representation Attribute can and should be inspected to determine if the pixel data values are signed integers or not. At the moment unsigned is assumed, and we should return an error if the data is signed. We should also support pulling in signed integers as well.

suyashkumar commented 11 months ago

Put up a quick draft in #296 to return an error, but need to check a couple more things. It might not be too hard to just go ahead and parse the signed and unsigned ints outright.

suyashkumar commented 4 months ago

Probably the right way to handle this is to support multiple data types for PixelData, including floats. This would also help with #291 and #161 as well if we allowed the parsed values to be differently sized ints.