I’m a developer on a software package that has started using SimpleITK to read in various image types. We have an explicit list of pixel types that we support, and if, after reading an image using SimpleITK, we find that the image is of a pixel type that we do not support, we throw an error.
A user is attempting to read a DICOM image set with 16-bit unsigned integer pixels, but our software is throwing an error, telling them that we don’t support 32-bit signed integer images.
I stripped the problem down to a very small bit of code found here in this GitHub gist:
When this program is given the directory containing DICOM images, it simply prints out the pixel type. This behaves as expected for all of the DICOM image sets that I have, except for the image set provided for me by this user. For that set, it says that the image’s pixel type is 32-bit signed integer, when in reality it’s 16-bit unsigned integer.
I have verified that the image data the user provided is in fact 16-bit. ImageJ identifies it as 16-bit. The DICOM headers contain the following:
0028,0100 Bits Allocated: 16
0028,0101 Bits Stored: 16
0028,0102 High Bit: 15
And the files could not possibly hold 32-bit data due to the number of pixels, and the files’ size.
With the user’s permission, I’ve anonymized the data and included a few of the slices here.
DICOM16bit.zip (1.2 MB)
I’ve confirmed that this issue occurs with the entire DICOM set, with these few slices that I’ve included, and with a single slice.
I’m using SimpleITK 2.2, and I’m compiling on Ubuntu 22.04 with g++ 11.4.0.
Thank you for any help you can provide!
Michael Herron