ImagingDataCommons / slim

Interoperable web-based slide microscopy viewer and annotation tool
https://imagingdatacommons.github.io/slim/
Apache License 2.0
111 stars 36 forks source link

JPEG 2000 tiles need to work #7

Closed pieper closed 2 years ago

pieper commented 3 years ago

Copied from: https://github.com/OHIF/Viewers/issues/2231. Not sure this has been tested in Slim.

This study was converted from SVS by @dclunie and has tiles in jp2k:

https://idc-sandbox-000.firebaseapp.com/projects/idc-tcia/locations/us-central1/datasets/tcia-idc-datareviewcoordination/dicomStores/DICOM_WSI-20210108/study/1.3.6.1.4.1.5962.99.1.3802655970.225997140.1610120457442.3.0

OHIF requests them as jpeg with this header: accept: multipart/related; type="image/jpeg"; transfer-syntax=1.2.840.10008.1.2.4.50

But google responds with: generic::invalid_argument: image cannot be transcoded from 1.2.840.10008.1.2.4.91 to image/jpeg; transfer-syntax=1.2.840.10008.1.2.4.50, cause (internal only): generic::invalid_argument: com.google.apps.framework.request.StatusException: generic::INVALID_ARGUMENT:

1.2.840.10008.1.2.4.91 is jp2k as documented here: http://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_8.7.3.html

A suggested solution is that when the server says it cannot provide jpeg, we read the jp2k and convert it on the client using one of the codecs provided by @chafey. Have not looked yet how easy or fast that would be.

Punzo commented 3 years ago

For reference I link the codec repo on which Danny is working (he is still working on it): https://github.com/cornerstonejs/codecs

hackermd commented 3 years ago

Thank you @pieper for reporting the issue. A short term fix would be to use retrieve rendered. That's what SliM does by default. Moving forward, I agree that we should use implement client-side decoding in the dicom-microscopy-viewer using the codecs provided by @chafey. I think this ties in nicely with @Punzo's implementation of GPU rendering for additive blending.

Punzo commented 3 years ago

Yes and I have already opened a ticket for tracking the client side decoding, see https://github.com/MGHComputationalPathology/slim/issues/13

hackermd commented 3 years ago

A short term fix would be to use retrieve rendered.

@Punzo @pieper does this fix the issue?

Punzo commented 3 years ago

I could not load the study 1.3.6.1.4.1.5962.99.1.3802655970.225997140.1610120457442.3.0 at all, see NOTE2 comment in https://github.com/MGHComputationalPathology/slim/issues/13#issuecomment-829448412

Punzo commented 3 years ago

For the momnet we decided to put in hold this issue, since fixing the server fetch and decoding of JPEG2000 with sub-sampling is not high priority. For more info refer to https://docs.google.com/document/d/1hDj62kAZLYIzF_4-jnMd5RkpOFZaR684HPGw-S1Sjhg/edit .

hackermd commented 2 years ago

This should work since the 0.2.0 release.