* Enable study prefetcher and expose configs * Fix progress for all images * Enable study loading listener * Add new default for displaying progress bar for series * Use events instead of redux to improve performance * Add documentation, resolve issues with different datasets * CR Updates * CR Updates * CR Updates & Resolve issue when activating both stack and study prefetch * Add upward and update display set logic * Add new behavior to prefetching orders * Rollback display set check and activate cache check * Remove prefetch check * Check if displayset has images * Debounce check cache events * Remove usued debounce flags * Ignore prefetching same image * Use new image instead of image rendered * Continue prefetch after cache check * Update prefetch logic after checking cache * Remove log * Update displayset count default to 3 * Update netlify config Co-authored-by: Alireza <ar.sedghi@gmail.com>
76 lines
2.0 KiB
JavaScript
76 lines
2.0 KiB
JavaScript
import React from 'react';
|
|
import init from './init.js';
|
|
import commandsModule from './commandsModule.js';
|
|
import toolbarModule from './toolbarModule.js';
|
|
import CornerstoneViewportDownloadForm from './CornerstoneViewportDownloadForm';
|
|
import { version } from '../package.json';
|
|
|
|
const Component = React.lazy(() => {
|
|
return import('./OHIFCornerstoneViewport');
|
|
});
|
|
|
|
const OHIFCornerstoneViewport = props => {
|
|
return (
|
|
<React.Suspense fallback={<div>Loading...</div>}>
|
|
<Component {...props} />
|
|
</React.Suspense>
|
|
);
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
export default {
|
|
/**
|
|
* Only required property. Should be a unique value across all extensions.
|
|
*/
|
|
id: 'cornerstone',
|
|
version,
|
|
|
|
/**
|
|
*
|
|
*
|
|
* @param {object} [configuration={}]
|
|
* @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
|
|
*/
|
|
preRegistration({ servicesManager, configuration = {} }) {
|
|
init({ servicesManager, configuration });
|
|
},
|
|
getViewportModule({ commandsManager, appConfig }) {
|
|
const ExtendedOHIFCornerstoneViewport = props => {
|
|
/**
|
|
* TODO: This appears to be used to set the redux parameters for
|
|
* the viewport when new images are loaded. It's very ugly
|
|
* and we should remove it.
|
|
*/
|
|
const onNewImageHandler = jumpData => {
|
|
/** Do not trigger all viewports to render unnecessarily */
|
|
jumpData.refreshViewports = false;
|
|
commandsManager.runCommand('jumpToImage', jumpData);
|
|
};
|
|
|
|
const { studyPrefetcher } = appConfig;
|
|
const isStackPrefetchEnabled =
|
|
studyPrefetcher && !studyPrefetcher.enabled;
|
|
|
|
return (
|
|
<OHIFCornerstoneViewport
|
|
{...props}
|
|
onNewImage={onNewImageHandler}
|
|
isStackPrefetchEnabled={isStackPrefetchEnabled}
|
|
/>
|
|
);
|
|
};
|
|
|
|
return ExtendedOHIFCornerstoneViewport;
|
|
},
|
|
getToolbarModule() {
|
|
return toolbarModule;
|
|
},
|
|
getCommandsModule({ servicesManager }) {
|
|
return commandsModule({ servicesManager });
|
|
},
|
|
};
|
|
|
|
export { CornerstoneViewportDownloadForm };
|