getting thumbnail

Hey, I`m trying to get a thumbnail for each of my series. For that im currently asking for the middle instance by querying with limit 1 and the fitting offset.
However when requesting the rendered version as jpeg/png (with dicom-web/studies/{studyid}/series/{seriesId}/instances/{instanceUID}/rendered) the windowing on CT scans will create a black picture. I can fix this by setting the correct windowing, but for that I need to load the whole dicom file( if Im not worng). Is there an easy way to get a thumbnail/preview?
I know there is a function in the regular api with /preview which works and was wondering if there is some easy way to achieve something similar with the dicom-web api?

Ideas I had were:

  1. See if study is CT or MRI or X-Ray and have general settings for each
  2. Somehow load one dicom instance and read the VOI LUT table where the window level and center should be available as tags(if im not wrong)

Okay, what im doing now is querying the orthanc rest api with a find request for the sopinstanceUid and then getting its preview image. The api documentation is saying that the preview is the whole image narrowed into 256 color values. Can someone give me a resource to tell me more about how that is done, especially for different modalitys. Like for a ct, is it like using a window of 0,1000,linear? If yes, what would be used for an mri for example?

Hi Niclas,

The /preview route is actually translating all values between the image min and max values to 0->256. (https://hg.orthanc-server.com/orthanc/file/6a23cd1fc66b/OrthancFramework/Sources/DicomParsing/Internals/DicomImageDecoder.cpp#l946)

Note that you could also use the /rendered route which provides windowCenter/windowWidth arguments: https://api.orthanc-server.com/#tag/Instances/paths/~1instances~1{id}~1rendered/get

HTH,

Alain