2020-04-02 12:29:17 +05:30
|
|
|
import React from 'react';
|
2019-10-09 10:23:14 -04:00
|
|
|
import init from './init.js';
|
2019-06-13 09:50:53 -04:00
|
|
|
import commandsModule from './commandsModule.js';
|
2019-06-16 13:56:24 -04:00
|
|
|
import toolbarModule from './toolbarModule.js';
|
2019-12-02 14:02:35 -05:00
|
|
|
import CornerstoneViewportDownloadForm from './CornerstoneViewportDownloadForm';
|
2019-04-16 12:00:06 -04:00
|
|
|
|
2020-04-02 12:29:17 +05:30
|
|
|
const Component = React.lazy(() => {
|
|
|
|
|
return import('./OHIFCornerstoneViewport');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const OHIFCornerstoneViewport = props => {
|
|
|
|
|
return (
|
|
|
|
|
<React.Suspense fallback={<div>Loading...</div>}>
|
|
|
|
|
<Component {...props} />
|
|
|
|
|
</React.Suspense>
|
|
|
|
|
);
|
|
|
|
|
};
|
2019-09-26 11:35:13 +02:00
|
|
|
|
2019-06-13 09:50:53 -04:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
export default {
|
|
|
|
|
/**
|
|
|
|
|
* Only required property. Should be a unique value across all extensions.
|
|
|
|
|
*/
|
|
|
|
|
id: 'cornerstone',
|
|
|
|
|
|
2019-10-09 10:23:14 -04:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @param {object} [configuration={}]
|
|
|
|
|
* @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
|
|
|
|
|
*/
|
2019-11-14 10:32:24 -03:00
|
|
|
preRegistration({ servicesManager, configuration = {} }) {
|
|
|
|
|
init({ servicesManager, configuration });
|
2019-10-09 10:23:14 -04:00
|
|
|
},
|
2020-05-04 09:30:51 -03:00
|
|
|
getViewportModule({ commandsManager }) {
|
|
|
|
|
const ExtendedOHIFCornerstoneViewport = props => {
|
|
|
|
|
const onNewImageHandler = jumpData => {
|
|
|
|
|
commandsManager.runCommand('jumpToImage', jumpData);
|
|
|
|
|
};
|
2020-06-04 06:52:30 -03:00
|
|
|
return (
|
|
|
|
|
<OHIFCornerstoneViewport {...props} onNewImage={onNewImageHandler} />
|
|
|
|
|
);
|
2020-05-04 09:30:51 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return ExtendedOHIFCornerstoneViewport;
|
2019-06-13 09:50:53 -04:00
|
|
|
},
|
|
|
|
|
getToolbarModule() {
|
2019-06-16 13:56:24 -04:00
|
|
|
return toolbarModule;
|
2019-06-13 09:50:53 -04:00
|
|
|
},
|
2019-12-02 14:02:35 -05:00
|
|
|
getCommandsModule({ servicesManager }) {
|
|
|
|
|
return commandsModule({ servicesManager });
|
2019-06-20 22:57:14 -04:00
|
|
|
},
|
2019-06-13 09:50:53 -04:00
|
|
|
};
|
2019-12-02 14:02:35 -05:00
|
|
|
|
|
|
|
|
export { CornerstoneViewportDownloadForm };
|