61 lines
1.4 KiB
TypeScript
61 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
import getSopClassHandlerModule from './getSopClassHandlerModule';
|
|
import { id } from './id';
|
|
|
|
const Component = React.lazy(() => {
|
|
return import(/* webpackPrefetch: true */ './viewports/OHIFCornerstoneVideoViewport');
|
|
});
|
|
|
|
const OHIFCornerstoneVideoViewport = props => {
|
|
return (
|
|
<React.Suspense fallback={<div>Loading...</div>}>
|
|
<Component {...props} />
|
|
</React.Suspense>
|
|
);
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
const dicomVideoExtension = {
|
|
/**
|
|
* Only required property. Should be a unique value across all extensions.
|
|
*/
|
|
id,
|
|
|
|
/**
|
|
*
|
|
*
|
|
* @param {object} [configuration={}]
|
|
* @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
|
|
*/
|
|
getViewportModule({ servicesManager, extensionManager }) {
|
|
const ExtendedOHIFCornerstoneVideoViewport = props => {
|
|
return (
|
|
<OHIFCornerstoneVideoViewport
|
|
servicesManager={servicesManager}
|
|
extensionManager={extensionManager}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
return [{ name: 'dicom-video', component: ExtendedOHIFCornerstoneVideoViewport }];
|
|
},
|
|
getSopClassHandlerModule,
|
|
};
|
|
|
|
function _getToolAlias(toolName) {
|
|
let toolAlias = toolName;
|
|
|
|
switch (toolName) {
|
|
case 'EllipticalRoi':
|
|
toolAlias = 'SREllipticalRoi';
|
|
break;
|
|
}
|
|
|
|
return toolAlias;
|
|
}
|
|
|
|
export default dicomVideoExtension;
|