50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
|
|
import React from 'react';
|
||
|
|
import { ServicesManager, CommandsManager, ExtensionManager } from '@ohif/core';
|
||
|
|
import { useViewportGrid } from '@ohif/ui';
|
||
|
|
import MicroscopyPanel from './components/MicroscopyPanel/MicroscopyPanel';
|
||
|
|
|
||
|
|
// TODO:
|
||
|
|
// - No loading UI exists yet
|
||
|
|
// - cancel promises when component is destroyed
|
||
|
|
// - show errors in UI for thumbnails if promise fails
|
||
|
|
|
||
|
|
export default function getPanelModule({
|
||
|
|
commandsManager,
|
||
|
|
extensionManager,
|
||
|
|
servicesManager,
|
||
|
|
}: {
|
||
|
|
servicesManager: ServicesManager;
|
||
|
|
commandsManager: CommandsManager;
|
||
|
|
extensionManager: ExtensionManager;
|
||
|
|
}) {
|
||
|
|
const wrappedMeasurementPanel = () => {
|
||
|
|
const [
|
||
|
|
{ activeViewportIndex, viewports },
|
||
|
|
viewportGridService,
|
||
|
|
] = useViewportGrid();
|
||
|
|
|
||
|
|
return (
|
||
|
|
<MicroscopyPanel
|
||
|
|
viewports={viewports}
|
||
|
|
activeViewportIndex={activeViewportIndex}
|
||
|
|
onSaveComplete={() => {}}
|
||
|
|
onRejectComplete={() => {}}
|
||
|
|
commandsManager={commandsManager}
|
||
|
|
servicesManager={servicesManager}
|
||
|
|
extensionManager={extensionManager}
|
||
|
|
/>
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
return [
|
||
|
|
{
|
||
|
|
name: 'measure',
|
||
|
|
iconName: 'tab-linear',
|
||
|
|
iconLabel: 'Measure',
|
||
|
|
label: 'Measurements',
|
||
|
|
secondaryLabel: 'Measurements',
|
||
|
|
component: wrappedMeasurementPanel,
|
||
|
|
},
|
||
|
|
];
|
||
|
|
}
|