feat: Ultrasound Pleura B-line Annotation Mode & Extension (#5061)
This commit is contained in:
1 parent
9b8eef9474
commit
226f9b0773
46 files changed
+7123
-3660
No files matched your search
@@ -0,0 +1,5 @@
|
||||
import packageJson from '../package.json';
|
||||
|
||||
const id = packageJson.name;
|
||||
|
||||
export { id };
|
||||
@@ -0,0 +1,391 @@
|
||||
import i18n from 'i18next';
|
||||
import { id } from './id';
|
||||
import initToolGroups from './initToolGroups';
|
||||
import toolbarButtons from './toolbarButtons';
|
||||
import { UltrasoundPleuraBLineTool } from '@cornerstonejs/tools';
|
||||
import { showPercentage } from '@ohif/extension-ultrasound-pleura-bline';
|
||||
|
||||
// Allow this mode by excluding non-imaging modalities such as SR, SEG
|
||||
// Also, SM is not a simple imaging modalities, so exclude it.
|
||||
const NON_IMAGE_MODALITIES = ['ECG', 'SEG', 'RTSTRUCT', 'RTPLAN', 'PR'];
|
||||
|
||||
const ohif = {
|
||||
layout: '@ohif/extension-default.layoutTemplateModule.viewerLayout',
|
||||
sopClassHandler: '@ohif/extension-default.sopClassHandlerModule.stack',
|
||||
thumbnailList: '@ohif/extension-default.panelModule.seriesList',
|
||||
wsiSopClassHandler:
|
||||
'@ohif/extension-cornerstone.sopClassHandlerModule.DicomMicroscopySopClassHandler',
|
||||
};
|
||||
|
||||
const cornerstone = {
|
||||
measurements: '@ohif/extension-cornerstone.panelModule.panelMeasurement',
|
||||
segmentation: '@ohif/extension-cornerstone.panelModule.panelSegmentation',
|
||||
};
|
||||
|
||||
const tracked = {
|
||||
measurements: '@ohif/extension-measurement-tracking.panelModule.trackedMeasurements',
|
||||
thumbnailList: '@ohif/extension-measurement-tracking.panelModule.seriesList',
|
||||
viewport: '@ohif/extension-measurement-tracking.viewportModule.cornerstone-tracked',
|
||||
};
|
||||
|
||||
const dicomsr = {
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr',
|
||||
sopClassHandler3D: '@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr-3d',
|
||||
viewport: '@ohif/extension-cornerstone-dicom-sr.viewportModule.dicom-sr',
|
||||
};
|
||||
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
const dicompdf = {
|
||||
sopClassHandler: '@ohif/extension-dicom-pdf.sopClassHandlerModule.dicom-pdf',
|
||||
viewport: '@ohif/extension-dicom-pdf.viewportModule.dicom-pdf',
|
||||
};
|
||||
|
||||
const dicomSeg = {
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',
|
||||
viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',
|
||||
};
|
||||
|
||||
const dicomPmap = {
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-pmap.sopClassHandlerModule.dicom-pmap',
|
||||
viewport: '@ohif/extension-cornerstone-dicom-pmap.viewportModule.dicom-pmap',
|
||||
};
|
||||
|
||||
const dicomRT = {
|
||||
viewport: '@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt',
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt',
|
||||
};
|
||||
|
||||
const usAnnotation = {
|
||||
panel: '@ohif/extension-ultrasound-pleura-bline.panelModule.USAnnotationPanel',
|
||||
};
|
||||
|
||||
let settingsSaved = {};
|
||||
const extensionDependencies = {
|
||||
// Can derive the versions at least process.env.from npm_package_version
|
||||
'@ohif/extension-default': '^3.0.0',
|
||||
'@ohif/extension-cornerstone': '^3.0.0',
|
||||
'@ohif/extension-measurement-tracking': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-sr': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-seg': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-pmap': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-rt': '^3.0.0',
|
||||
'@ohif/extension-dicom-pdf': '^3.0.1',
|
||||
'@ohif/extension-dicom-video': '^3.0.1',
|
||||
'@ohif/extension-ultrasound-pleura-bline': '^3.0.0',
|
||||
};
|
||||
|
||||
function modeFactory({ modeConfiguration }) {
|
||||
let _activatePanelTriggersSubscriptions = [];
|
||||
return {
|
||||
// TODO: We're using this as a route segment
|
||||
// We should not be.
|
||||
id,
|
||||
routeName: 'usAnnotation',
|
||||
displayName: i18n.t('US Pleura B-line Annotations'),
|
||||
/**
|
||||
* Lifecycle hooks
|
||||
*/
|
||||
onModeEnter: function ({
|
||||
servicesManager,
|
||||
extensionManager,
|
||||
commandsManager,
|
||||
appConfig,
|
||||
}: withAppTypes) {
|
||||
settingsSaved = {
|
||||
disableConfirmationPrompts: appConfig?.disableConfirmationPrompts,
|
||||
measurementTrackingMode: appConfig?.measurementTrackingMode,
|
||||
};
|
||||
appConfig.disableConfirmationPrompts = true;
|
||||
appConfig.measurementTrackingMode = 'simplified';
|
||||
const { measurementService, toolbarService, toolGroupService, customizationService } =
|
||||
servicesManager.services;
|
||||
|
||||
measurementService.clearMeasurements();
|
||||
|
||||
// Init Default and SR ToolGroups
|
||||
initToolGroups(extensionManager, toolGroupService, commandsManager);
|
||||
|
||||
toolbarService.register(toolbarButtons);
|
||||
toolbarService.updateSection(toolbarService.sections.primary, [
|
||||
'MeasurementTools',
|
||||
'Zoom',
|
||||
'Pan',
|
||||
'TrackballRotate',
|
||||
'WindowLevel',
|
||||
'Capture',
|
||||
'Layout',
|
||||
'Crosshairs',
|
||||
'MoreTools',
|
||||
]);
|
||||
|
||||
toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topLeft, [
|
||||
'orientationMenu',
|
||||
'dataOverlayMenu',
|
||||
]);
|
||||
|
||||
toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomMiddle, [
|
||||
'AdvancedRenderingControls',
|
||||
]);
|
||||
|
||||
toolbarService.updateSection(toolbarService.sections.advancedRenderingControlsSection, [
|
||||
'windowLevelMenuEmbedded',
|
||||
'voiManualControlMenu',
|
||||
'Colorbar',
|
||||
'opacityMenu',
|
||||
'thresholdMenu',
|
||||
]);
|
||||
|
||||
toolbarService.updateSection(toolbarService.sections.viewportActionMenu.topRight, [
|
||||
'modalityLoadBadge',
|
||||
'trackingStatus',
|
||||
'navigationComponent',
|
||||
]);
|
||||
|
||||
toolbarService.updateSection(toolbarService.sections.viewportActionMenu.bottomLeft, [
|
||||
'windowLevelMenu',
|
||||
]);
|
||||
|
||||
toolbarService.updateSection(toolbarService.sections.measurementSection, [
|
||||
'Length',
|
||||
'Bidirectional',
|
||||
'ArrowAnnotate',
|
||||
'EllipticalROI',
|
||||
'RectangleROI',
|
||||
'CircleROI',
|
||||
'PlanarFreehandROI',
|
||||
'SplineROI',
|
||||
'LivewireContour',
|
||||
]);
|
||||
|
||||
toolbarService.updateSection(toolbarService.sections.moreToolsSection, [
|
||||
'Reset',
|
||||
'rotate-right',
|
||||
'flipHorizontal',
|
||||
'ImageSliceSync',
|
||||
'ReferenceLines',
|
||||
'ImageOverlayViewer',
|
||||
'StackScroll',
|
||||
'invert',
|
||||
'Probe',
|
||||
'Cine',
|
||||
'Angle',
|
||||
'CobbAngle',
|
||||
'Magnify',
|
||||
'CalibrationLine',
|
||||
'TagBrowser',
|
||||
'AdvancedMagnify',
|
||||
'UltrasoundDirectionalTool',
|
||||
'UltrasoundPleuraBLineTool',
|
||||
'WindowLevelRegion',
|
||||
]);
|
||||
|
||||
customizationService.setCustomizations(
|
||||
{
|
||||
'panelSegmentation.disableEditing': {
|
||||
$set: true,
|
||||
},
|
||||
autoCineModalities: {
|
||||
$set: [],
|
||||
},
|
||||
'ohif.hotkeyBindings': {
|
||||
$push: [
|
||||
{
|
||||
commandName: 'switchUSAnnotationToPleuraLine',
|
||||
label: 'Add new pleura line',
|
||||
keys: ['W'],
|
||||
},
|
||||
{
|
||||
commandName: 'switchUSAnnotationToBLine',
|
||||
label: 'Add new B-line',
|
||||
keys: ['S'],
|
||||
},
|
||||
{
|
||||
commandName: 'deleteLastPleuraAnnotation',
|
||||
label: 'Delete last pleura line',
|
||||
keys: ['E'],
|
||||
},
|
||||
{
|
||||
commandName: 'deleteLastBLineAnnotation',
|
||||
label: 'Delete last B-line',
|
||||
keys: ['D'],
|
||||
},
|
||||
{
|
||||
commandName: 'toggleDisplayFanAnnotation',
|
||||
label: 'Toggle overlay',
|
||||
keys: ['O'],
|
||||
},
|
||||
],
|
||||
},
|
||||
measurementsContextMenu: {
|
||||
inheritsFrom: 'ohif.contextMenu',
|
||||
menus: [
|
||||
// Get the items from the UI Customization for the menu name (and have a custom name)
|
||||
{
|
||||
id: 'forExistingMeasurement',
|
||||
selector: ({ nearbyToolData }) => !!nearbyToolData,
|
||||
items: [
|
||||
{
|
||||
label: 'Delete annotation',
|
||||
commands: 'removeMeasurement',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
'viewportOverlay.topLeft': [
|
||||
{
|
||||
id: 'BLinePleuraPercentage',
|
||||
inheritsFrom: 'ohif.overlayItem',
|
||||
label: '',
|
||||
title: 'BLinePleuraPercentage',
|
||||
condition: ({ referenceInstance }) => referenceInstance?.Modality.includes('US'),
|
||||
contentF: () => {
|
||||
if (!showPercentage) {
|
||||
return;
|
||||
}
|
||||
const { viewportGridService, toolGroupService, cornerstoneViewportService } =
|
||||
servicesManager.services;
|
||||
const activeViewportId = viewportGridService.getActiveViewportId();
|
||||
const toolGroup = toolGroupService.getToolGroupForViewport(activeViewportId);
|
||||
if (!toolGroup) {
|
||||
return 'B-Line/Pleura : N/A';
|
||||
}
|
||||
const usAnnotation = toolGroup.getToolInstance(UltrasoundPleuraBLineTool.toolName);
|
||||
if (usAnnotation) {
|
||||
const viewport =
|
||||
cornerstoneViewportService.getCornerstoneViewport(activeViewportId);
|
||||
const percentage = usAnnotation.calculateBLinePleuraPercentage(viewport);
|
||||
if (percentage !== undefined) {
|
||||
return `B-Line/Pleura : ${percentage.toFixed(2)} %`;
|
||||
} else {
|
||||
return 'B-Line/Pleura : N/A';
|
||||
}
|
||||
}
|
||||
return 'B-Line/Pleura : N/A';
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
'mode'
|
||||
);
|
||||
},
|
||||
onModeExit: ({ servicesManager }: withAppTypes) => {
|
||||
appConfig.disableConfirmationPrompts = settingsSaved.disableConfirmationPrompts;
|
||||
appConfig.measurementTrackingMode = settingsSaved.measurementTrackingMode;
|
||||
|
||||
const {
|
||||
toolGroupService,
|
||||
syncGroupService,
|
||||
segmentationService,
|
||||
cornerstoneViewportService,
|
||||
uiDialogService,
|
||||
uiModalService,
|
||||
} = servicesManager.services;
|
||||
|
||||
_activatePanelTriggersSubscriptions.forEach(sub => sub.unsubscribe());
|
||||
_activatePanelTriggersSubscriptions = [];
|
||||
|
||||
uiDialogService.hideAll();
|
||||
uiModalService.hide();
|
||||
toolGroupService.destroy();
|
||||
syncGroupService.destroy();
|
||||
segmentationService.destroy();
|
||||
cornerstoneViewportService.destroy();
|
||||
},
|
||||
validationTags: {
|
||||
study: [],
|
||||
series: [],
|
||||
},
|
||||
|
||||
isValidMode: function ({ modalities }) {
|
||||
const modalities_list = modalities.split('\\');
|
||||
|
||||
return {
|
||||
valid: modalities_list.includes('US'),
|
||||
description: 'Pleura b-lines annotation mode when the study involves US modality series',
|
||||
};
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'longitudinal',
|
||||
/*init: ({ servicesManager, extensionManager }) => {
|
||||
//defaultViewerRouteInit
|
||||
},*/
|
||||
layoutTemplate: () => {
|
||||
return {
|
||||
id: ohif.layout,
|
||||
props: {
|
||||
leftPanels: [tracked.thumbnailList],
|
||||
leftPanelResizable: true,
|
||||
rightPanels: [usAnnotation.panel, cornerstone.segmentation, tracked.measurements],
|
||||
rightPanelResizable: true,
|
||||
viewports: [
|
||||
{
|
||||
namespace: tracked.viewport,
|
||||
displaySetsToDisplay: [
|
||||
ohif.sopClassHandler,
|
||||
dicomvideo.sopClassHandler,
|
||||
dicomsr.sopClassHandler3D,
|
||||
ohif.wsiSopClassHandler,
|
||||
],
|
||||
},
|
||||
{
|
||||
namespace: dicomsr.viewport,
|
||||
displaySetsToDisplay: [dicomsr.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicompdf.viewport,
|
||||
displaySetsToDisplay: [dicompdf.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomSeg.viewport,
|
||||
displaySetsToDisplay: [dicomSeg.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomPmap.viewport,
|
||||
displaySetsToDisplay: [dicomPmap.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomRT.viewport,
|
||||
displaySetsToDisplay: [dicomRT.sopClassHandler],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
extensions: extensionDependencies,
|
||||
// Default protocol gets self-registered by default in the init
|
||||
hangingProtocol: 'default',
|
||||
// Order is important in sop class handlers when two handlers both use
|
||||
// the same sop class under different situations. In that case, the more
|
||||
// general handler needs to come last. For this case, the dicomvideo must
|
||||
// come first to remove video transfer syntax before ohif uses images
|
||||
sopClassHandlers: [
|
||||
dicomvideo.sopClassHandler,
|
||||
dicomSeg.sopClassHandler,
|
||||
dicomPmap.sopClassHandler,
|
||||
ohif.sopClassHandler,
|
||||
ohif.wsiSopClassHandler,
|
||||
dicompdf.sopClassHandler,
|
||||
dicomsr.sopClassHandler3D,
|
||||
dicomsr.sopClassHandler,
|
||||
dicomRT.sopClassHandler,
|
||||
],
|
||||
...modeConfiguration,
|
||||
};
|
||||
}
|
||||
|
||||
const mode = {
|
||||
id,
|
||||
modeFactory,
|
||||
extensionDependencies,
|
||||
};
|
||||
|
||||
export default mode;
|
||||
export { initToolGroups, toolbarButtons };
|
||||
@@ -0,0 +1,316 @@
|
||||
import { toolNames as SRToolNames } from '@ohif/extension-cornerstone-dicom-sr';
|
||||
|
||||
const colours = {
|
||||
'viewport-0': 'rgb(200, 0, 0)',
|
||||
'viewport-1': 'rgb(200, 200, 0)',
|
||||
'viewport-2': 'rgb(0, 200, 0)',
|
||||
};
|
||||
|
||||
const colorsByOrientation = {
|
||||
axial: 'rgb(200, 0, 0)',
|
||||
sagittal: 'rgb(200, 200, 0)',
|
||||
coronal: 'rgb(0, 200, 0)',
|
||||
};
|
||||
|
||||
function initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, toolGroupId) {
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const { toolNames, Enums } = utilityModule.exports;
|
||||
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.UltrasoundAnnotation,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.StackScroll,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Wheel }],
|
||||
},
|
||||
],
|
||||
passive: [
|
||||
{ toolName: toolNames.Length },
|
||||
{
|
||||
toolName: toolNames.ArrowAnnotate,
|
||||
configuration: {
|
||||
getTextCallback: (callback, eventDetails) => {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
eventDetails,
|
||||
});
|
||||
},
|
||||
changeTextCallback: (data, eventDetails, callback) => {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
data,
|
||||
eventDetails,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
toolName: toolNames.SegmentBidirectional,
|
||||
},
|
||||
{ toolName: toolNames.Bidirectional },
|
||||
{ toolName: toolNames.DragProbe },
|
||||
{ toolName: toolNames.Probe },
|
||||
{ toolName: toolNames.EllipticalROI },
|
||||
{ toolName: toolNames.CircleROI },
|
||||
{ toolName: toolNames.RectangleROI },
|
||||
{ toolName: toolNames.StackScroll },
|
||||
{ toolName: toolNames.Angle },
|
||||
{ toolName: toolNames.CobbAngle },
|
||||
{ toolName: toolNames.Magnify },
|
||||
{ toolName: toolNames.CalibrationLine },
|
||||
{
|
||||
toolName: toolNames.PlanarFreehandContourSegmentation,
|
||||
configuration: {
|
||||
displayOnePointAsCrosshairs: true,
|
||||
},
|
||||
},
|
||||
{ toolName: toolNames.UltrasoundDirectional },
|
||||
{ toolName: toolNames.WindowLevel },
|
||||
{ toolName: toolNames.PlanarFreehandROI },
|
||||
{ toolName: toolNames.SplineROI },
|
||||
{ toolName: toolNames.LivewireContour },
|
||||
{ toolName: toolNames.WindowLevelRegion },
|
||||
],
|
||||
enabled: [
|
||||
{ toolName: toolNames.ImageOverlayViewer },
|
||||
{ toolName: toolNames.ReferenceLines },
|
||||
{
|
||||
toolName: SRToolNames.SRSCOORD3DPoint,
|
||||
},
|
||||
],
|
||||
disabled: [
|
||||
{
|
||||
toolName: toolNames.AdvancedMagnify,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
|
||||
}
|
||||
|
||||
function initSRToolGroup(extensionManager, toolGroupService) {
|
||||
const SRUtilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone-dicom-sr.utilityModule.tools'
|
||||
);
|
||||
|
||||
if (!SRUtilityModule) {
|
||||
return;
|
||||
}
|
||||
|
||||
const CS3DUtilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const { toolNames: SRToolNames } = SRUtilityModule.exports;
|
||||
const { toolNames, Enums } = CS3DUtilityModule.exports;
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.WindowLevel,
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: Enums.MouseBindings.Primary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: Enums.MouseBindings.Auxiliary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: Enums.MouseBindings.Secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.StackScroll,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Wheel }],
|
||||
},
|
||||
],
|
||||
passive: [
|
||||
{ toolName: SRToolNames.SRLength },
|
||||
{ toolName: SRToolNames.SRArrowAnnotate },
|
||||
{ toolName: SRToolNames.SRBidirectional },
|
||||
{ toolName: SRToolNames.SREllipticalROI },
|
||||
{ toolName: SRToolNames.SRCircleROI },
|
||||
{ toolName: SRToolNames.SRPlanarFreehandROI },
|
||||
{ toolName: SRToolNames.SRRectangleROI },
|
||||
{ toolName: toolNames.WindowLevelRegion },
|
||||
],
|
||||
enabled: [
|
||||
{
|
||||
toolName: SRToolNames.DICOMSRDisplay,
|
||||
},
|
||||
],
|
||||
// disabled
|
||||
};
|
||||
|
||||
const toolGroupId = 'SRToolGroup';
|
||||
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
|
||||
}
|
||||
|
||||
function initMPRToolGroup(extensionManager, toolGroupService, commandsManager) {
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const serviceManager = extensionManager._servicesManager;
|
||||
const { cornerstoneViewportService } = serviceManager.services;
|
||||
|
||||
const { toolNames, Enums } = utilityModule.exports;
|
||||
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.WindowLevel,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.StackScroll,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Wheel }],
|
||||
},
|
||||
],
|
||||
passive: [
|
||||
{ toolName: toolNames.Length },
|
||||
{
|
||||
toolName: toolNames.ArrowAnnotate,
|
||||
configuration: {
|
||||
getTextCallback: (callback, eventDetails) => {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
eventDetails,
|
||||
});
|
||||
},
|
||||
changeTextCallback: (data, eventDetails, callback) => {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
data,
|
||||
eventDetails,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
{ toolName: toolNames.Bidirectional },
|
||||
{ toolName: toolNames.DragProbe },
|
||||
{ toolName: toolNames.Probe },
|
||||
{ toolName: toolNames.EllipticalROI },
|
||||
{ toolName: toolNames.CircleROI },
|
||||
{ toolName: toolNames.RectangleROI },
|
||||
{ toolName: toolNames.StackScroll },
|
||||
{ toolName: toolNames.Angle },
|
||||
{ toolName: toolNames.CobbAngle },
|
||||
{ toolName: toolNames.PlanarFreehandROI },
|
||||
{ toolName: toolNames.SplineROI },
|
||||
{ toolName: toolNames.LivewireContour },
|
||||
{ toolName: toolNames.WindowLevelRegion },
|
||||
{
|
||||
toolName: toolNames.PlanarFreehandContourSegmentation,
|
||||
configuration: {
|
||||
displayOnePointAsCrosshairs: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
disabled: [
|
||||
{
|
||||
toolName: toolNames.Crosshairs,
|
||||
configuration: {
|
||||
viewportIndicators: true,
|
||||
viewportIndicatorsConfig: {
|
||||
circleRadius: 5,
|
||||
xOffset: 0.95,
|
||||
yOffset: 0.05,
|
||||
},
|
||||
disableOnPassive: true,
|
||||
autoPan: {
|
||||
enabled: false,
|
||||
panSize: 10,
|
||||
},
|
||||
getReferenceLineColor: viewportId => {
|
||||
const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);
|
||||
const viewportOptions = viewportInfo?.viewportOptions;
|
||||
if (viewportOptions) {
|
||||
return (
|
||||
colours[viewportOptions.id] ||
|
||||
colorsByOrientation[viewportOptions.orientation] ||
|
||||
'#0c0'
|
||||
);
|
||||
} else {
|
||||
console.warn('missing viewport?', viewportId);
|
||||
return '#0c0';
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
toolName: toolNames.AdvancedMagnify,
|
||||
},
|
||||
{ toolName: toolNames.ReferenceLines },
|
||||
],
|
||||
};
|
||||
|
||||
toolGroupService.createToolGroupAndAddTools('mpr', tools);
|
||||
}
|
||||
function initVolume3DToolGroup(extensionManager, toolGroupService) {
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const { toolNames, Enums } = utilityModule.exports;
|
||||
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.TrackballRotateTool,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
toolGroupService.createToolGroupAndAddTools('volume3d', tools);
|
||||
}
|
||||
|
||||
function initToolGroups(extensionManager, toolGroupService, commandsManager) {
|
||||
initDefaultToolGroup(extensionManager, toolGroupService, commandsManager, 'default');
|
||||
initSRToolGroup(extensionManager, toolGroupService);
|
||||
initMPRToolGroup(extensionManager, toolGroupService, commandsManager);
|
||||
initVolume3DToolGroup(extensionManager, toolGroupService);
|
||||
}
|
||||
|
||||
export default initToolGroups;
|
||||
@@ -0,0 +1,703 @@
|
||||
import type { Button } from '@ohif/core/types';
|
||||
|
||||
import { EVENTS } from '@cornerstonejs/core';
|
||||
import { ViewportGridService } from '@ohif/core';
|
||||
|
||||
const callbacks = (toolName: string) => [
|
||||
{
|
||||
commandName: 'setViewportForToolConfiguration',
|
||||
commandOptions: {
|
||||
toolName,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const setToolActiveToolbar = {
|
||||
commandName: 'setToolActiveToolbar',
|
||||
commandOptions: {
|
||||
toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],
|
||||
},
|
||||
};
|
||||
|
||||
const toolbarButtons: Button[] = [
|
||||
// sections
|
||||
{
|
||||
id: 'MeasurementTools',
|
||||
uiType: 'ohif.toolButtonList',
|
||||
props: {
|
||||
buttonSection: 'measurementSection',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'MoreTools',
|
||||
uiType: 'ohif.toolButtonList',
|
||||
props: {
|
||||
buttonSection: 'moreToolsSection',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'AdvancedRenderingControls',
|
||||
uiType: 'ohif.advancedRenderingControls',
|
||||
props: {
|
||||
buttonSection: 'advancedRenderingControlsSection',
|
||||
},
|
||||
},
|
||||
// tool defs
|
||||
{
|
||||
id: 'modalityLoadBadge',
|
||||
uiType: 'ohif.modalityLoadBadge',
|
||||
props: {
|
||||
icon: 'Status',
|
||||
label: 'Status',
|
||||
tooltip: 'Status',
|
||||
evaluate: {
|
||||
name: 'evaluate.modalityLoadBadge',
|
||||
hideWhenDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'navigationComponent',
|
||||
uiType: 'ohif.navigationComponent',
|
||||
props: {
|
||||
icon: 'Navigation',
|
||||
label: 'Navigation',
|
||||
tooltip: 'Navigate between segments/measurements and manage their visibility',
|
||||
evaluate: {
|
||||
name: 'evaluate.navigationComponent',
|
||||
hideWhenDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'trackingStatus',
|
||||
uiType: 'ohif.trackingStatus',
|
||||
props: {
|
||||
icon: 'TrackingStatus',
|
||||
label: 'Tracking Status',
|
||||
tooltip: 'View and manage tracking status of measurements and annotations',
|
||||
evaluate: {
|
||||
name: 'evaluate.trackingStatus',
|
||||
hideWhenDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'dataOverlayMenu',
|
||||
uiType: 'ohif.dataOverlayMenu',
|
||||
props: {
|
||||
icon: 'ViewportViews',
|
||||
label: 'Data Overlay',
|
||||
tooltip: 'Configure data overlay options and manage foreground/background display sets',
|
||||
evaluate: 'evaluate.dataOverlayMenu',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'orientationMenu',
|
||||
uiType: 'ohif.orientationMenu',
|
||||
props: {
|
||||
icon: 'OrientationSwitch',
|
||||
label: 'Orientation',
|
||||
tooltip:
|
||||
'Change viewport orientation between axial, sagittal, coronal and acquisition planes',
|
||||
evaluate: {
|
||||
name: 'evaluate.orientationMenu',
|
||||
// hideWhenDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'windowLevelMenuEmbedded',
|
||||
uiType: 'ohif.windowLevelMenuEmbedded',
|
||||
props: {
|
||||
icon: 'WindowLevel',
|
||||
label: 'Window Level',
|
||||
tooltip: 'Adjust window/level presets and customize image contrast settings',
|
||||
evaluate: {
|
||||
name: 'evaluate.windowLevelMenuEmbedded',
|
||||
hideWhenDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'windowLevelMenu',
|
||||
uiType: 'ohif.windowLevelMenu',
|
||||
props: {
|
||||
icon: 'WindowLevel',
|
||||
label: 'Window Level',
|
||||
tooltip: 'Adjust window/level presets and customize image contrast settings',
|
||||
evaluate: {
|
||||
name: 'evaluate.windowLevelMenu',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'voiManualControlMenu',
|
||||
uiType: 'ohif.voiManualControlMenu',
|
||||
props: {
|
||||
icon: 'WindowLevelAdvanced',
|
||||
label: 'Advanced Window Level',
|
||||
tooltip: 'Advanced window/level settings with manual controls and presets',
|
||||
evaluate: 'evaluate.voiManualControlMenu',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'thresholdMenu',
|
||||
uiType: 'ohif.thresholdMenu',
|
||||
props: {
|
||||
icon: 'Threshold',
|
||||
label: 'Threshold',
|
||||
tooltip: 'Image threshold settings',
|
||||
evaluate: {
|
||||
name: 'evaluate.thresholdMenu',
|
||||
hideWhenDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'opacityMenu',
|
||||
uiType: 'ohif.opacityMenu',
|
||||
props: {
|
||||
icon: 'Opacity',
|
||||
label: 'Opacity',
|
||||
tooltip: 'Image opacity settings',
|
||||
evaluate: {
|
||||
name: 'evaluate.opacityMenu',
|
||||
hideWhenDisabled: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Colorbar',
|
||||
uiType: 'ohif.colorbar',
|
||||
props: {
|
||||
type: 'tool',
|
||||
label: 'Colorbar',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Reset',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-reset',
|
||||
label: 'Reset View',
|
||||
tooltip: 'Reset View',
|
||||
commands: 'resetViewport',
|
||||
evaluate: 'evaluate.action',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'rotate-right',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-rotate-right',
|
||||
label: 'Rotate Right',
|
||||
tooltip: 'Rotate +90',
|
||||
commands: 'rotateViewportCW',
|
||||
evaluate: [
|
||||
'evaluate.action',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'flipHorizontal',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-flip-horizontal',
|
||||
label: 'Flip Horizontal',
|
||||
tooltip: 'Flip Horizontally',
|
||||
commands: 'flipViewportHorizontal',
|
||||
evaluate: [
|
||||
'evaluate.viewportProperties.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video', 'volume3d'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'ImageSliceSync',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'link',
|
||||
label: 'Image Slice Sync',
|
||||
tooltip: 'Enable position synchronization on stack viewports',
|
||||
commands: {
|
||||
commandName: 'toggleSynchronizer',
|
||||
commandOptions: {
|
||||
type: 'imageSlice',
|
||||
},
|
||||
},
|
||||
listeners: {
|
||||
[EVENTS.VIEWPORT_NEW_IMAGE_SET]: {
|
||||
commandName: 'toggleImageSliceSync',
|
||||
commandOptions: { toggledState: true },
|
||||
},
|
||||
},
|
||||
evaluate: [
|
||||
'evaluate.cornerstone.synchronizer',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video', 'volume3d'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'ReferenceLines',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-referenceLines',
|
||||
label: 'Reference Lines',
|
||||
tooltip: 'Show Reference Lines',
|
||||
commands: 'toggleEnabledDisabledToolbar',
|
||||
listeners: {
|
||||
[ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks('ReferenceLines'),
|
||||
[ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('ReferenceLines'),
|
||||
},
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'ImageOverlayViewer',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'toggle-dicom-overlay',
|
||||
label: 'Image Overlay',
|
||||
tooltip: 'Toggle Image Overlay',
|
||||
commands: 'toggleEnabledDisabledToolbar',
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'StackScroll',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-stack-scroll',
|
||||
label: 'Stack Scroll',
|
||||
tooltip: 'Stack Scroll',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'invert',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-invert',
|
||||
label: 'Invert',
|
||||
tooltip: 'Invert Colors',
|
||||
commands: 'invertViewport',
|
||||
evaluate: [
|
||||
'evaluate.viewportProperties.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Probe',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-probe',
|
||||
label: 'Probe',
|
||||
tooltip: 'Probe',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Cine',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-cine',
|
||||
label: 'Cine',
|
||||
tooltip: 'Cine',
|
||||
commands: 'toggleCine',
|
||||
evaluate: [
|
||||
'evaluate.cine',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['volume3d'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Angle',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-angle',
|
||||
label: 'Angle',
|
||||
tooltip: 'Angle',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'CobbAngle',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-cobb-angle',
|
||||
label: 'Cobb Angle',
|
||||
tooltip: 'Cobb Angle',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Magnify',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-magnify',
|
||||
label: 'Zoom-in',
|
||||
tooltip: 'Zoom-in',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'CalibrationLine',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-calibration',
|
||||
label: 'Calibration',
|
||||
tooltip: 'Calibration Line',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'TagBrowser',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'dicom-tag-browser',
|
||||
label: 'Dicom Tag Browser',
|
||||
tooltip: 'Dicom Tag Browser',
|
||||
commands: 'openDICOMTagViewer',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'AdvancedMagnify',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-loupe',
|
||||
label: 'Magnify Probe',
|
||||
tooltip: 'Magnify Probe',
|
||||
commands: 'toggleActiveDisabledToolbar',
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle.ifStrictlyDisabled',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'UltrasoundDirectionalTool',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-ultrasound-bidirectional',
|
||||
label: 'Ultrasound Directional',
|
||||
tooltip: 'Ultrasound Directional',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.modality.supported',
|
||||
supportedModalities: ['US'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'UltrasoundPleuraBLineTool',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-ultrasound-bidirectional',
|
||||
label: 'US Pleura B-line Annotation',
|
||||
tooltip: 'US Pleura B-line Annotation',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.modality.supported',
|
||||
supportedModalities: ['US'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'WindowLevelRegion',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-window-region',
|
||||
label: 'Window Level Region',
|
||||
tooltip: 'Window Level Region',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Length',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-length',
|
||||
label: 'Length',
|
||||
tooltip: 'Length Tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Bidirectional',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-bidirectional',
|
||||
label: 'Bidirectional',
|
||||
tooltip: 'Bidirectional Tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'ArrowAnnotate',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-annotate',
|
||||
label: 'Annotation',
|
||||
tooltip: 'Arrow Annotate',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'EllipticalROI',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-ellipse',
|
||||
label: 'Ellipse',
|
||||
tooltip: 'Ellipse ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'RectangleROI',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-rectangle',
|
||||
label: 'Rectangle',
|
||||
tooltip: 'Rectangle ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'CircleROI',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-circle',
|
||||
label: 'Circle',
|
||||
tooltip: 'Circle Tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'PlanarFreehandROI',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-freehand-roi',
|
||||
label: 'Freehand ROI',
|
||||
tooltip: 'Freehand ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'SplineROI',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-spline-roi',
|
||||
label: 'Spline ROI',
|
||||
tooltip: 'Spline ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'LivewireContour',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'icon-tool-livewire',
|
||||
label: 'Livewire tool',
|
||||
tooltip: 'Livewire tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
// Window Level
|
||||
{
|
||||
id: 'WindowLevel',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-window-level',
|
||||
label: 'Window Level',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['wholeSlide'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Pan',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
type: 'tool',
|
||||
icon: 'tool-move',
|
||||
label: 'Pan',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Zoom',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
type: 'tool',
|
||||
icon: 'tool-zoom',
|
||||
label: 'Zoom',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'TrackballRotate',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
type: 'tool',
|
||||
icon: 'tool-3d-rotate',
|
||||
label: '3D Rotate',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: {
|
||||
name: 'evaluate.cornerstoneTool',
|
||||
disabledText: 'Select a 3D viewport to enable this tool',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Capture',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
icon: 'tool-capture',
|
||||
label: 'Capture',
|
||||
commands: 'showDownloadViewportModal',
|
||||
evaluate: [
|
||||
'evaluate.action',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video', 'wholeSlide'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Layout',
|
||||
uiType: 'ohif.layoutSelector',
|
||||
props: {
|
||||
rows: 3,
|
||||
columns: 4,
|
||||
evaluate: 'evaluate.action',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Crosshairs',
|
||||
uiType: 'ohif.toolButton',
|
||||
props: {
|
||||
type: 'tool',
|
||||
icon: 'tool-crosshair',
|
||||
label: 'Crosshairs',
|
||||
commands: {
|
||||
commandName: 'setToolActiveToolbar',
|
||||
commandOptions: {
|
||||
toolGroupIds: ['mpr'],
|
||||
},
|
||||
},
|
||||
evaluate: {
|
||||
name: 'evaluate.cornerstoneTool',
|
||||
disabledText: 'Select an MPR viewport to enable this tool',
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// id: 'Undo',
|
||||
// uiType: 'ohif.toolButton',
|
||||
// props: {
|
||||
// type: 'tool',
|
||||
// icon: 'prev-arrow',
|
||||
// label: 'Undo',
|
||||
// commands: {
|
||||
// commandName: 'undo',
|
||||
// },
|
||||
// evaluate: 'evaluate.action',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// id: 'Redo',
|
||||
// uiType: 'ohif.toolButton',
|
||||
// props: {
|
||||
// type: 'tool',
|
||||
// icon: 'next-arrow',
|
||||
// label: 'Redo',
|
||||
// commands: {
|
||||
// commandName: 'redo',
|
||||
// },
|
||||
// evaluate: 'evaluate.action',
|
||||
// },
|
||||
// },
|
||||
];
|
||||
|
||||
export default toolbarButtons;
|
||||
Reference in new issue
Block a user