Closed psavery closed 10 months ago
This looks like a problem with the PydicomDecoder
. The numpy array returned from the pydicom pixel handler is 1-dimensional and needs to be reshaped into the correct width and height. The reshape size is however incorrect, as the first dimension for a numpy array corresponds to height, and the second to width. Switching these and one gets the correct size in the output. This also fixes so that the image is not totally scrambled.
But additionally, this image is monochrome2 (i.e. grayscale) and the LUT needs to be applied in order to get similar results as the Slim viewer. And as you noticed earlier the LUT parser does not work for the LUT in this image.
For the following example, it looks to me that the tile width and height are reversed:
It prints out the following:
If I look into the API for
read_region
, it looks like thesize
parameter is specified via(width, height)
. However, the returned tile appears to have the width and height reversed.