Orthanc WSI image quality issue

Dear Sir,

We try to compare Orthanc WSI viewer and 3DHISTECH SlideViewer that support WSI DICOM.

  1. The Orthanc version is docker jodogne/orthanc-plugins:latest
  2. We download WSI DICOM from Orthanc and upload to the SlideViewer.
  3. Use the /wsi/tiles/{id}/{z}/{x}/{y} URI to retrieve the individual tiles images.
  4. (0002,0010)TransferSyntaxUID is 1.2.840.10008.1.2.4.50
    messageImage_1679644613438.jpg

Enclosed you could find the zip file for the test result.
The SlideViewer showed the contour was more clearly then retrieving the titles from the Orthanc via URI.
wsi_image.jpg

  1. The retrieved tiled from /wsi/tiles/{id}/{z}/{x}/{y} URI is compressed or not?
  2. How to make retrieved tiled quality better?
  3. How to get the uncompressed or JPEG2k lossless via URI?
  4. We are not sure the course of quality issue, any suggestion?

You will find the file: blob_https… to the browser and show the image.
Any advice will be sincerely appreciated.
Thank you.

Test Orthanc WSI.zip (1.68 MB)

Dear Sir,

According to Orthanc Book(Whole-slide microscopic imaging) as following link,
https://book.orthanc-server.com/plugins/wsi.html#decoding-the-individual-tiles
Decoding the individual tiles.png

How to set up configuration file that Orthanc WSI plugin will re-encode the tile to PNG or JPEG2k?
If we modify DICOM tag (0002,0010)TransferSyntaxUID to 1.2.840.10008.1.2 or 1.2.840.10008.1.2.4.90 is correct solution?

I’d appreciate some help.

Best regards.
Drexler Chao

Drexler Chao 在 2023年3月24日 星期五晚上11:00:00 [UTC+8] 的信中寫道:

1.2.840.10008.1.2.4.50

JPEG Baseline (Process 1):

Default Transfer Syntax for Lossy JPEG 8-bit Image Compression

I suspect that what you retrieved from Orthanc was compressed, although I don’t know how it was stored originally in the first place on Orthanc.

The Orthanc config has numerous options for controlling comperssion encoding, etc.

https://hg.orthanc-server.com/orthanc/file/Orthanc-1.11.3/OrthancServer/Resources/Configuration.json

e.g.

// Whether Orthanc transcodes DICOM files to an uncompressed
// transfer syntax over the DICOM protocol, if the remote modality
// does not support compressed transfer syntaxes (new in Orthanc 1.7.0).

“TranscodeDicomProtocol” : true,
“IngestTranscoding” : “1.2.840.10008.1.2”,

If you decode the BLOB header (online) it shows:

bits_per_sample
8

category
image

color_components
3

encoding_process
Baseline DCT, Huffman coding

file_name
wsi_image.jpg

file_size
1445 kB

file_type
JPEG

file_type_extension
jpg

image_height
2353

image_size
2561x2353

image_width
2561

jfif_version
1.01

megapixels
6

mime_type
image/jpeg

resolution_unit
inches

x_resolution
96

y_cb_cr_sub_sampling
YCbCr4:2:0 (2 2)

y_resolution
96

Stephen D. Scotti, M.D.

Dear Sir,

We retrieved tiled from /wsi/tiles/{id}/{z}/{x}/{y} URI is JPEG image that might affect WSI image quality.

Is there any configuration we can set up and retrieve uncompressed or JPEG2k lossless WSI image?
And is there any API or URI we can use?
What do you think if we modify metadata 0002,0010 (TransferSyntaxUID) to 1.2.840.10008.1.2 or 1.2.840.10008.1.2.4.90 ?
Would you mind sharing suggestion or reference?

Any help would be sincerely appreciated.
Thank you very much.

Stephen Douglas Scotti 在 2023年3月27日 星期一凌晨12:30:55 [UTC+8] 的信中寫道:

Hi Drexler,

If you receive a file with Lossy Transfer Syntax eg 1.2.840.10008.1.2.4.50, it means that your device has sent it in this format and Orthanc won’t be able to improve the image quality. The transfer syntax must be configured to lossless on the device itself before sending the image to Orthanc.

On Orthanc side, you can however check that you have not set IngestTranscoding to “1.2.840.10008.1.2.4.50”

[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l796)
  // If this option is set, Orthanc will transparently transcode any[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l797)
  // incoming DICOM instance to the given transfer syntax before[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l798)
  // storing it into its database. Beware that this might result in[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l799)
  // high CPU usage (if transcoding to some compressed transfer[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l800)
  // syntax), or in higher disk consumption (if transcoding to an[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l801)
  // uncompressed syntax). Also, beware that transcoding to a transfer[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l802)
  // syntax with lossy compression (notably JPEG) will change the[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l803)
  // "SOPInstanceUID" DICOM tag, and thus the Orthanc identifier at[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l804)
  // the instance level, which might break external workflow.[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l805)
  /**[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l806)
     "IngestTranscoding" : "1.2.840.10008.1.2",[](https://hg.orthanc-server.com/orthanc/file/tip/OrthancServer/Resources/Configuration.json#l807)
  **/

Hope this helps,

Alain

Hello,

Note that starting with forthcoming release 2.0 of the WSI plugin, it will be possible to explicitly ask the image format to be used if decoding the individual tiles.

Information about this topic has just been added to the Orthanc Book:

NB: Starting with version 2.0 of the WSI plugin, the /wsi/tiles/{id}/{z}/{x}/{y} route accepts the Accept HTTP header, which can be used to force the compression of the tile. The allowed values for Accept are: image/png , image/jpeg , and image/jp2 (which corresponds to JPEG2k).

Regards,
Sébastien-

I hereby add some precision about the following message:

If your original file is encoded using the JPEG transfer syntax, the WSI plugin will return the raw JPEG tile, as stored inside the DICOM instance. This has no impact on quality, as the tiles of your image are already stored as JPEG inside the DICOM instance.

If your original file is either uncompressed or using the lossless JPEG2k transfer syntax, the WSI plugin will generate a PNG file. Again, this has no impact on quality, as the PNG compression is lossless.

Summarizing, the WSI plugin never impacts the quality of the stored tiles, except if the Accept header is explicitly set to image/jpeg (which only applies to releases >= 2.0 of the WSI plugin).

I hope this clarifies things,
Sébastien-