@ohif/extension-cornerstone 3.14.0-beta.97 → 3.14.0-beta.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/915.ohif-extension-cornerstone.umd.js +1 -1
- package/dist/ohif-extension-cornerstone.umd.js +1 -5
- package/package.json +18 -8
- package/src/Viewport/OHIFCornerstoneViewport.css +46 -0
- package/src/Viewport/OHIFCornerstoneViewport.tsx +502 -0
- package/src/Viewport/Overlays/CornerstoneOverlays.tsx +103 -0
- package/src/Viewport/Overlays/CustomizableViewportOverlay.css +25 -0
- package/src/Viewport/Overlays/CustomizableViewportOverlay.tsx +469 -0
- package/src/Viewport/Overlays/ViewportImageScrollbar.tsx +106 -0
- package/src/Viewport/Overlays/ViewportImageSliceLoadingIndicator.tsx +87 -0
- package/src/Viewport/Overlays/ViewportOrientationMarkers.css +41 -0
- package/src/Viewport/Overlays/ViewportOrientationMarkers.tsx +136 -0
- package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/ViewportSliceProgressScrollbar.tsx +195 -0
- package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/helpers.ts +46 -0
- package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/hooks.ts +383 -0
- package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/index.ts +1 -0
- package/src/Viewport/Overlays/ViewportSliceProgressScrollbar/types.ts +17 -0
- package/src/Viewport/Overlays/utils.ts +66 -0
- package/src/commandsModule.ts +2951 -0
- package/src/components/AccordionGroup/AccordionGroup.tsx +195 -0
- package/src/components/AccordionGroup/index.ts +4 -0
- package/src/components/ActiveViewportWindowLevel/ActiveViewportWindowLevel.tsx +23 -0
- package/src/components/ActiveViewportWindowLevel/index.js +1 -0
- package/src/components/AdvancedRenderingControls/AdvancedRenderingControls.tsx +149 -0
- package/src/components/AdvancedRenderingControls/index.ts +1 -0
- package/src/components/CinePlayer/CinePlayer.tsx +247 -0
- package/src/components/CinePlayer/index.ts +3 -0
- package/src/components/DicomUpload/DicomUpload.tsx +111 -0
- package/src/components/DicomUpload/DicomUploadProgress.tsx +396 -0
- package/src/components/DicomUpload/DicomUploadProgressItem.tsx +119 -0
- package/src/components/ExportSegmentationSubMenuItem.tsx +75 -0
- package/src/components/MeasurementItems.tsx +70 -0
- package/src/components/MeasurementTableNested.tsx +30 -0
- package/src/components/MeasurementsMenu.tsx +84 -0
- package/src/components/MeasurementsOrAdditionalFindings.tsx +82 -0
- package/src/components/ModalityLoadBadge/ModalityLoadBadge.tsx +171 -0
- package/src/components/ModalityLoadBadge/index.ts +1 -0
- package/src/components/NavigationComponent/NavigationComponent.tsx +138 -0
- package/src/components/NavigationComponent/index.ts +3 -0
- package/src/components/OHIFViewportActionCorners.tsx +94 -0
- package/src/components/OpacityMenu/OpacityMenu.tsx +54 -0
- package/src/components/OpacityMenu/OpacityMenuWrapper.tsx +85 -0
- package/src/components/OpacityMenu/index.ts +2 -0
- package/src/components/PanelAccordionTrigger.tsx +48 -0
- package/src/components/SegmentationToolConfig.tsx +71 -0
- package/src/components/SegmentationUtilityButton.tsx +61 -0
- package/src/components/SelectItemWithModality.tsx +29 -0
- package/src/components/SeriesMeasurements.tsx +90 -0
- package/src/components/SeriesSummaryFromDisplaySet.tsx +21 -0
- package/src/components/StudyMeasurements.tsx +88 -0
- package/src/components/StudyMeasurementsActions.tsx +75 -0
- package/src/components/StudySummaryFromMetadata.test.ts +47 -0
- package/src/components/StudySummaryFromMetadata.tsx +31 -0
- package/src/components/StudySummaryWithActions.tsx +14 -0
- package/src/components/ThresholdMenu/ThresholdMenu.tsx +104 -0
- package/src/components/ThresholdMenu/ThresholdMenuWrapper.tsx +85 -0
- package/src/components/ThresholdMenu/index.ts +2 -0
- package/src/components/TrackingStatus/TrackingStatus.tsx +32 -0
- package/src/components/TrackingStatus/index.ts +1 -0
- package/src/components/VOIManualControlMenu/VOIManualControlMenu.tsx +190 -0
- package/src/components/VOIManualControlMenu/VOIManualControlMenuWrapper.tsx +85 -0
- package/src/components/VOIManualControlMenu/index.ts +2 -0
- package/src/components/ViewportColorbar/ViewportColorbar.tsx +150 -0
- package/src/components/ViewportColorbar/ViewportColorbarsContainer.tsx +125 -0
- package/src/components/ViewportColorbar/index.ts +5 -0
- package/src/components/ViewportDataOverlaySettingMenu/ViewportDataOverlayMenu.tsx +538 -0
- package/src/components/ViewportDataOverlaySettingMenu/ViewportDataOverlayMenuWrapper.tsx +91 -0
- package/src/components/ViewportDataOverlaySettingMenu/utils.ts +118 -0
- package/src/components/ViewportOrientationMenu/ViewportOrientationMenu.tsx +249 -0
- package/src/components/ViewportOrientationMenu/ViewportOrientationMenuWrapper.tsx +29 -0
- package/src/components/ViewportWindowLevel/ViewportWindowLevel.tsx +261 -0
- package/src/components/ViewportWindowLevel/getViewportVolumeHistogram.ts +72 -0
- package/src/components/ViewportWindowLevel/histogramWorker.js +97 -0
- package/src/components/ViewportWindowLevel/index.js +1 -0
- package/src/components/ViewportWindowLevel/utils.ts +176 -0
- package/src/components/WindowLevelActionMenu/Colorbar.tsx +30 -0
- package/src/components/WindowLevelActionMenu/Colormap.tsx +121 -0
- package/src/components/WindowLevelActionMenu/VolumeLighting.tsx +82 -0
- package/src/components/WindowLevelActionMenu/VolumeRenderingOptions.tsx +38 -0
- package/src/components/WindowLevelActionMenu/VolumeRenderingPresets.tsx +36 -0
- package/src/components/WindowLevelActionMenu/VolumeRenderingPresetsContent.tsx +78 -0
- package/src/components/WindowLevelActionMenu/VolumeRenderingQuality.tsx +64 -0
- package/src/components/WindowLevelActionMenu/VolumeShade.tsx +47 -0
- package/src/components/WindowLevelActionMenu/VolumeShift.tsx +92 -0
- package/src/components/WindowLevelActionMenu/WindowLevel.tsx +157 -0
- package/src/components/WindowLevelActionMenu/WindowLevelActionMenu.tsx +102 -0
- package/src/components/WindowLevelActionMenu/WindowLevelActionMenuWrapper.tsx +131 -0
- package/src/components/WindowLevelActionMenu/defaultWindowLevelPresets.ts +23 -0
- package/src/components/WindowLevelActionMenu/index.ts +11 -0
- package/src/components/WindowLevelActionMenu/windowLevelPresetHotkeys.test.ts +19 -0
- package/src/components/index.ts +12 -0
- package/src/constants/index.ts +13 -0
- package/src/customizations/CustomDropdownMenuContent.tsx +106 -0
- package/src/customizations/CustomSegmentStatisticsHeader.tsx +140 -0
- package/src/customizations/captureViewportModalCustomization.tsx +175 -0
- package/src/customizations/colorbarCustomization.ts +93 -0
- package/src/customizations/gpuSettingsPresetCustomization.ts +8 -0
- package/src/customizations/layoutSelectorCustomization.ts +104 -0
- package/src/customizations/measurementsCustomization.ts +124 -0
- package/src/customizations/miscCustomization.ts +22 -0
- package/src/customizations/modalityColorMapCustomization.ts +23 -0
- package/src/customizations/segmentationHydrationCustomization.ts +16 -0
- package/src/customizations/segmentationPanelCustomization.tsx +119 -0
- package/src/customizations/segmentationToolbarCustomization.ts +964 -0
- package/src/customizations/toolGroupToolsCustomization.ts +204 -0
- package/src/customizations/toolbarButtonsCustomization.ts +805 -0
- package/src/customizations/viewportClickCommandsCustomization.ts +15 -0
- package/src/customizations/viewportDownloadWarningCustomization.tsx +6 -0
- package/src/customizations/viewportOverlayCustomization.tsx +46 -0
- package/src/customizations/viewportScrollbarCustomization.tsx +27 -0
- package/src/customizations/viewportToolsCustomization.ts +33 -0
- package/src/customizations/volumeRenderingCustomization.ts +14 -0
- package/src/customizations/windowLevelPresetsCustomization.ts +5 -0
- package/src/enums.ts +9 -0
- package/src/getCustomizationModule.tsx +54 -0
- package/src/getHangingProtocolModule.ts +47 -0
- package/src/getPanelModule.tsx +128 -0
- package/src/getSopClassHandlerModule.js +284 -0
- package/src/getToolbarModule.tsx +622 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/useActiveViewportSegmentationRepresentations.ts +14 -0
- package/src/hooks/useMeasurementTracking.ts +132 -0
- package/src/hooks/useMeasurements.ts +104 -0
- package/src/hooks/useSegmentations.ts +147 -0
- package/src/hooks/useViewportDisplaySets.ts +284 -0
- package/src/hooks/useViewportHover.ts +77 -0
- package/src/hooks/useViewportRendering.tsx +868 -0
- package/src/hooks/useViewportSegmentations.ts +245 -0
- package/src/hps/fourUp.ts +117 -0
- package/src/hps/frameView.ts +1581 -0
- package/src/hps/main3D.ts +142 -0
- package/src/hps/mpr.ts +197 -0
- package/src/hps/mprAnd3DVolumeViewport.ts +124 -0
- package/src/hps/only3D.ts +70 -0
- package/src/hps/primary3D.ts +142 -0
- package/src/hps/primaryAxial.ts +114 -0
- package/src/id.js +5 -0
- package/src/index.tsx +350 -0
- package/src/init.tsx +445 -0
- package/src/initCineService.ts +75 -0
- package/src/initContextMenu.ts +94 -0
- package/src/initCornerstoneTools.js +188 -0
- package/src/initDoubleClick.ts +82 -0
- package/src/initMeasurementService.ts +576 -0
- package/src/initStudyPrefetcherService.ts +33 -0
- package/src/initWADOImageLoader.js +56 -0
- package/src/panels/PanelMeasurement.tsx +84 -0
- package/src/panels/PanelSegmentation.tsx +338 -0
- package/src/services/ColorbarService/ColorbarService.ts +242 -0
- package/src/services/ColorbarService/index.ts +2 -0
- package/src/services/CornerstoneCacheService/CornerstoneCacheService.ts +326 -0
- package/src/services/CornerstoneCacheService/index.js +3 -0
- package/src/services/SegmentationService/RTSTRUCT/mapROIContoursToRTStructData.ts +36 -0
- package/src/services/SegmentationService/SegmentationService.test.ts +3698 -0
- package/src/services/SegmentationService/SegmentationService.ts +2376 -0
- package/src/services/SegmentationService/backends/ISegmentationBackend.ts +102 -0
- package/src/services/SegmentationService/backends/ISegmentationServiceInternals.ts +44 -0
- package/src/services/SegmentationService/backends/LegacySegmentationBackend.ts +139 -0
- package/src/services/SegmentationService/backends/NextSegmentationBackend.ts +159 -0
- package/src/services/SegmentationService/backends/index.ts +4 -0
- package/src/services/SegmentationService/index.ts +3 -0
- package/src/services/SyncGroupService/SyncGroupService.ts +264 -0
- package/src/services/SyncGroupService/createHydrateSegmentationSynchronizer.ts +118 -0
- package/src/services/SyncGroupService/index.js +3 -0
- package/src/services/ToolGroupService/ToolGroupService.test.ts +83 -0
- package/src/services/ToolGroupService/ToolGroupService.ts +541 -0
- package/src/services/ToolGroupService/index.js +3 -0
- package/src/services/ViewedDataService/ViewedDataService.ts +58 -0
- package/src/services/ViewedDataService/index.ts +3 -0
- package/src/services/ViewportService/CornerstoneViewportService.ts +1814 -0
- package/src/services/ViewportService/IViewportService.ts +64 -0
- package/src/services/ViewportService/Viewport.ts +372 -0
- package/src/services/ViewportService/adapter/IViewportAdapter.contract.test.ts +467 -0
- package/src/services/ViewportService/adapter/IViewportAdapter.ts +179 -0
- package/src/services/ViewportService/adapter/LegacyViewportAdapter.ts +240 -0
- package/src/services/ViewportService/adapter/NextViewportAdapter.ts +241 -0
- package/src/services/ViewportService/adapter/getViewportAdapter.ts +62 -0
- package/src/services/ViewportService/adapter/index.ts +16 -0
- package/src/services/ViewportService/backends/IViewportBackend.ts +195 -0
- package/src/services/ViewportService/backends/IViewportOperations.ts +98 -0
- package/src/services/ViewportService/backends/IViewportServiceInternals.ts +47 -0
- package/src/services/ViewportService/backends/LegacyViewportBackend.ts +264 -0
- package/src/services/ViewportService/backends/LegacyViewportOperations.ts +272 -0
- package/src/services/ViewportService/backends/NextViewportBackend.ts +671 -0
- package/src/services/ViewportService/backends/NextViewportOperations.ts +169 -0
- package/src/services/ViewportService/backends/README.md +62 -0
- package/src/services/ViewportService/backends/dataIdRegistry.ts +121 -0
- package/src/services/ViewportService/backends/viewportOperations.ts +71 -0
- package/src/services/ViewportService/constants.ts +3 -0
- package/src/state.ts +34 -0
- package/src/stores/index.ts +5 -0
- package/src/stores/presentationUtils.ts +42 -0
- package/src/stores/useLutPresentationStore.ts +166 -0
- package/src/stores/usePositionPresentationStore.ts +172 -0
- package/src/stores/useSegmentationPresentationStore.test.ts +146 -0
- package/src/stores/useSegmentationPresentationStore.ts +417 -0
- package/src/stores/useSelectedSegmentationsForViewportStore.ts +85 -0
- package/src/stores/useSynchronizersStore.ts +84 -0
- package/src/synchronizers/frameViewSynchronizer.ts +52 -0
- package/src/tools/CalibrationLineTool.ts +97 -0
- package/src/tools/ImageOverlayViewerTool.tsx +279 -0
- package/src/tools/OverlayPlaneModuleProvider.ts +40 -0
- package/src/tools/WindowLevelTool.test.ts +55 -0
- package/src/tools/WindowLevelTool.ts +22 -0
- package/src/types/AppTypes.ts +70 -0
- package/src/types/Colorbar.ts +114 -0
- package/src/types/Colormap.ts +16 -0
- package/src/types/CornerstoneCacheService.ts +40 -0
- package/src/types/CornerstoneServices.ts +18 -0
- package/src/types/Presentation.ts +83 -0
- package/src/types/SelectedSegmentationByTypeMap.ts +3 -0
- package/src/types/ViewportPresets.ts +53 -0
- package/src/types/VolumeLighting.ts +7 -0
- package/src/types/VolumeRenderingConfig.ts +8 -0
- package/src/types/WindowLevel.ts +5 -0
- package/src/types/index.ts +10 -0
- package/src/utils/ActiveViewportBehavior.tsx +80 -0
- package/src/utils/CornerstoneViewportDownloadForm.tsx +319 -0
- package/src/utils/DicomFileUploader.ts +204 -0
- package/src/utils/JumpPresets.ts +14 -0
- package/src/utils/autoHydrateViewportTypes.ts +69 -0
- package/src/utils/colormaps.js +1597 -0
- package/src/utils/createSegmentationForViewport.ts +83 -0
- package/src/utils/dicomLoaderService.js +225 -0
- package/src/utils/ecgMetadata.test.ts +137 -0
- package/src/utils/ecgMetadata.ts +109 -0
- package/src/utils/findNearbyToolData.test.ts +125 -0
- package/src/utils/findNearbyToolData.ts +21 -0
- package/src/utils/generateSegmentationCSVReport.test.ts +324 -0
- package/src/utils/generateSegmentationCSVReport.ts +131 -0
- package/src/utils/getActiveViewportEnabledElement.test.ts +70 -0
- package/src/utils/getActiveViewportEnabledElement.ts +8 -0
- package/src/utils/getCenterExtent.test.ts +313 -0
- package/src/utils/getCenterExtent.ts +46 -0
- package/src/utils/getCornerstoneBlendMode.test.ts +59 -0
- package/src/utils/getCornerstoneBlendMode.ts +25 -0
- package/src/utils/getCornerstoneOrientation.test.ts +78 -0
- package/src/utils/getCornerstoneOrientation.ts +31 -0
- package/src/utils/getCornerstoneViewportType.test.ts +169 -0
- package/src/utils/getCornerstoneViewportType.ts +88 -0
- package/src/utils/getInterleavedFrames.test.ts +85 -0
- package/src/utils/getInterleavedFrames.ts +73 -0
- package/src/utils/getLegacyViewportType.ts +64 -0
- package/src/utils/getNthFrames.test.ts +145 -0
- package/src/utils/getNthFrames.ts +31 -0
- package/src/utils/getViewportEnabledElement.test.ts +83 -0
- package/src/utils/getViewportEnabledElement.ts +8 -0
- package/src/utils/getViewportOrientationFromImageOrientationPatient.test.ts +50 -0
- package/src/utils/getViewportOrientationFromImageOrientationPatient.ts +56 -0
- package/src/utils/hydrationUtils.test.ts +572 -0
- package/src/utils/hydrationUtils.ts +197 -0
- package/src/utils/imageSliceSync/calculateViewportRegistrations.ts +28 -0
- package/src/utils/imageSliceSync/toggleImageSliceSync.ts +101 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/initGpuSettingsPreset.ts +51 -0
- package/src/utils/initViewTiming.test.ts +342 -0
- package/src/utils/initViewTiming.ts +52 -0
- package/src/utils/initWebWorkerProgressHandler.test.ts +381 -0
- package/src/utils/initWebWorkerProgressHandler.ts +110 -0
- package/src/utils/interleave.test.ts +304 -0
- package/src/utils/interleave.ts +32 -0
- package/src/utils/interleaveCenterLoader.test.ts +547 -0
- package/src/utils/interleaveCenterLoader.ts +143 -0
- package/src/utils/interleaveTopToBottom.test.ts +487 -0
- package/src/utils/interleaveTopToBottom.ts +132 -0
- package/src/utils/isAnyDisplaySetCommon.ts +18 -0
- package/src/utils/isDisplaySetOverlayable.ts +96 -0
- package/src/utils/isMeasurementWithinViewport.test.ts +340 -0
- package/src/utils/isMeasurementWithinViewport.ts +33 -0
- package/src/utils/isReferenceViewable.test.ts +581 -0
- package/src/utils/isReferenceViewable.ts +95 -0
- package/src/utils/loadDisplaySetData.ts +49 -0
- package/src/utils/measurementServiceMappings/Angle.ts +200 -0
- package/src/utils/measurementServiceMappings/ArrowAnnotate.ts +176 -0
- package/src/utils/measurementServiceMappings/Bidirectional.ts +193 -0
- package/src/utils/measurementServiceMappings/CircleROI.ts +227 -0
- package/src/utils/measurementServiceMappings/CobbAngle.ts +206 -0
- package/src/utils/measurementServiceMappings/EllipticalROI.ts +221 -0
- package/src/utils/measurementServiceMappings/Length.ts +206 -0
- package/src/utils/measurementServiceMappings/LivewireContour.ts +175 -0
- package/src/utils/measurementServiceMappings/PlanarFreehandROI.ts +228 -0
- package/src/utils/measurementServiceMappings/Probe.ts +192 -0
- package/src/utils/measurementServiceMappings/RectangleROI.ts +225 -0
- package/src/utils/measurementServiceMappings/SegmentBidirectional.ts +184 -0
- package/src/utils/measurementServiceMappings/SplineROI.ts +227 -0
- package/src/utils/measurementServiceMappings/UltrasoundDirectional.ts +214 -0
- package/src/utils/measurementServiceMappings/UltrasoundPleuraBLine.ts +179 -0
- package/src/utils/measurementServiceMappings/constants/supportedTools.js +21 -0
- package/src/utils/measurementServiceMappings/index.ts +3 -0
- package/src/utils/measurementServiceMappings/measurementServiceMappingsFactory.ts +324 -0
- package/src/utils/measurementServiceMappings/utils/getDisplayUnit.js +3 -0
- package/src/utils/measurementServiceMappings/utils/getHandlesFromPoints.js +14 -0
- package/src/utils/measurementServiceMappings/utils/getIsLocked.ts +5 -0
- package/src/utils/measurementServiceMappings/utils/getIsVisible.ts +6 -0
- package/src/utils/measurementServiceMappings/utils/getSOPInstanceAttributes.js +66 -0
- package/src/utils/measurementServiceMappings/utils/getValueDisplayString.js +12 -0
- package/src/utils/measurementServiceMappings/utils/index.ts +17 -0
- package/src/utils/measurementServiceMappings/utils/selection.ts +33 -0
- package/src/utils/mpr/getProtocolViewportStructureFromGridViewports.ts +74 -0
- package/src/utils/nextViewportPolicies.ts +41 -0
- package/src/utils/nextViewports.ts +157 -0
- package/src/utils/nthLoader.test.ts +317 -0
- package/src/utils/nthLoader.ts +78 -0
- package/src/utils/presentations/getViewportPresentations.test.ts +280 -0
- package/src/utils/presentations/getViewportPresentations.ts +151 -0
- package/src/utils/promptHydrationDialog.test.ts +490 -0
- package/src/utils/promptHydrationDialog.ts +197 -0
- package/src/utils/removeViewportSegmentationRepresentations.test.ts +129 -0
- package/src/utils/removeViewportSegmentationRepresentations.ts +17 -0
- package/src/utils/segmentUtils.test.ts +515 -0
- package/src/utils/segmentUtils.ts +46 -0
- package/src/utils/segmentationExportUtils.test.ts +100 -0
- package/src/utils/segmentationExportUtils.ts +171 -0
- package/src/utils/segmentationHandlers.test.ts +614 -0
- package/src/utils/segmentationHandlers.ts +164 -0
- package/src/utils/setUpAnnotationEventHandlers.ts +26 -0
- package/src/utils/setUpSegmentationEventHandlers.test.ts +372 -0
- package/src/utils/setUpSegmentationEventHandlers.ts +122 -0
- package/src/utils/toggleVOISliceSync.test.ts +606 -0
- package/src/utils/toggleVOISliceSync.ts +103 -0
- package/src/utils/transitions.test.ts +351 -0
- package/src/utils/transitions.ts +300 -0
- package/src/utils/updateSegmentationStats.test.ts +942 -0
- package/src/utils/updateSegmentationStats.ts +192 -0
- package/src/utils/viewportDataShape.ts +85 -0
|
@@ -0,0 +1,964 @@
|
|
|
1
|
+
import type { Button } from '@ohif/core/types';
|
|
2
|
+
import { ViewportGridService, ToolbarService } from '@ohif/core';
|
|
3
|
+
import i18n from 'i18next';
|
|
4
|
+
|
|
5
|
+
const { TOOLBAR_SECTIONS } = ToolbarService;
|
|
6
|
+
|
|
7
|
+
export const MIN_SEGMENTATION_DRAWING_RADIUS = 0.5;
|
|
8
|
+
export const MAX_SEGMENTATION_DRAWING_RADIUS = 99.5;
|
|
9
|
+
|
|
10
|
+
const setToolActiveToolbar = {
|
|
11
|
+
commandName: 'setToolActiveToolbar',
|
|
12
|
+
commandOptions: {
|
|
13
|
+
toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const callbacks = (toolName: string) => [
|
|
18
|
+
{
|
|
19
|
+
commandName: 'setViewportForToolConfiguration',
|
|
20
|
+
commandOptions: {
|
|
21
|
+
toolName,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Segmentation editing toolbar buttons: the toolbox section containers plus
|
|
28
|
+
* the labelmap / contour editing tools and utilities. These complement the
|
|
29
|
+
* general buttons in `cornerstone.toolbarButtons`; together they are the
|
|
30
|
+
* default button set for the segmentation mode, and modes such as basic /
|
|
31
|
+
* longitudinal can pull them in via a customization (see
|
|
32
|
+
* `segmentationEditing.jsonc`).
|
|
33
|
+
*/
|
|
34
|
+
const segmentationToolbarButtons: Button[] = [
|
|
35
|
+
// section containers for the nested toolboxes and toolbars
|
|
36
|
+
{
|
|
37
|
+
id: 'BrushTools',
|
|
38
|
+
uiType: 'ohif.toolBoxButtonGroup',
|
|
39
|
+
props: {
|
|
40
|
+
buttonSection: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'LabelMapUtilities',
|
|
45
|
+
uiType: 'ohif.Toolbar',
|
|
46
|
+
props: {
|
|
47
|
+
buttonSection: true,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'ContourUtilities',
|
|
52
|
+
uiType: 'ohif.Toolbar',
|
|
53
|
+
props: {
|
|
54
|
+
buttonSection: true,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'LabelMapTools',
|
|
59
|
+
uiType: 'ohif.toolBoxButtonGroup',
|
|
60
|
+
props: {
|
|
61
|
+
buttonSection: true,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: 'ContourTools',
|
|
66
|
+
uiType: 'ohif.toolBoxButtonGroup',
|
|
67
|
+
props: {
|
|
68
|
+
buttonSection: true,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
// tool defs
|
|
72
|
+
{
|
|
73
|
+
id: 'PlanarFreehandContourSegmentationTool',
|
|
74
|
+
uiType: 'ohif.toolBoxButton',
|
|
75
|
+
props: {
|
|
76
|
+
icon: 'icon-tool-freehand-roi',
|
|
77
|
+
label: i18n.t('Buttons:Freehand Segmentation'),
|
|
78
|
+
tooltip: i18n.t('Buttons:Freehand Segmentation'),
|
|
79
|
+
evaluate: [
|
|
80
|
+
{
|
|
81
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
82
|
+
toolNames: ['PlanarFreehandContourSegmentationTool'],
|
|
83
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
87
|
+
segmentationRepresentationType: 'Contour',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
commands: [
|
|
91
|
+
{
|
|
92
|
+
commandName: 'setToolActiveToolbar',
|
|
93
|
+
commandOptions: {
|
|
94
|
+
bindings: [
|
|
95
|
+
{
|
|
96
|
+
mouseButton: 1, // Left Click
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
mouseButton: 1, // Left Click+Shift to create a hole
|
|
100
|
+
modifierKey: 16, // Shift
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
107
|
+
commandOptions: {
|
|
108
|
+
segmentationRepresentationType: 'Contour',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
options: [
|
|
113
|
+
{
|
|
114
|
+
name: i18n.t('Buttons:Interpolate Contours'),
|
|
115
|
+
type: 'switch',
|
|
116
|
+
id: 'planarFreehandInterpolateContours',
|
|
117
|
+
value: false,
|
|
118
|
+
commands: {
|
|
119
|
+
commandName: 'setInterpolationToolConfiguration',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: 'LivewireContourSegmentationTool',
|
|
127
|
+
uiType: 'ohif.toolBoxButton',
|
|
128
|
+
props: {
|
|
129
|
+
icon: 'icon-tool-livewire',
|
|
130
|
+
label: i18n.t('Buttons:Livewire Contour'),
|
|
131
|
+
tooltip: i18n.t('Buttons:Livewire Contour'),
|
|
132
|
+
evaluate: [
|
|
133
|
+
{
|
|
134
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
135
|
+
toolNames: ['LivewireContourSegmentationTool'],
|
|
136
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
140
|
+
segmentationRepresentationType: 'Contour',
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
commands: [
|
|
144
|
+
{
|
|
145
|
+
commandName: 'setToolActiveToolbar',
|
|
146
|
+
commandOptions: {
|
|
147
|
+
bindings: [
|
|
148
|
+
{
|
|
149
|
+
mouseButton: 1, // Left Click
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
mouseButton: 1, // Left Click+Shift to create a hole
|
|
153
|
+
modifierKey: 16, // Shift
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
160
|
+
commandOptions: {
|
|
161
|
+
segmentationRepresentationType: 'Contour',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
options: [
|
|
166
|
+
{
|
|
167
|
+
name: i18n.t('Buttons:Interpolate Contours'),
|
|
168
|
+
type: 'switch',
|
|
169
|
+
id: 'livewireInterpolateContours',
|
|
170
|
+
value: false,
|
|
171
|
+
commands: {
|
|
172
|
+
commandName: 'setInterpolationToolConfiguration',
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 'SplineContourSegmentationTool',
|
|
180
|
+
uiType: 'ohif.toolBoxButton',
|
|
181
|
+
props: {
|
|
182
|
+
icon: 'icon-tool-spline-roi',
|
|
183
|
+
label: i18n.t('Buttons:Spline Contour Segmentation Tool'),
|
|
184
|
+
tooltip: i18n.t('Buttons:Spline Contour Segmentation Tool'),
|
|
185
|
+
evaluate: [
|
|
186
|
+
{
|
|
187
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
188
|
+
toolNames: ['CatmullRomSplineROI', 'LinearSplineROI', 'BSplineROI'],
|
|
189
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
193
|
+
segmentationRepresentationType: 'Contour',
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
commands: [
|
|
197
|
+
{
|
|
198
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
199
|
+
commandOptions: {
|
|
200
|
+
segmentationRepresentationType: 'Contour',
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
],
|
|
204
|
+
options: [
|
|
205
|
+
{
|
|
206
|
+
name: i18n.t('Buttons:Spline Type'),
|
|
207
|
+
type: 'select',
|
|
208
|
+
id: 'splineTypeSelect',
|
|
209
|
+
value: 'CatmullRomSplineROI',
|
|
210
|
+
values: [
|
|
211
|
+
{
|
|
212
|
+
id: 'CatmullRomSplineROI',
|
|
213
|
+
value: 'CatmullRomSplineROI',
|
|
214
|
+
label: i18n.t('Buttons:Catmull Rom Spline'),
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: 'LinearSplineROI',
|
|
218
|
+
value: 'LinearSplineROI',
|
|
219
|
+
label: i18n.t('Buttons:Linear Spline'),
|
|
220
|
+
},
|
|
221
|
+
{ id: 'BSplineROI', value: 'BSplineROI', label: i18n.t('Buttons:B-Spline') },
|
|
222
|
+
],
|
|
223
|
+
commands: {
|
|
224
|
+
commandName: 'setToolActiveToolbar',
|
|
225
|
+
commandOptions: {
|
|
226
|
+
bindings: [
|
|
227
|
+
{
|
|
228
|
+
mouseButton: 1, // Left Click
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
mouseButton: 1, // Left Click+Shift to create a hole
|
|
232
|
+
modifierKey: 16, // Shift
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: i18n.t('Buttons:Simplified Spline'),
|
|
240
|
+
type: 'switch',
|
|
241
|
+
id: 'simplifiedSpline',
|
|
242
|
+
value: true,
|
|
243
|
+
commands: {
|
|
244
|
+
commandName: 'setSimplifiedSplineForSplineContourSegmentationTool',
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: i18n.t('Buttons:Interpolate Contours'),
|
|
249
|
+
type: 'switch',
|
|
250
|
+
id: 'splineInterpolateContours',
|
|
251
|
+
value: false,
|
|
252
|
+
commands: {
|
|
253
|
+
commandName: 'setInterpolationToolConfiguration',
|
|
254
|
+
commandOptions: {
|
|
255
|
+
toolNames: ['CatmullRomSplineROI', 'LinearSplineROI', 'BSplineROI'],
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
],
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: 'SculptorTool',
|
|
264
|
+
uiType: 'ohif.toolBoxButton',
|
|
265
|
+
props: {
|
|
266
|
+
icon: 'icon-tool-sculptor',
|
|
267
|
+
label: i18n.t('Buttons:Sculptor Tool'),
|
|
268
|
+
tooltip: i18n.t('Buttons:Sculptor Tool'),
|
|
269
|
+
evaluate: [
|
|
270
|
+
{
|
|
271
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
272
|
+
toolNames: ['SculptorTool'],
|
|
273
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
277
|
+
segmentationRepresentationType: 'Contour',
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
commands: [
|
|
281
|
+
'setToolActiveToolbar',
|
|
282
|
+
{
|
|
283
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
284
|
+
commandOptions: {
|
|
285
|
+
segmentationRepresentationType: 'Contour',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
options: [
|
|
290
|
+
{
|
|
291
|
+
name: i18n.t('Buttons:Dynamic Cursor Size'),
|
|
292
|
+
type: 'switch',
|
|
293
|
+
id: 'dynamicCursorSize',
|
|
294
|
+
value: true,
|
|
295
|
+
commands: {
|
|
296
|
+
commandName: 'setDynamicCursorSizeForSculptorTool',
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
id: 'Brush',
|
|
304
|
+
uiType: 'ohif.toolBoxButton',
|
|
305
|
+
props: {
|
|
306
|
+
icon: 'icon-tool-brush',
|
|
307
|
+
label: i18n.t('Buttons:Brush'),
|
|
308
|
+
evaluate: [
|
|
309
|
+
{
|
|
310
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
311
|
+
toolNames: ['CircularBrush', 'SphereBrush'],
|
|
312
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
|
|
316
|
+
radiusOptionId: 'brush-radius',
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
320
|
+
segmentationRepresentationType: 'Labelmap',
|
|
321
|
+
},
|
|
322
|
+
],
|
|
323
|
+
commands: {
|
|
324
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
325
|
+
commandOptions: {
|
|
326
|
+
segmentationRepresentationType: 'Labelmap',
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
options: [
|
|
330
|
+
{
|
|
331
|
+
name: i18n.t('Buttons:Radius (mm)'),
|
|
332
|
+
id: 'brush-radius',
|
|
333
|
+
type: 'range',
|
|
334
|
+
explicitRunOnly: true,
|
|
335
|
+
min: MIN_SEGMENTATION_DRAWING_RADIUS,
|
|
336
|
+
max: MAX_SEGMENTATION_DRAWING_RADIUS,
|
|
337
|
+
step: 0.5,
|
|
338
|
+
value: 25,
|
|
339
|
+
commands: [
|
|
340
|
+
{
|
|
341
|
+
commandName: 'setBrushSize',
|
|
342
|
+
commandOptions: { toolNames: ['CircularBrush', 'SphereBrush'] },
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: i18n.t('Buttons:Shape'),
|
|
348
|
+
type: 'radio',
|
|
349
|
+
id: 'brush-mode',
|
|
350
|
+
value: 'CircularBrush',
|
|
351
|
+
values: [
|
|
352
|
+
{ value: 'CircularBrush', label: i18n.t('Buttons:Circle') },
|
|
353
|
+
{ value: 'SphereBrush', label: i18n.t('Buttons:Sphere') },
|
|
354
|
+
],
|
|
355
|
+
commands: ['setToolActiveToolbar'],
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
id: 'InterpolateLabelmap',
|
|
362
|
+
uiType: 'ohif.toolButton',
|
|
363
|
+
props: {
|
|
364
|
+
icon: 'actions-interpolate',
|
|
365
|
+
label: i18n.t('Buttons:Interpolate Labelmap'),
|
|
366
|
+
tooltip: i18n.t(
|
|
367
|
+
'Buttons:Automatically fill in missing slices between drawn segments. Use brush or threshold tools on at least two slices, then click to interpolate across slices. Works in any direction. Volume must be reconstructable.'
|
|
368
|
+
),
|
|
369
|
+
evaluate: [
|
|
370
|
+
{
|
|
371
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
375
|
+
segmentationRepresentationType: 'Labelmap',
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: 'evaluate.displaySetIsReconstructable',
|
|
379
|
+
disabledText: i18n.t('Buttons:The current viewport cannot handle interpolation.'),
|
|
380
|
+
},
|
|
381
|
+
],
|
|
382
|
+
commands: [
|
|
383
|
+
{
|
|
384
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
385
|
+
commandOptions: {
|
|
386
|
+
segmentationRepresentationType: 'Labelmap',
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
'interpolateLabelmap',
|
|
390
|
+
],
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
id: 'SegmentBidirectional',
|
|
395
|
+
uiType: 'ohif.toolButton',
|
|
396
|
+
props: {
|
|
397
|
+
icon: 'actions-bidirectional',
|
|
398
|
+
label: i18n.t('Buttons:Segment Bidirectional'),
|
|
399
|
+
tooltip: i18n.t(
|
|
400
|
+
'Buttons:Automatically detects the largest length and width across slices for the selected segment and displays a bidirectional measurement.'
|
|
401
|
+
),
|
|
402
|
+
evaluate: [
|
|
403
|
+
{
|
|
404
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
405
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
409
|
+
segmentationRepresentationType: 'Labelmap',
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
commands: [
|
|
413
|
+
{
|
|
414
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
415
|
+
commandOptions: {
|
|
416
|
+
segmentationRepresentationType: 'Labelmap',
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
'runSegmentBidirectional',
|
|
420
|
+
],
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
id: 'ClickSegment',
|
|
425
|
+
uiType: 'ohif.toolBoxButton',
|
|
426
|
+
props: {
|
|
427
|
+
icon: 'icon-tool-click-segment',
|
|
428
|
+
label: i18n.t('Buttons:Click to Segment'),
|
|
429
|
+
tooltip: i18n.t(
|
|
430
|
+
'Buttons:PET only. Click-to-segment lesions with no configuration. Hover for visual feedback—click when a plus sign appears to segment the lesion.'
|
|
431
|
+
),
|
|
432
|
+
evaluate: [
|
|
433
|
+
{
|
|
434
|
+
name: 'evaluate.modality.supported',
|
|
435
|
+
supportedModalities: ['PT'],
|
|
436
|
+
disabledText: i18n.t('Buttons:Tool not available for this modality'),
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
440
|
+
toolNames: ['ClickSegment'],
|
|
441
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable this tool.'),
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
445
|
+
segmentationRepresentationType: 'Labelmap',
|
|
446
|
+
},
|
|
447
|
+
],
|
|
448
|
+
commands: [
|
|
449
|
+
'setToolActiveToolbar',
|
|
450
|
+
{
|
|
451
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
452
|
+
commandOptions: {
|
|
453
|
+
segmentationRepresentationType: 'Labelmap',
|
|
454
|
+
},
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
id: 'LabelmapSlicePropagation',
|
|
461
|
+
uiType: 'ohif.toolBoxButton',
|
|
462
|
+
props: {
|
|
463
|
+
icon: 'icon-labelmap-slice-propagation',
|
|
464
|
+
label: i18n.t('Buttons:Labelmap Assist'),
|
|
465
|
+
tooltip: i18n.t(
|
|
466
|
+
'Buttons:Toggle AI assistance for segmenting nearby slices. After drawing on a slice, scroll to preview predictions. Press Enter to accept or Esc to skip.'
|
|
467
|
+
),
|
|
468
|
+
evaluate: [
|
|
469
|
+
'evaluate.cornerstoneTool.toggle',
|
|
470
|
+
{
|
|
471
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
472
|
+
segmentationRepresentationType: 'Labelmap',
|
|
473
|
+
},
|
|
474
|
+
],
|
|
475
|
+
listeners: {
|
|
476
|
+
[ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks(
|
|
477
|
+
'LabelmapSlicePropagation'
|
|
478
|
+
),
|
|
479
|
+
[ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('LabelmapSlicePropagation'),
|
|
480
|
+
},
|
|
481
|
+
commands: [
|
|
482
|
+
{
|
|
483
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
484
|
+
commandOptions: {
|
|
485
|
+
segmentationRepresentationType: 'Labelmap',
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
|
+
'toggleEnabledDisabledToolbar',
|
|
489
|
+
],
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
id: 'MarkerLabelmap',
|
|
494
|
+
uiType: 'ohif.toolBoxButton',
|
|
495
|
+
props: {
|
|
496
|
+
icon: 'icon-marker-labelmap',
|
|
497
|
+
label: i18n.t('Buttons:Marker Guided Labelmap'),
|
|
498
|
+
tooltip: i18n.t(
|
|
499
|
+
'Buttons:Use include/exclude markers to guide AI (SAM) segmentation. Click to place markers, Enter to accept results, Esc to reject, and N to go to the next slice while keeping markers.'
|
|
500
|
+
),
|
|
501
|
+
evaluate: [
|
|
502
|
+
{
|
|
503
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
504
|
+
toolNames: ['MarkerLabelmap', 'MarkerInclude', 'MarkerExclude'],
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
508
|
+
segmentationRepresentationType: 'Labelmap',
|
|
509
|
+
},
|
|
510
|
+
],
|
|
511
|
+
commands: [
|
|
512
|
+
'setToolActiveToolbar',
|
|
513
|
+
{
|
|
514
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
515
|
+
commandOptions: {
|
|
516
|
+
segmentationRepresentationType: 'Labelmap',
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
listeners: {
|
|
521
|
+
[ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: callbacks('MarkerLabelmap'),
|
|
522
|
+
[ViewportGridService.EVENTS.VIEWPORTS_READY]: callbacks('MarkerLabelmap'),
|
|
523
|
+
},
|
|
524
|
+
options: [
|
|
525
|
+
{
|
|
526
|
+
name: i18n.t('Buttons:Marker Mode'),
|
|
527
|
+
type: 'radio',
|
|
528
|
+
id: 'marker-mode',
|
|
529
|
+
value: 'markerInclude',
|
|
530
|
+
values: [
|
|
531
|
+
{ value: 'markerInclude', label: i18n.t('Buttons:Include') },
|
|
532
|
+
{ value: 'markerExclude', label: i18n.t('Buttons:Exclude') },
|
|
533
|
+
],
|
|
534
|
+
commands: ({ commandsManager, options }) => {
|
|
535
|
+
const markerModeOption = options.find(option => option.id === 'marker-mode');
|
|
536
|
+
if (markerModeOption.value === 'markerInclude') {
|
|
537
|
+
commandsManager.run('setToolActive', {
|
|
538
|
+
toolName: 'MarkerInclude',
|
|
539
|
+
});
|
|
540
|
+
} else {
|
|
541
|
+
commandsManager.run('setToolActive', {
|
|
542
|
+
toolName: 'MarkerExclude',
|
|
543
|
+
});
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
name: i18n.t('Buttons:Clear Markers'),
|
|
549
|
+
type: 'button',
|
|
550
|
+
id: 'clear-markers',
|
|
551
|
+
commands: 'clearMarkersForMarkerLabelmap',
|
|
552
|
+
},
|
|
553
|
+
],
|
|
554
|
+
},
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
id: 'Eraser',
|
|
558
|
+
uiType: 'ohif.toolBoxButton',
|
|
559
|
+
props: {
|
|
560
|
+
icon: 'icon-tool-eraser',
|
|
561
|
+
label: i18n.t('Buttons:Eraser'),
|
|
562
|
+
evaluate: [
|
|
563
|
+
{
|
|
564
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
565
|
+
toolNames: ['CircularEraser', 'SphereEraser'],
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
|
|
569
|
+
radiusOptionId: 'eraser-radius',
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
573
|
+
segmentationRepresentationType: 'Labelmap',
|
|
574
|
+
},
|
|
575
|
+
],
|
|
576
|
+
options: [
|
|
577
|
+
{
|
|
578
|
+
name: i18n.t('Buttons:Radius (mm)'),
|
|
579
|
+
id: 'eraser-radius',
|
|
580
|
+
type: 'range',
|
|
581
|
+
explicitRunOnly: true,
|
|
582
|
+
min: MIN_SEGMENTATION_DRAWING_RADIUS,
|
|
583
|
+
max: MAX_SEGMENTATION_DRAWING_RADIUS,
|
|
584
|
+
step: 0.5,
|
|
585
|
+
value: 25,
|
|
586
|
+
commands: {
|
|
587
|
+
commandName: 'setBrushSize',
|
|
588
|
+
commandOptions: { toolNames: ['CircularEraser', 'SphereEraser'] },
|
|
589
|
+
},
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: i18n.t('Buttons:Shape'),
|
|
593
|
+
type: 'radio',
|
|
594
|
+
id: 'eraser-mode',
|
|
595
|
+
value: 'CircularEraser',
|
|
596
|
+
values: [
|
|
597
|
+
{ value: 'CircularEraser', label: i18n.t('Buttons:Circle') },
|
|
598
|
+
{ value: 'SphereEraser', label: i18n.t('Buttons:Sphere') },
|
|
599
|
+
],
|
|
600
|
+
commands: 'setToolActiveToolbar',
|
|
601
|
+
},
|
|
602
|
+
],
|
|
603
|
+
commands: {
|
|
604
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
605
|
+
commandOptions: {
|
|
606
|
+
segmentationRepresentationType: 'Labelmap',
|
|
607
|
+
},
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
id: 'Threshold',
|
|
613
|
+
uiType: 'ohif.toolBoxButton',
|
|
614
|
+
props: {
|
|
615
|
+
icon: 'icon-tool-threshold',
|
|
616
|
+
label: i18n.t('Buttons:Threshold Tool'),
|
|
617
|
+
evaluate: [
|
|
618
|
+
{
|
|
619
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
620
|
+
toolNames: [
|
|
621
|
+
'ThresholdCircularBrush',
|
|
622
|
+
'ThresholdSphereBrush',
|
|
623
|
+
'ThresholdCircularBrushDynamic',
|
|
624
|
+
'ThresholdSphereBrushDynamic',
|
|
625
|
+
],
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
name: 'evaluate.cornerstone.segmentation.synchronizeDrawingRadius',
|
|
629
|
+
radiusOptionId: 'threshold-radius',
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
633
|
+
segmentationRepresentationType: 'Labelmap',
|
|
634
|
+
},
|
|
635
|
+
],
|
|
636
|
+
commands: {
|
|
637
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
638
|
+
commandOptions: {
|
|
639
|
+
segmentationRepresentationType: 'Labelmap',
|
|
640
|
+
},
|
|
641
|
+
},
|
|
642
|
+
options: [
|
|
643
|
+
{
|
|
644
|
+
name: i18n.t('Buttons:Radius (mm)'),
|
|
645
|
+
id: 'threshold-radius',
|
|
646
|
+
type: 'range',
|
|
647
|
+
explicitRunOnly: true,
|
|
648
|
+
min: MIN_SEGMENTATION_DRAWING_RADIUS,
|
|
649
|
+
max: MAX_SEGMENTATION_DRAWING_RADIUS,
|
|
650
|
+
step: 0.5,
|
|
651
|
+
value: 25,
|
|
652
|
+
commands: {
|
|
653
|
+
commandName: 'setBrushSize',
|
|
654
|
+
commandOptions: {
|
|
655
|
+
toolNames: [
|
|
656
|
+
'ThresholdCircularBrush',
|
|
657
|
+
'ThresholdSphereBrush',
|
|
658
|
+
'ThresholdCircularBrushDynamic',
|
|
659
|
+
'ThresholdSphereBrushDynamic',
|
|
660
|
+
],
|
|
661
|
+
},
|
|
662
|
+
},
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
name: i18n.t('Buttons:Shape'),
|
|
666
|
+
type: 'radio',
|
|
667
|
+
id: 'threshold-shape',
|
|
668
|
+
value: 'ThresholdCircularBrush',
|
|
669
|
+
values: [
|
|
670
|
+
{ value: 'ThresholdCircularBrush', label: i18n.t('Buttons:Circle') },
|
|
671
|
+
{ value: 'ThresholdSphereBrush', label: i18n.t('Buttons:Sphere') },
|
|
672
|
+
],
|
|
673
|
+
commands: ({ value, commandsManager, options }) => {
|
|
674
|
+
const optionsDynamic = options.find(option => option.id === 'dynamic-mode');
|
|
675
|
+
|
|
676
|
+
if (optionsDynamic.value === 'ThresholdDynamic') {
|
|
677
|
+
commandsManager.run('setToolActive', {
|
|
678
|
+
toolName:
|
|
679
|
+
value === 'ThresholdCircularBrush'
|
|
680
|
+
? 'ThresholdCircularBrushDynamic'
|
|
681
|
+
: 'ThresholdSphereBrushDynamic',
|
|
682
|
+
});
|
|
683
|
+
} else {
|
|
684
|
+
commandsManager.run('setToolActive', {
|
|
685
|
+
toolName: value,
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
name: i18n.t('Buttons:Threshold'),
|
|
692
|
+
type: 'radio',
|
|
693
|
+
id: 'dynamic-mode',
|
|
694
|
+
value: 'ThresholdDynamic',
|
|
695
|
+
values: [
|
|
696
|
+
{ value: 'ThresholdDynamic', label: i18n.t('Buttons:Dynamic') },
|
|
697
|
+
{ value: 'ThresholdRange', label: i18n.t('Buttons:Range') },
|
|
698
|
+
],
|
|
699
|
+
commands: ({ value, commandsManager, options }) => {
|
|
700
|
+
const thresholdRangeOption = options.find(option => option.id === 'threshold-shape');
|
|
701
|
+
|
|
702
|
+
if (value === 'ThresholdDynamic') {
|
|
703
|
+
commandsManager.run('setToolActiveToolbar', {
|
|
704
|
+
toolName:
|
|
705
|
+
thresholdRangeOption.value === 'ThresholdCircularBrush'
|
|
706
|
+
? 'ThresholdCircularBrushDynamic'
|
|
707
|
+
: 'ThresholdSphereBrushDynamic',
|
|
708
|
+
});
|
|
709
|
+
} else {
|
|
710
|
+
commandsManager.run('setToolActiveToolbar', {
|
|
711
|
+
toolName: thresholdRangeOption.value,
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
const thresholdRangeValue = options.find(
|
|
715
|
+
option => option.id === 'threshold-range'
|
|
716
|
+
).value;
|
|
717
|
+
|
|
718
|
+
commandsManager.run('setThresholdRange', {
|
|
719
|
+
toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],
|
|
720
|
+
value: thresholdRangeValue,
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
},
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
name: 'ThresholdRange',
|
|
727
|
+
type: 'double-range',
|
|
728
|
+
id: 'threshold-range',
|
|
729
|
+
min: 0,
|
|
730
|
+
max: 1000,
|
|
731
|
+
allowTypedExpansion: true,
|
|
732
|
+
step: 1,
|
|
733
|
+
value: [50, 600],
|
|
734
|
+
condition: ({ options }) =>
|
|
735
|
+
options.find(option => option.id === 'dynamic-mode').value === 'ThresholdRange',
|
|
736
|
+
commands: {
|
|
737
|
+
commandName: 'setThresholdRange',
|
|
738
|
+
commandOptions: {
|
|
739
|
+
toolNames: ['ThresholdCircularBrush', 'ThresholdSphereBrush'],
|
|
740
|
+
},
|
|
741
|
+
},
|
|
742
|
+
},
|
|
743
|
+
],
|
|
744
|
+
},
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
id: 'Shapes',
|
|
748
|
+
uiType: 'ohif.toolBoxButton',
|
|
749
|
+
props: {
|
|
750
|
+
icon: 'icon-tool-shape',
|
|
751
|
+
label: i18n.t('Buttons:Shapes'),
|
|
752
|
+
evaluate: [
|
|
753
|
+
{
|
|
754
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
755
|
+
toolNames: ['CircleScissor', 'SphereScissor', 'RectangleScissor'],
|
|
756
|
+
disabledText: i18n.t('Buttons:Create new segmentation to enable shapes tool.'),
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
760
|
+
segmentationRepresentationType: 'Labelmap',
|
|
761
|
+
},
|
|
762
|
+
],
|
|
763
|
+
commands: {
|
|
764
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
765
|
+
commandOptions: {
|
|
766
|
+
segmentationRepresentationType: 'Labelmap',
|
|
767
|
+
},
|
|
768
|
+
},
|
|
769
|
+
options: [
|
|
770
|
+
{
|
|
771
|
+
name: i18n.t('Buttons:Shape'),
|
|
772
|
+
type: 'radio',
|
|
773
|
+
value: 'CircleScissor',
|
|
774
|
+
id: 'shape-mode',
|
|
775
|
+
values: [
|
|
776
|
+
{ value: 'CircleScissor', label: i18n.t('Buttons:Circle') },
|
|
777
|
+
{ value: 'SphereScissor', label: i18n.t('Buttons:Sphere') },
|
|
778
|
+
{ value: 'RectangleScissor', label: i18n.t('Buttons:Rectangle') },
|
|
779
|
+
],
|
|
780
|
+
commands: 'setToolActiveToolbar',
|
|
781
|
+
},
|
|
782
|
+
],
|
|
783
|
+
},
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
id: 'SimplifyContours',
|
|
787
|
+
uiType: 'ohif.toolButton',
|
|
788
|
+
props: {
|
|
789
|
+
icon: 'actions-simplify',
|
|
790
|
+
label: 'Simplify Contours',
|
|
791
|
+
tooltip: 'Simplify Contours',
|
|
792
|
+
commands: ['toggleActiveSegmentationUtility'],
|
|
793
|
+
evaluate: [
|
|
794
|
+
{
|
|
795
|
+
name: 'cornerstone.isActiveSegmentationUtility',
|
|
796
|
+
},
|
|
797
|
+
],
|
|
798
|
+
options: 'cornerstone.SimplifyContourOptions',
|
|
799
|
+
},
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
id: 'SmoothContours',
|
|
803
|
+
uiType: 'ohif.toolButton',
|
|
804
|
+
props: {
|
|
805
|
+
icon: 'actions-smooth',
|
|
806
|
+
label: 'Smooth Contours',
|
|
807
|
+
tooltip: 'Smooth Contours',
|
|
808
|
+
commands: ['toggleActiveSegmentationUtility'],
|
|
809
|
+
evaluate: [
|
|
810
|
+
{
|
|
811
|
+
name: 'cornerstone.isActiveSegmentationUtility',
|
|
812
|
+
},
|
|
813
|
+
],
|
|
814
|
+
options: 'cornerstone.SmoothContoursOptions',
|
|
815
|
+
},
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
id: 'LogicalContourOperations',
|
|
819
|
+
uiType: 'ohif.toolButton',
|
|
820
|
+
props: {
|
|
821
|
+
icon: 'actions-combine',
|
|
822
|
+
label: 'Combine Contours',
|
|
823
|
+
tooltip: 'Combine Contours',
|
|
824
|
+
commands: ['toggleActiveSegmentationUtility'],
|
|
825
|
+
evaluate: [
|
|
826
|
+
{
|
|
827
|
+
name: 'cornerstone.isActiveSegmentationUtility',
|
|
828
|
+
},
|
|
829
|
+
],
|
|
830
|
+
options: 'cornerstone.LogicalContourOperationsOptions',
|
|
831
|
+
},
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
id: 'LabelMapEditWithContour',
|
|
835
|
+
uiType: 'ohif.toolBoxButton',
|
|
836
|
+
props: {
|
|
837
|
+
icon: 'tool-labelmap-edit-with-contour',
|
|
838
|
+
label: i18n.t('Buttons:Labelmap Edit with Contour Tool'),
|
|
839
|
+
tooltip: i18n.t('Buttons:Labelmap Edit with Contour Tool'),
|
|
840
|
+
commands: [
|
|
841
|
+
'setToolActiveToolbar',
|
|
842
|
+
{
|
|
843
|
+
commandName: 'activateSelectedSegmentationOfType',
|
|
844
|
+
commandOptions: { segmentationRepresentationType: 'Labelmap' },
|
|
845
|
+
},
|
|
846
|
+
],
|
|
847
|
+
evaluate: [
|
|
848
|
+
{
|
|
849
|
+
name: 'evaluate.cornerstone.segmentation',
|
|
850
|
+
toolNames: ['LabelMapEditWithContour'],
|
|
851
|
+
disabledText: 'Create new segmentation to enable this tool.',
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
name: 'evaluate.cornerstone.hasSegmentationOfType',
|
|
855
|
+
segmentationRepresentationType: 'Labelmap',
|
|
856
|
+
},
|
|
857
|
+
],
|
|
858
|
+
},
|
|
859
|
+
},
|
|
860
|
+
];
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* The toolbox / utilities section wiring for segmentation editing. These are
|
|
864
|
+
* the sections rendered by the `panelSegmentationWithTools*` panels, so any
|
|
865
|
+
* mode that shows those panels can merge this block into its toolbar sections.
|
|
866
|
+
*/
|
|
867
|
+
export const segmentationToolboxSections: Record<string, string[]> = {
|
|
868
|
+
[TOOLBAR_SECTIONS.labelMapSegmentationToolbox]: ['LabelMapTools'],
|
|
869
|
+
[TOOLBAR_SECTIONS.contourSegmentationToolbox]: ['ContourTools'],
|
|
870
|
+
[TOOLBAR_SECTIONS.labelMapSegmentationUtilities]: ['LabelMapUtilities'],
|
|
871
|
+
[TOOLBAR_SECTIONS.contourSegmentationUtilities]: ['ContourUtilities'],
|
|
872
|
+
|
|
873
|
+
LabelMapTools: [
|
|
874
|
+
'LabelmapSlicePropagation',
|
|
875
|
+
'BrushTools',
|
|
876
|
+
'MarkerLabelmap',
|
|
877
|
+
'ClickSegment',
|
|
878
|
+
'Shapes',
|
|
879
|
+
'LabelMapEditWithContour',
|
|
880
|
+
],
|
|
881
|
+
ContourTools: [
|
|
882
|
+
'PlanarFreehandContourSegmentationTool',
|
|
883
|
+
'SculptorTool',
|
|
884
|
+
'SplineContourSegmentationTool',
|
|
885
|
+
'LivewireContourSegmentationTool',
|
|
886
|
+
],
|
|
887
|
+
|
|
888
|
+
LabelMapUtilities: ['InterpolateLabelmap', 'SegmentBidirectional'],
|
|
889
|
+
ContourUtilities: ['LogicalContourOperations', 'SimplifyContours', 'SmoothContours'],
|
|
890
|
+
|
|
891
|
+
BrushTools: ['Brush', 'Eraser', 'Threshold'],
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
* The segmentation mode's main toolbar layout (primary bar and viewport
|
|
896
|
+
* action corners). Kept separate from the toolbox wiring above so other modes
|
|
897
|
+
* can adopt segmentation editing without adopting this mode layout.
|
|
898
|
+
*/
|
|
899
|
+
export const segmentationModeToolbarSections: Record<string, string[]> = {
|
|
900
|
+
[TOOLBAR_SECTIONS.primary]: [
|
|
901
|
+
'WindowLevel',
|
|
902
|
+
'Pan',
|
|
903
|
+
'Zoom',
|
|
904
|
+
'TrackballRotate',
|
|
905
|
+
'Capture',
|
|
906
|
+
'Layout',
|
|
907
|
+
'Crosshairs',
|
|
908
|
+
'MoreTools',
|
|
909
|
+
],
|
|
910
|
+
|
|
911
|
+
[TOOLBAR_SECTIONS.viewportActionMenu.topLeft]: ['orientationMenu', 'dataOverlayMenu'],
|
|
912
|
+
|
|
913
|
+
[TOOLBAR_SECTIONS.viewportActionMenu.bottomMiddle]: ['AdvancedRenderingControls'],
|
|
914
|
+
|
|
915
|
+
AdvancedRenderingControls: [
|
|
916
|
+
'windowLevelMenuEmbedded',
|
|
917
|
+
'voiManualControlMenu',
|
|
918
|
+
'Colorbar',
|
|
919
|
+
'opacityMenu',
|
|
920
|
+
'thresholdMenu',
|
|
921
|
+
],
|
|
922
|
+
|
|
923
|
+
[TOOLBAR_SECTIONS.viewportActionMenu.topRight]: [
|
|
924
|
+
'modalityLoadBadge',
|
|
925
|
+
'trackingStatus',
|
|
926
|
+
'navigationComponent',
|
|
927
|
+
],
|
|
928
|
+
|
|
929
|
+
[TOOLBAR_SECTIONS.viewportActionMenu.bottomLeft]: ['windowLevelMenu'],
|
|
930
|
+
|
|
931
|
+
MoreTools: [
|
|
932
|
+
'Reset',
|
|
933
|
+
'rotate-right',
|
|
934
|
+
'flipHorizontal',
|
|
935
|
+
'ReferenceLines',
|
|
936
|
+
'ImageOverlayViewer',
|
|
937
|
+
'StackScroll',
|
|
938
|
+
'invert',
|
|
939
|
+
'Cine',
|
|
940
|
+
'Magnify',
|
|
941
|
+
'TagBrowser',
|
|
942
|
+
],
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* Segmentation capability packs registered (at default scope) by the
|
|
947
|
+
* cornerstone extension. These are pure "what can exist" packs and carry no
|
|
948
|
+
* mode identity:
|
|
949
|
+
* - `cornerstone.segmentationToolbarButtons` – segmentation editing button definitions
|
|
950
|
+
* - `cornerstone.segmentationToolbarSections` – toolbox/utilities section wiring
|
|
951
|
+
* - `cornerstone.segmentationModeToolbarSections` – a reusable segmentation-mode toolbar layout
|
|
952
|
+
*
|
|
953
|
+
* Modes compose these by name in their own `toolbarButtons` /
|
|
954
|
+
* `toolbarSections` instance arrays; `?customization=` modules extend the
|
|
955
|
+
* result through the `mode` phase.
|
|
956
|
+
*/
|
|
957
|
+
const segmentationToolbarCustomization = {
|
|
958
|
+
'cornerstone.segmentationToolbarButtons': segmentationToolbarButtons,
|
|
959
|
+
'cornerstone.segmentationToolbarSections': segmentationToolboxSections,
|
|
960
|
+
'cornerstone.segmentationModeToolbarSections': segmentationModeToolbarSections,
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
export { segmentationToolbarButtons };
|
|
964
|
+
export default segmentationToolbarCustomization;
|