Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(transferSyntax): prefer server transcoded transfer syntax for all images #3883

Merged
merged 9 commits into from
Jan 9, 2024
1 change: 1 addition & 0 deletions platform/app/public/config/local_orthanc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ window.config = {
supportsFuzzyMatching: true,
supportsWildcard: true,
dicomUploadEnabled: true,
omitQuotationForMultipartRequest: true,
bulkDataURI: {
enabled: true,
},
Expand Down
1 change: 0 additions & 1 deletion platform/app/public/config/netlify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions platform/core/src/utils/generateAcceptHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const generateAcceptHeader = (
acceptHeader.push('type=application/octet-stream');
}

acceptHeader.push('transfer-syntax=*');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will add a second transfer-syntax=* header. I think you need to set requestTransferSyntaxUID to '*' when it is undefined.

if (!omitQuotationForMultipartRequest) {
//need to add quotation for each mime type of each accept entry
acceptHeader = acceptHeader.map(mime => {
Expand Down
23 changes: 19 additions & 4 deletions platform/docs/docs/configuration/configurationFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,27 @@ Example usage:<br/>
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


<!-- **Embedded Use Note:**
### More on Accept Header Configuration
In the previous section we showed that you can modify the `acceptHeader`
configuration to request specific dicom transfer syntax. By default
we use `acceptHeader: ['multipart/related; type=application/octet-stream; transfer-syntax=*']` for the following
reasons:

Alternatively, when using the `umd` bundle for embedded use cases, these same
values are what you'll pass to `installViewer` method:
- **Ensures Optimal Transfer Syntax**: By allowing the server to select the transfer syntax,
the client is more likely to receive the image in a syntax that's well-suited for fast transmission
and rendering. This might be the original syntax the image was stored in or another syntax that the server deems efficient.

`OHIFStandaloneViewer.installViewer(window.config)` -->
- **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

Expand Down
Loading