From 1456a493d66c90c787b022256c9f2846afb115fc Mon Sep 17 00:00:00 2001 From: Alireza Date: Tue, 9 Jan 2024 12:36:29 -0500 Subject: [PATCH] feat(transferSyntax): prefer server transcoded transfer syntax for all images (#3883) --- platform/app/public/config/local_orthanc.js | 1 + platform/app/public/config/netlify.js | 1 - .../core/src/utils/generateAcceptHeader.ts | 3 ++- .../docs/configuration/configurationFiles.md | 23 +++++++++++++++---- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/platform/app/public/config/local_orthanc.js b/platform/app/public/config/local_orthanc.js index eabb22f21a..f8ae80c86c 100644 --- a/platform/app/public/config/local_orthanc.js +++ b/platform/app/public/config/local_orthanc.js @@ -32,6 +32,7 @@ window.config = { supportsFuzzyMatching: true, supportsWildcard: true, dicomUploadEnabled: true, + omitQuotationForMultipartRequest: true, bulkDataURI: { enabled: true, }, diff --git a/platform/app/public/config/netlify.js b/platform/app/public/config/netlify.js index a729d1c8d5..3976b79bcf 100644 --- a/platform/app/public/config/netlify.js +++ b/platform/app/public/config/netlify.js @@ -20,7 +20,6 @@ window.config = { wadoUriRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb', qidoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb', wadoRoot: 'https://d33do7qe4w26qo.cloudfront.net/dicomweb', - qidoSupportsIncludeField: false, imageRendering: 'wadors', thumbnailRendering: 'wadors', diff --git a/platform/core/src/utils/generateAcceptHeader.ts b/platform/core/src/utils/generateAcceptHeader.ts index a428be0f73..7d455441ce 100644 --- a/platform/core/src/utils/generateAcceptHeader.ts +++ b/platform/core/src/utils/generateAcceptHeader.ts @@ -1,6 +1,6 @@ const generateAcceptHeader = ( configAcceptHeader = [], - requestTransferSyntaxUID = null, + requestTransferSyntaxUID = '*', //default to accept all transfer syntax omitQuotationForMultipartRequest = false ): string[] => { //if acceptedHeader is passed by config use it as it. @@ -17,6 +17,7 @@ const generateAcceptHeader = ( acceptHeader.push('type=application/octet-stream'); } + acceptHeader.push('transfer-syntax=*'); if (!omitQuotationForMultipartRequest) { //need to add quotation for each mime type of each accept entry acceptHeader = acceptHeader.map(mime => { diff --git a/platform/docs/docs/configuration/configurationFiles.md b/platform/docs/docs/configuration/configurationFiles.md index df0299feca..71ba36b06e 100644 --- a/platform/docs/docs/configuration/configurationFiles.md +++ b/platform/docs/docs/configuration/configurationFiles.md @@ -239,12 +239,27 @@ Example usage:
This configuration would allow the user to build a dicomweb configuration from a GCP healthcare api path e.g. http://localhost:3000/projects/your-gcp-project/locations/us-central1/datasets/your-dataset/dicomStores/your-dicom-store/study/1.3.6.1.4.1.1234.5.2.1.1234.1234.123123123123123123123123123123 - +- **Avoids Transcoding**: Transcoding (converting from one transfer syntax to another) can be a resource-intensive process. + Since the OHIF Viewer supports all transfer syntaxes, it is fine to accept any transfer syntax (transfer-syntax=*). + This allows the server to send the images in their stored syntax, avoiding the need for costly on-the-fly conversions. + This approach not only saves server resources but also reduces response times by leveraging the viewer's capability to handle various syntaxes directly. + +- **Faster Data Transfer**: Compressed transfer syntaxes generally result in smaller file sizes compared + to uncompressed ones. Smaller files transmit faster over the network, leading to quicker load + times for the end-user. By accepting any syntax, the client can take advantage of compression when available. + +However, if you would like to get compressed data in a specific transfer syntax, you can modify the `acceptHeader` configuration or +`requestTransferSyntaxUID` configuration. ## Environment Variables