5

I have been trying to create an image viewer for DICOM image. My program reads all the 8 bit colour and grayscale image almost correctly. But when I try to open a 16 bit image using the first 8 bits of the image, some parts are missing (pixels which uses 16 bit will be shown as dark instead of whilte). I don't really know how to use the window centre, window width, rescale slop and intercept. Please help me by giving the exact steps to convert 16 bit image to 8 bit image. Also I don't need to view the files which uses any compression technique to store the pixels. Thanks in advance.

  • Can You use the first 8 bits from the other side? It could be the endianness. – Michas Oct 25 '16 at 04:17
  • I have tried both ways. the problem i think is with the range of values it uses. The image uses only 10 bit from the 16 bit to represent the image. mhus scaling is not accurate, and the image is not the same as the one which can be seen using any DICOM viewer software. – user6848035 Oct 25 '16 at 04:37
  • Check this link for details on how to use: https://stackoverflow.com/questions/44924335/converting-12-bit-dicom-image-to-8-bit-jpeg/45277341#45277341 – Reshma Jul 24 '17 at 09:57
  • HI Let's assume we have 16 bit dicom image of winodw centre L and window width W , if we convert it to 8 bit negative image , what should be the formula to converting this? – TsunamiCoder Aug 25 '20 at 09:31

2 Answers2

3

About Rescale Slope/Intercept: It is a linear equation, so each pixel value is calculated by

<output pixel value> = <value from pixeldata attribute> * RescaleSlope + RescaleIntercept

This is the input to the windowing equation. The exact windowing equation is here.

About the inverted pixels: The attribute (0028,0103) is probably set to MONOCHROME1 which means: min=white, max=black (or "black bones" convention, i.e. the image contains the attenuation caused by the tissue between tube and detector). This is called the Polarity transformation and happens at the end of the pixel value transformation pipeline.

So your steps go:

  • apply rescale slope / intercept

  • apply windowing

  • if PixelRepresentation==MONOCHROME1 -> invert the resulting lookup table
Markus Sabin
  • 3,916
  • 14
  • 32
2

There is no a unique response.

You have to keep in mind that 16 bits images (bits stored) contains more information than images with 8 bits images. This information, in general, cannot be displayed all in the same time, you have to change the parameters used to display image.

In DICOM Images there are different DICOM tags that tells you how to interpretate data pixel. May be there are look-up table, and\or slope-intercept, and\or Window Width-Window Center tags. I think you have to take a look here

Window width and center calculation of DICOM image

Community
  • 1
  • 1
Alessandro Ciurlo
  • 102
  • 1
  • 2
  • 11
  • HI Let's assume we have 16 bit dicom image of winodw centre L and window width W , if we convert it to 8 bit negative image , what should be the formula to converting this? – TsunamiCoder Aug 25 '20 at 09:31