DIAGNijmegen / rse-panimg

Conversion of medical images to MHA and TIFF.
Apache License 2.0
13 stars 5 forks source link

Invert also WindowCenter in images with MONOCHROME1 photometric interpretation #75

Closed nlessmann closed 2 years ago

nlessmann commented 2 years ago

Small fix for a practical issue that Kicky discovered: the pixel values of images with MONOCHROME1 header are now inverted but if they also have window/level headers, the window level also needs to be inverted to match the new pixel values - otherwise it can end up far outside of the range of pixel values and the entire image is white or black in the viewer when using the automatic window/level setting.

nlessmann commented 2 years ago

I used this code to convert a few scans for Kicky and got overflow warnings, even though everything worked as expected:

image

Weirdly enough, the overflow warnings are not always there:

image

But I figured that we are expecting overflows and that they are fine, so we can better suppress these warnings.