feat: Update to WADO Image Loader 4.0.3 to add dynamically imported WebAssembly codec support 🚀 (#2538)

* feat: update to prerelease of WADO Image Loader, add copy plugin to pull dist/dynamic-import into OHIF

* fix: Set empty public path

* perf: Add webpackPrefetch tags to lazy loaded components

* Switch to using webpack alias to use dynamic import version of WADO Image Loader

* fix lockfile

* prevent polyfilling zlib

* bump to wado image loader 4.0.3 with fix for public path
This commit is contained in:
Erik Ziegler authored and GitHub committed 2021-09-24 09:06:52 +02:00
1 parent 898f93e19d
commit 3c9f3cb273
19 files changed
+232 -88

No files matched your search

@@ -1,7 +1,7 @@
import cornerstone from 'cornerstone-core';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
import dicomParser from 'dicom-parser';
import { errorHandler } from '@ohif/core'
import { errorHandler } from '@ohif/core';
let initialized = false;
@@ -32,12 +32,24 @@ export default function initWADOImageLoader(UserAuthenticationService) {
beforeSend: function(xhr) {
const headers = UserAuthenticationService.getAuthorizationHeader();
// Request:
// JPEG-LS Lossless (1.2.840.10008.1.2.4.80) if available, otherwise accept
// whatever transfer-syntax the origin server provides.
// For now we use image/jls and image/x-jls because some servers still use the old type
// http://dicom.nema.org/medical/dicom/current/output/html/part18.html
const xhrRequestHeaders = {
//accept: 'multipart/related; type="image/x-jls"',
// 'multipart/related; type="image/x-jls", multipart/related; type="image/jls"; transfer-syntax="1.2.840.10008.1.2.4.80", multipart/related; type="image/x-jls", multipart/related; type="application/octet-stream"; transfer-syntax=*',
};
if (headers && headers.Authorization) {
xhr.setRequestHeader('Authorization', headers.Authorization);
xhrRequestHeaders.Authorization = headers.Authorization;
}
return xhrRequestHeaders;
},
errorInterceptor: error => {
errorHandler.getHTTPErrorHandler(error)
errorHandler.getHTTPErrorHandler(error);
},
});