suyashkumar / dicom

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

Return an error if Pixel Representation is signed and a signed native is pixel data value is found. #296

Open suyashkumar opened 8 months ago

suyashkumar commented 8 months ago

This is a quick fix for #294, by returning an error in the case that the dicom indicates signed pixel data and a negative pixel data value is detected.

If users are passing the SkipProcessingPixelDataValue or SkipPixelData option, this will bypass this error since this will only happen when trying to parse the raw Native PixelData.

It would be useful to add more tests for other bit widths, and some of the tests can be better structured (which can happen in follow ups), but I'd like to get this in sooner rather than later. We can follow up on getting signed integers fully supported directly.