ohif-viewer/extensions/cornerstone-dicom-sr/src/index.tsx
Bill Wallace 69d8e6a191
fix(SR): When loading DICOM SR, only one measurement is shown with no way to show others (#3228)
* fix: Make the cornerstone sR viewport show all measurements

* PR fixes

* PR fixes

* Add a DICOM SR hanging protocol

* Duplicate the hanging protocol for seg as well

* PR requested change

* PR requested changes

* PR fixes plus merge update fixes

* PR fixes and integration test fix

* PR - documentation
2023-04-25 17:25:10 -04:00

78 lines
2.0 KiB
TypeScript

import React from 'react';
import getSopClassHandlerModule from './getSopClassHandlerModule';
import getHangingProtocolModule, {
srProtocol,
} from './getHangingProtocolModule';
import onModeEnter from './onModeEnter';
import getCommandsModule from './commandsModule';
import preRegistration from './init';
import { id } from './id.js';
import toolNames from './tools/toolNames';
import hydrateStructuredReport from './utils/hydrateStructuredReport';
import createReferencedImageDisplaySet from './utils/createReferencedImageDisplaySet';
const Component = React.lazy(() => {
return import(
/* webpackPrefetch: true */ './viewports/OHIFCornerstoneSRViewport'
);
});
const OHIFCornerstoneSRViewport = props => {
return (
<React.Suspense fallback={<div>Loading...</div>}>
<Component {...props} />
</React.Suspense>
);
};
/**
*
*/
const dicomSRExtension = {
/**
* Only required property. Should be a unique value across all extensions.
*/
id,
onModeEnter,
preRegistration,
/**
*
*
* @param {object} [configuration={}]
* @param {object|array} [configuration.csToolsConfig] - Passed directly to `initCornerstoneTools`
*/
getViewportModule({ servicesManager, extensionManager }) {
const ExtendedOHIFCornerstoneSRViewport = props => {
return (
<OHIFCornerstoneSRViewport
servicesManager={servicesManager}
extensionManager={extensionManager}
{...props}
/>
);
};
return [{ name: 'dicom-sr', component: ExtendedOHIFCornerstoneSRViewport }];
},
getCommandsModule,
getSopClassHandlerModule,
// Include dynmically computed values such as toolNames not known till instantiation
getUtilityModule({ servicesManager }) {
return [
{
name: 'tools',
exports: {
toolNames,
},
},
];
},
};
export default dicomSRExtension;
// Put static exports here so they can be type checked
export { hydrateStructuredReport, createReferencedImageDisplaySet, srProtocol };