fix: Allow the mode setup/creation to be async, and provide a few more values to extension/app config/mode setup. (#4016)

This commit is contained in:
Bill Wallace authored and GitHub committed 2024-06-19 09:32:00 -04:00
1 parent 01e200986c
commit 88575c6c09
55 files changed
+2618 -3421

No files matched your search

@@ -49,6 +49,14 @@ class DicomMicroscopyViewport extends Component {
resizeRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]),
};
/**
* Need to return this as a function to prevent webpack from munging it.
*/
public static getImportPath() {
return '/dicom-microscopy-viewer/dicomMicroscopyViewer.min.js';
}
/**
* Get the nearest ROI from the mouse click point
*
@@ -86,9 +94,10 @@ class DicomMicroscopyViewport extends Component {
// you should only do this once.
async installOpenLayersRenderer(container, displaySet) {
const loadViewer = async metadata => {
const { viewer: DicomMicroscopyViewer, metadata: metadataUtils } = await import(
/* webpackChunkName: "dicom-microscopy-viewer" */ 'dicom-microscopy-viewer'
);
await import(
/* webpackIgnore: true */ DicomMicroscopyViewport.getImportPath());
const { viewer: DicomMicroscopyViewer, metadata: metadataUtils } = (window as any).dicomMicroscopyViewer;
const microscopyViewer = DicomMicroscopyViewer.VolumeImageViewer;
const client = getDicomWebClient({