Dicom Preview's image uses which setup for Window Width and Window Center?

Hi, I’ve recently found that by using the /preview command of the DICOM RestAPI, the returning image wasn’t properly set to the window width/center values stored in the original DICOM file.
Have any of you faced this problem already? I want to properly show or convert the preview image to the correct image using the right values for width/center, but i can’t figure out how to do it.
I was thinking on changing my application to read the /raw data instead of the preview, but it is roughly 10x larger than the preview.

Thank you.

Hello,

As its name implies, the “/instances/{…}/preview” URI is used for an easy preview in Web browsers, not for an accurate display.

This URI will compress the dynamics of the graylevel values to the [0,255] range, then encode it as a standard PNG 8bpp file. If the HTTP header “Accept” is set to “image/jpeg”, the image will be compressed to lossy JPEG instead of PNG.

As you noticed, the “/instances/{…}/frames/{…}/raw” URI will retrieve the raw, uncompressed content of the PixelData.

If you want full precision (as is “/raw”) while taking advantage of lossless compression (as in “/preview”), simply use the “/instances/{…}/image-uint16” URI, which will return a PNG 16bpp image.

HTH,
Sébastien-