@cornerstonejs/tools 2.0.0-beta.20 → 2.0.0-beta.22
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/esm/cursors/SVGCursorDescriptor.d.ts +1 -1
- package/dist/esm/cursors/SVGCursorDescriptor.js +7 -0
- package/dist/esm/cursors/SVGMouseCursor.d.ts +1 -1
- package/dist/esm/cursors/elementCursor.d.ts +1 -1
- package/dist/esm/cursors/elementCursor.js +1 -1
- package/dist/esm/drawingSvg/draw.d.ts +2 -1
- package/dist/esm/drawingSvg/drawArrow.d.ts +1 -1
- package/dist/esm/drawingSvg/drawCircle.d.ts +1 -1
- package/dist/esm/drawingSvg/drawEllipse.d.ts +1 -1
- package/dist/esm/drawingSvg/drawEllipse.js +1 -0
- package/dist/esm/drawingSvg/drawEllipseByCoordinates.d.ts +1 -1
- package/dist/esm/drawingSvg/drawHandle.d.ts +1 -1
- package/dist/esm/drawingSvg/drawHandles.d.ts +1 -1
- package/dist/esm/drawingSvg/drawHeight.d.ts +3 -0
- package/dist/esm/drawingSvg/drawHeight.js +42 -0
- package/dist/esm/drawingSvg/drawLine.d.ts +1 -1
- package/dist/esm/drawingSvg/drawLink.d.ts +1 -1
- package/dist/esm/drawingSvg/drawLinkedTextBox.d.ts +1 -1
- package/dist/esm/drawingSvg/drawPath.d.ts +1 -1
- package/dist/esm/drawingSvg/drawPolyline.d.ts +1 -1
- package/dist/esm/drawingSvg/drawRect.d.ts +1 -1
- package/dist/esm/drawingSvg/drawRect.js +1 -0
- package/dist/esm/drawingSvg/drawRectByCoordinates.d.ts +1 -1
- package/dist/esm/drawingSvg/drawRedactionRect.d.ts +3 -1
- package/dist/esm/drawingSvg/drawTextBox.d.ts +1 -1
- package/dist/esm/drawingSvg/getSvgDrawingHelper.d.ts +1 -1
- package/dist/esm/drawingSvg/getSvgDrawingHelper.js +2 -2
- package/dist/esm/drawingSvg/index.d.ts +2 -1
- package/dist/esm/drawingSvg/index.js +2 -1
- package/dist/esm/enums/ToolBindings.d.ts +3 -1
- package/dist/esm/enums/ToolBindings.js +2 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.d.ts +1 -1
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.js +2 -2
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.d.ts +1 -1
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.js +2 -2
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.js +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.js +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.js +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDrag.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDrag.js +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.js +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.d.ts +2 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.js +15 -2
- package/dist/esm/eventDispatchers/shared/customCallbackHandler.js +3 -2
- package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.d.ts +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.js +2 -2
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.d.ts +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js +5 -6
- package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.d.ts +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.js +2 -2
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForKeyboardEvents.d.ts +2 -2
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForKeyboardEvents.js +2 -2
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.d.ts +4 -3
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.js +2 -2
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.d.ts +3 -3
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.js +2 -2
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForTouchEvent.d.ts +2 -2
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForTouchEvent.js +2 -2
- package/dist/esm/eventDispatchers/touchEventHandlers/touchDrag.d.ts +1 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchDrag.js +1 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStart.d.ts +1 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStart.js +1 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.d.ts +1 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.js +1 -1
- package/dist/esm/eventListeners/annotations/annotationCompletedListener.d.ts +1 -1
- package/dist/esm/eventListeners/annotations/annotationRemovedListener.d.ts +1 -1
- package/dist/esm/eventListeners/annotations/annotationSelectionListener.js +1 -1
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +3 -3
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +22 -21
- package/dist/esm/eventListeners/mouse/getMouseEventPoints.d.ts +1 -1
- package/dist/esm/eventListeners/mouse/getMouseEventPoints.js +4 -1
- package/dist/esm/eventListeners/mouse/mouseDownListener.js +9 -1
- package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js +9 -7
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +3 -3
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js +2 -2
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.js +3 -2
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js +5 -5
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js +4 -2
- package/dist/esm/eventListeners/touch/getTouchEventPoints.d.ts +1 -1
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.js +4 -3
- package/dist/esm/init.js +2 -2
- package/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.d.ts +20 -0
- package/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.js +112 -0
- package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +3 -3
- package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +0 -2
- package/dist/esm/stateManagement/annotation/annotationLocking.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/annotationSelection.js +1 -1
- package/dist/esm/stateManagement/annotation/annotationState.d.ts +4 -4
- package/dist/esm/stateManagement/annotation/annotationState.js +4 -6
- package/dist/esm/stateManagement/annotation/annotationVisibility.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/annotationVisibility.js +1 -1
- package/dist/esm/stateManagement/annotation/config/ToolStyle.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/config/getFont.d.ts +2 -2
- package/dist/esm/stateManagement/annotation/config/getState.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/config/helpers.d.ts +2 -2
- package/dist/esm/stateManagement/annotation/getAnnotation.d.ts +2 -0
- package/dist/esm/stateManagement/annotation/getAnnotation.js +6 -0
- package/dist/esm/stateManagement/annotation/helpers/state.d.ts +2 -2
- package/dist/esm/stateManagement/annotation/utilities/defineProperties.d.ts +1 -1
- package/dist/esm/stateManagement/index.d.ts +1 -3
- package/dist/esm/stateManagement/index.js +3 -2
- package/dist/esm/{tools/displayTools → stateManagement/segmentation}/SegmentationRenderingEngine.d.ts +6 -4
- package/dist/esm/{tools/displayTools → stateManagement/segmentation}/SegmentationRenderingEngine.js +23 -19
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.d.ts +29 -13
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +73 -23
- package/dist/esm/stateManagement/segmentation/activeSegmentation.d.ts +5 -4
- package/dist/esm/stateManagement/segmentation/activeSegmentation.js +15 -6
- package/dist/esm/stateManagement/segmentation/addColorLUT.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/addColorLUT.js +5 -0
- package/dist/esm/stateManagement/segmentation/addRepresentationData.d.ts +3 -3
- package/dist/esm/stateManagement/segmentation/addRepresentationData.js +1 -1
- package/dist/esm/stateManagement/segmentation/addSegmentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/addSegmentation.js +11 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/{addRepresentation.js → addSegmentationRepresentation.js} +31 -10
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentationState.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentationState.js +10 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js +9 -0
- package/dist/esm/stateManagement/segmentation/addSegmentations.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/config/index.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/config/index.js +2 -2
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.js +8 -6
- package/dist/esm/stateManagement/segmentation/config/segmentationConfig.d.ts +5 -5
- package/dist/esm/stateManagement/segmentation/config/segmentationConfig.js +17 -12
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.d.ts +5 -5
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +16 -13
- package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts +0 -8
- package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js +7 -82
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationDataModified.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationDataModified.js +11 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationModified.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationModified.js +18 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRemoved.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRemoved.js +8 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationModified.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationModified.js +8 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationRemoved.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationRemoved.js +8 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentIndex.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentIndex.js +7 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentationRepresentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentationRepresentation.js +5 -0
- package/dist/esm/stateManagement/segmentation/getAllSegmentationRepresentations.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getAllSegmentationRepresentations.js +6 -0
- package/dist/esm/stateManagement/segmentation/getColorLUT.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getColorLUT.js +5 -0
- package/dist/esm/stateManagement/segmentation/getCurrentLabelmapImageIdForViewport.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getCurrentLabelmapImageIdForViewport.js +5 -0
- package/dist/esm/stateManagement/segmentation/getGlobalConfig.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getGlobalConfig.js +5 -0
- package/dist/esm/stateManagement/segmentation/getNextColorLUTIndex.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getNextColorLUTIndex.js +5 -0
- package/dist/esm/stateManagement/segmentation/getPerSegmentConfig.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getPerSegmentConfig.js +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getSegmentation.js +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentation.js +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationConfig.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationConfig.js +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationViewportStates.d.ts +7 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationViewportStates.js +6 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationVisibility.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationVisibility.js +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentations.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentations.js +12 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationsForSegmentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationsForSegmentation.js +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentations.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getSegmentations.js +6 -0
- package/dist/esm/stateManagement/segmentation/getViewportIdsWithSegmentation.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getViewportIdsWithSegmentation.js +10 -0
- package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.js +1 -1
- package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/helpers/updateStackSegmentationState.d.ts +8 -0
- package/dist/esm/stateManagement/segmentation/helpers/updateStackSegmentationState.js +31 -0
- package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/index.d.ts +4 -4
- package/dist/esm/stateManagement/segmentation/index.js +4 -4
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js +5 -4
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +13 -22
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +2 -6
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +10 -15
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +2 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +3 -4
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +3 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +4 -4
- package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +4 -3
- package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +1 -1
- package/dist/esm/stateManagement/segmentation/removeColorLUT.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/removeColorLUT.js +5 -0
- package/dist/esm/stateManagement/segmentation/removeRepresentation.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/removeRepresentation.js +9 -0
- package/dist/esm/stateManagement/segmentation/removeSegmentation.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/removeSegmentation.js +7 -0
- package/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/{removeRepresentationsFromViewport.js → removeSegmentationRepresentations.js} +11 -8
- package/dist/esm/stateManagement/segmentation/segmentIndex.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/segmentIndex.js +6 -10
- package/dist/esm/stateManagement/segmentation/segmentLocking.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/segmentLocking.js +3 -3
- package/dist/esm/stateManagement/segmentation/segmentationState.d.ts +29 -38
- package/dist/esm/stateManagement/segmentation/segmentationState.js +29 -157
- package/dist/esm/stateManagement/segmentation/setActiveSegmentationRepresentation.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/setActiveSegmentationRepresentation.js +9 -0
- package/dist/esm/stateManagement/segmentation/setGlobalConfig.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/setGlobalConfig.js +9 -0
- package/dist/esm/stateManagement/segmentation/setPerSegmentConfig.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/setPerSegmentConfig.js +9 -0
- package/dist/esm/stateManagement/segmentation/setSegmentationRepresentationConfig.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/setSegmentationRepresentationConfig.js +9 -0
- package/dist/esm/stateManagement/segmentation/setSegmentationRepresentationVisibility.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/setSegmentationRepresentationVisibility.js +5 -0
- package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.d.ts +5 -5
- package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.js +5 -45
- package/dist/esm/stateManagement/segmentation/updateLabelmapSegmentationImageReferences.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/updateLabelmapSegmentationImageReferences.js +5 -0
- package/dist/esm/store/SynchronizerManager/Synchronizer.d.ts +7 -3
- package/dist/esm/store/SynchronizerManager/Synchronizer.js +2 -1
- package/dist/esm/store/SynchronizerManager/createSynchronizer.d.ts +3 -3
- package/dist/esm/store/SynchronizerManager/createSynchronizer.js +2 -2
- package/dist/esm/store/SynchronizerManager/destroy.js +1 -1
- package/dist/esm/store/SynchronizerManager/destroySynchronizer.js +1 -1
- package/dist/esm/store/SynchronizerManager/getAllSynchronizers.d.ts +1 -1
- package/dist/esm/store/SynchronizerManager/getAllSynchronizers.js +1 -1
- package/dist/esm/store/SynchronizerManager/getSynchronizer.d.ts +1 -1
- package/dist/esm/store/SynchronizerManager/getSynchronizer.js +1 -1
- package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.d.ts +1 -1
- package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.js +1 -1
- package/dist/esm/store/ToolGroupManager/ToolGroup.d.ts +3 -3
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +12 -8
- package/dist/esm/store/ToolGroupManager/createToolGroup.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/createToolGroup.js +1 -1
- package/dist/esm/store/ToolGroupManager/destroy.js +3 -3
- package/dist/esm/store/ToolGroupManager/destroyToolGroup.js +1 -1
- package/dist/esm/store/ToolGroupManager/getAllToolGroups.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/getAllToolGroups.js +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroup.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroup.js +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.js +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.js +1 -1
- package/dist/esm/store/addEnabledElement.d.ts +1 -1
- package/dist/esm/store/addEnabledElement.js +1 -1
- package/dist/esm/store/addTool.d.ts +1 -0
- package/dist/esm/store/addTool.js +3 -3
- package/dist/esm/store/filterMoveableAnnotationTools.d.ts +1 -1
- package/dist/esm/store/filterToolsWithAnnotationsForElement.d.ts +1 -1
- package/dist/esm/store/filterToolsWithMoveableHandles.d.ts +1 -1
- package/dist/esm/store/index.d.ts +1 -2
- package/dist/esm/store/index.js +1 -2
- package/dist/esm/store/removeEnabledElement.d.ts +1 -1
- package/dist/esm/store/removeEnabledElement.js +1 -1
- package/dist/esm/store/state.d.ts +4 -3
- package/dist/esm/store/state.js +1 -1
- package/dist/esm/synchronizers/callbacks/areViewportsCoplanar .d.ts +1 -1
- package/dist/esm/synchronizers/callbacks/cameraSyncCallback.d.ts +2 -2
- package/dist/esm/synchronizers/callbacks/imageSliceSyncCallback.d.ts +2 -2
- package/dist/esm/synchronizers/callbacks/presentationViewSyncCallback.d.ts +1 -1
- package/dist/esm/synchronizers/callbacks/slabThicknessSyncCallback.d.ts +1 -1
- package/dist/esm/synchronizers/callbacks/voiSyncCallback.d.ts +5 -2
- package/dist/esm/synchronizers/callbacks/zoomPanSyncCallback.d.ts +2 -2
- package/dist/esm/synchronizers/synchronizers/createCameraPositionSynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createImageSliceSynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.d.ts +2 -2
- package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.js +1 -1
- package/dist/esm/synchronizers/synchronizers/createSlabThicknessSynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createVOISynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createZoomPanSynchronizer.d.ts +1 -1
- package/dist/esm/tools/AdvancedMagnifyTool.d.ts +97 -8
- package/dist/esm/tools/AdvancedMagnifyTool.js +506 -4
- package/dist/esm/tools/AnnotationEraserTool.d.ts +1 -1
- package/dist/esm/tools/AnnotationEraserTool.js +2 -2
- package/dist/esm/tools/CrosshairsTool.d.ts +5 -5
- package/dist/esm/tools/CrosshairsTool.js +5 -4
- package/dist/esm/tools/MIPJumpToClickTool.d.ts +1 -2
- package/dist/esm/tools/MIPJumpToClickTool.js +2 -3
- package/dist/esm/tools/MagnifyTool.d.ts +2 -3
- package/dist/esm/tools/MagnifyTool.js +1 -1
- package/dist/esm/tools/OrientationMarkerTool.d.ts +41 -58
- package/dist/esm/tools/OrientationMarkerTool.js +8 -7
- package/dist/esm/tools/OverlayGridTool.d.ts +2 -4
- package/dist/esm/tools/OverlayGridTool.js +1 -1
- package/dist/esm/tools/PanTool.d.ts +1 -1
- package/dist/esm/tools/PanTool.js +5 -0
- package/dist/esm/tools/PlanarRotateTool.d.ts +3 -1
- package/dist/esm/tools/PlanarRotateTool.js +18 -4
- package/dist/esm/tools/ReferenceCursors.d.ts +2 -5
- package/dist/esm/tools/ReferenceLinesTool.d.ts +4 -6
- package/dist/esm/tools/ReferenceLinesTool.js +1 -1
- package/dist/esm/tools/ScaleOverlayTool.d.ts +7 -9
- package/dist/esm/tools/ScaleOverlayTool.js +1 -2
- package/dist/esm/tools/SculptorTool/CircleSculptCursor.d.ts +4 -4
- package/dist/esm/tools/SculptorTool.d.ts +1 -1
- package/dist/esm/tools/SculptorTool.js +3 -3
- package/dist/esm/tools/SegmentationIntersectionTool.d.ts +2 -2
- package/dist/esm/tools/StackScrollTool.d.ts +2 -1
- package/dist/esm/tools/StackScrollTool.js +17 -3
- package/dist/esm/tools/StackScrollToolMouseWheelTool.d.ts +1 -2
- package/dist/esm/tools/StackScrollToolMouseWheelTool.js +1 -2
- package/dist/esm/tools/TrackballRotateTool.d.ts +1 -1
- package/dist/esm/tools/TrackballRotateTool.js +4 -0
- package/dist/esm/tools/VolumeRotateMouseWheelTool.d.ts +2 -3
- package/dist/esm/tools/WindowLevelRegionTool.d.ts +3 -3
- package/dist/esm/tools/WindowLevelRegionTool.js +2 -4
- package/dist/esm/tools/WindowLevelTool.d.ts +1 -1
- package/dist/esm/tools/WindowLevelTool.js +12 -7
- package/dist/esm/tools/ZoomTool.d.ts +2 -2
- package/dist/esm/tools/ZoomTool.js +2 -2
- package/dist/esm/tools/annotation/AngleTool.d.ts +5 -7
- package/dist/esm/tools/annotation/AngleTool.js +4 -3
- package/dist/esm/tools/annotation/ArrowAnnotateTool.d.ts +5 -7
- package/dist/esm/tools/annotation/ArrowAnnotateTool.js +1 -1
- package/dist/esm/tools/annotation/BidirectionalTool.d.ts +5 -7
- package/dist/esm/tools/annotation/BidirectionalTool.js +2 -3
- package/dist/esm/tools/annotation/CircleROITool.d.ts +5 -7
- package/dist/esm/tools/annotation/CircleROITool.js +15 -13
- package/dist/esm/tools/annotation/CobbAngleTool.d.ts +5 -7
- package/dist/esm/tools/annotation/CobbAngleTool.js +1 -1
- package/dist/esm/tools/annotation/DragProbeTool.d.ts +3 -5
- package/dist/esm/tools/annotation/DragProbeTool.js +0 -5
- package/dist/esm/tools/annotation/EllipticalROITool.d.ts +5 -7
- package/dist/esm/tools/annotation/EllipticalROITool.js +13 -9
- package/dist/esm/tools/annotation/HeightTool.d.ts +36 -0
- package/dist/esm/tools/annotation/HeightTool.js +434 -0
- package/dist/esm/tools/annotation/KeyImageTool.d.ts +4 -6
- package/dist/esm/tools/annotation/KeyImageTool.js +1 -1
- package/dist/esm/tools/annotation/LengthTool.d.ts +5 -7
- package/dist/esm/tools/annotation/LengthTool.js +8 -7
- package/dist/esm/tools/annotation/LivewireContourTool.d.ts +3 -4
- package/dist/esm/tools/annotation/LivewireContourTool.js +5 -3
- package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -2
- package/dist/esm/tools/annotation/PlanarFreehandROITool.d.ts +21 -4
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +160 -118
- package/dist/esm/tools/annotation/ProbeTool.d.ts +4 -6
- package/dist/esm/tools/annotation/ProbeTool.js +17 -33
- package/dist/esm/tools/annotation/RectangleROITool.d.ts +5 -5
- package/dist/esm/tools/annotation/RectangleROITool.js +12 -9
- package/dist/esm/tools/annotation/SplineContourSegmentationTool.d.ts +1 -1
- package/dist/esm/tools/annotation/SplineROITool.d.ts +1 -3
- package/dist/esm/tools/annotation/SplineROITool.js +9 -6
- package/dist/esm/tools/annotation/UltrasoundDirectionalTool.d.ts +5 -7
- package/dist/esm/tools/annotation/UltrasoundDirectionalTool.js +6 -7
- package/dist/esm/tools/annotation/VideoRedactionTool.d.ts +4 -5
- package/dist/esm/tools/annotation/VideoRedactionTool.js +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.d.ts +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js +2 -2
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js +1 -1
- package/dist/esm/tools/annotation/splines/CardinalSpline.d.ts +1 -1
- package/dist/esm/tools/annotation/splines/CubicSpline.d.ts +1 -1
- package/dist/esm/tools/annotation/splines/QuadraticSpline.d.ts +1 -1
- package/dist/esm/tools/annotation/splines/Spline.d.ts +1 -1
- package/dist/esm/tools/base/AnnotationDisplayTool.d.ts +3 -3
- package/dist/esm/tools/base/AnnotationDisplayTool.js +3 -9
- package/dist/esm/tools/base/AnnotationTool.d.ts +3 -14
- package/dist/esm/tools/base/BaseTool.d.ts +5 -5
- package/dist/esm/tools/base/BaseTool.js +1 -1
- package/dist/esm/tools/base/ContourBaseTool.d.ts +1 -1
- package/dist/esm/tools/base/ContourBaseTool.js +5 -5
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js +28 -19
- package/dist/esm/tools/displayTools/Contour/contourConfig.d.ts +1 -1
- package/dist/esm/tools/displayTools/Contour/contourDisplay.d.ts +2 -2
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js +9 -7
- package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.d.ts +2 -2
- package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.js +6 -6
- package/dist/esm/tools/displayTools/Contour/contourHandler/utils.d.ts +1 -1
- package/dist/esm/tools/displayTools/Contour/removeContourFromElement.js +2 -2
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.d.ts +1 -1
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +4 -3
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.d.ts +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.d.ts +3 -10
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +24 -28
- package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.d.ts +2 -2
- package/dist/esm/tools/displayTools/Surface/surfaceConfig.d.ts +1 -1
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.d.ts +2 -2
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +10 -7
- package/dist/esm/tools/distancePointToContour.d.ts +1 -1
- package/dist/esm/tools/index.d.ts +2 -1
- package/dist/esm/tools/index.js +2 -1
- package/dist/esm/tools/segmentation/BrushTool.js +11 -9
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.d.ts +20 -15
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js +198 -67
- package/dist/esm/tools/segmentation/CircleScissorsTool.d.ts +3 -3
- package/dist/esm/tools/segmentation/CircleScissorsTool.js +10 -3
- package/dist/esm/tools/segmentation/PaintFillTool.d.ts +1 -1
- package/dist/esm/tools/segmentation/PaintFillTool.js +15 -14
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +20 -10
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +172 -55
- package/dist/esm/tools/segmentation/RectangleROIThresholdTool.d.ts +3 -3
- package/dist/esm/tools/segmentation/RectangleScissorsTool.d.ts +4 -3
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js +8 -5
- package/dist/esm/tools/segmentation/SegmentSelectTool.d.ts +2 -2
- package/dist/esm/tools/segmentation/SegmentSelectTool.js +3 -3
- package/dist/esm/tools/segmentation/SphereScissorsTool.d.ts +3 -2
- package/dist/esm/tools/segmentation/SphereScissorsTool.js +12 -4
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.d.ts +4 -5
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +3 -1
- package/dist/esm/tools/segmentation/strategies/compositions/determineSegmentIndex.js +6 -3
- package/dist/esm/tools/segmentation/strategies/compositions/dynamicThreshold.js +1 -1
- package/dist/esm/tools/segmentation/strategies/compositions/islandRemoval.js +1 -1
- package/dist/esm/tools/segmentation/strategies/compositions/preview.js +6 -6
- package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js +6 -3
- package/dist/esm/tools/segmentation/strategies/compositions/setValue.js +1 -1
- package/dist/esm/tools/segmentation/strategies/eraseRectangle.d.ts +1 -1
- package/dist/esm/tools/segmentation/strategies/fillCircle.js +1 -1
- package/dist/esm/tools/segmentation/strategies/fillRectangle.d.ts +1 -1
- package/dist/esm/tools/segmentation/strategies/fillRectangle.js +10 -7
- package/dist/esm/tools/segmentation/strategies/fillSphere.js +1 -1
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.d.ts +1 -1
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +7 -24
- package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.d.ts +9 -2
- package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +3 -3
- package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js +0 -3
- package/dist/esm/types/AnnotationGroupSelector.d.ts +1 -1
- package/dist/esm/types/AnnotationRenderContext.d.ts +3 -2
- package/dist/esm/types/AnnotationStyle.d.ts +2 -2
- package/dist/esm/types/AnnotationTypes.d.ts +3 -3
- package/dist/esm/types/BoundsIJK.d.ts +1 -1
- package/dist/esm/types/CINETypes.d.ts +1 -0
- package/dist/esm/types/CalculatorTypes.d.ts +1 -1
- package/dist/esm/types/CardinalSplineProps.d.ts +1 -1
- package/dist/esm/types/ClosestPoint.d.ts +1 -1
- package/dist/esm/types/ContourAnnotation.d.ts +1 -1
- package/dist/esm/types/ContourSegmentationAnnotation.d.ts +2 -2
- package/dist/esm/types/ControlPointInfo.d.ts +1 -1
- package/dist/esm/types/EventTypes.d.ts +13 -12
- package/dist/esm/types/FloodFillTypes.d.ts +2 -2
- package/dist/esm/types/IAnnotationManager.d.ts +3 -3
- package/dist/esm/types/IDistance.d.ts +1 -1
- package/dist/esm/types/IPoints.d.ts +2 -2
- package/dist/esm/types/ISetToolModeOptions.d.ts +2 -2
- package/dist/esm/types/ISpline.d.ts +1 -1
- package/dist/esm/types/ISynchronizerEventHandler.d.ts +3 -3
- package/dist/esm/types/IToolClassReference.d.ts +3 -3
- package/dist/esm/types/IToolGroup.d.ts +8 -8
- package/dist/esm/types/ITouchPoints.d.ts +2 -2
- package/dist/esm/types/InteractionTypes.d.ts +1 -1
- package/dist/esm/types/InternalToolTypes.d.ts +4 -4
- package/dist/esm/types/InterpolationTypes.d.ts +3 -3
- package/dist/esm/types/JumpToSliceOptions.d.ts +1 -1
- package/dist/esm/types/LabelmapToolOperationData.d.ts +3 -2
- package/dist/esm/types/PlanarBoundingBox.d.ts +1 -1
- package/dist/esm/types/SVGDrawingHelper.d.ts +1 -1
- package/dist/esm/types/ScrollOptions.d.ts +1 -1
- package/dist/esm/types/SegmentationStateTypes.d.ts +7 -6
- package/dist/esm/types/SplineCurveSegment.d.ts +1 -1
- package/dist/esm/types/SplineLineSegment.d.ts +1 -1
- package/dist/esm/types/ToolAction.d.ts +1 -1
- package/dist/esm/types/ToolHandle.d.ts +1 -1
- package/dist/esm/types/ToolProps.d.ts +1 -1
- package/dist/esm/types/ToolSpecificAnnotationTypes.d.ts +34 -12
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/utilities/annotationFrameRange.d.ts +1 -1
- package/dist/esm/utilities/annotationHydration.d.ts +3 -2
- package/dist/esm/utilities/annotationHydration.js +1 -1
- package/dist/esm/utilities/cine/playClip.d.ts +6 -2
- package/dist/esm/utilities/cine/playClip.js +53 -6
- package/dist/esm/utilities/cine/state.d.ts +1 -1
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +1 -1
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js +1 -1
- package/dist/esm/utilities/contourSegmentation/areSameSegment.d.ts +1 -1
- package/dist/esm/utilities/contourSegmentation/isContourSegmentationAnnotation.d.ts +2 -2
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +1 -1
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +2 -2
- package/dist/esm/utilities/contours/AnnotationToPointData.d.ts +1 -1
- package/dist/esm/utilities/contours/areCoplanarContours.d.ts +1 -1
- package/dist/esm/utilities/contours/findHandlePolylineIndex.d.ts +1 -1
- package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js +1 -1
- package/dist/esm/utilities/contours/getContourHolesDataWorld.js +1 -1
- package/dist/esm/utilities/contours/index.d.ts +1 -2
- package/dist/esm/utilities/contours/index.js +1 -2
- package/dist/esm/utilities/contours/interpolation/createPolylineToolData.d.ts +1 -1
- package/dist/esm/utilities/contours/interpolation/getInterpolationData.d.ts +1 -1
- package/dist/esm/utilities/contours/interpolation/interpolate.d.ts +1 -1
- package/dist/esm/utilities/contours/reverseIfAntiClockwise.d.ts +1 -1
- package/dist/esm/utilities/contours/updateContourPolyline.d.ts +1 -1
- package/dist/esm/utilities/contours/updateContourPolyline.js +1 -1
- package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.d.ts +3 -2
- package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.js +31 -23
- package/dist/esm/utilities/dynamicVolume/getDataInTime.d.ts +1 -1
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js +14 -9
- package/dist/esm/utilities/getAnnotationNearPoint.d.ts +1 -1
- package/dist/esm/utilities/getCalibratedUnits.d.ts +0 -6
- package/dist/esm/utilities/getCalibratedUnits.js +13 -4
- package/dist/esm/utilities/getPixelValueUnits.d.ts +2 -1
- package/dist/esm/utilities/getPixelValueUnits.js +1 -0
- package/dist/esm/utilities/getSphereBoundsInfo.d.ts +1 -1
- package/dist/esm/utilities/getToolsWithModesForElement.d.ts +1 -1
- package/dist/esm/utilities/getToolsWithModesForElement.js +2 -2
- package/dist/esm/utilities/getVOIMultipliers.d.ts +1 -1
- package/dist/esm/utilities/index.d.ts +2 -5
- package/dist/esm/utilities/index.js +2 -5
- package/dist/esm/utilities/livewire/LiveWirePath.d.ts +1 -1
- package/dist/esm/utilities/livewire/LivewireScissors.d.ts +1 -1
- package/dist/esm/utilities/math/aabb/distanceToPoint.d.ts +1 -1
- package/dist/esm/utilities/math/aabb/distanceToPointSquared.d.ts +1 -1
- package/dist/esm/utilities/math/aabb/intersectAABB.d.ts +1 -1
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.d.ts +2 -2
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.js +1 -1
- package/dist/esm/utilities/math/basic/Calculator.d.ts +1 -1
- package/dist/esm/utilities/math/circle/getCanvasCircleCorners.d.ts +1 -1
- package/dist/esm/utilities/math/circle/getCanvasCircleRadius.d.ts +1 -1
- package/dist/esm/utilities/math/line/distanceToPointSquared.d.ts +1 -1
- package/dist/esm/utilities/math/line/distanceToPointSquaredInfo.js +3 -3
- package/dist/esm/utilities/math/midPoint.d.ts +1 -1
- package/dist/esm/utilities/math/point/mirror.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/addCanvasPointsToArray.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/combinePolyline.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getAABB.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getLinesIntersection.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getNormal2.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getNormal3.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/intersectPolyline.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/isClosed.js +2 -2
- package/dist/esm/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +2 -2
- package/dist/esm/utilities/math/sphere/pointInSphere.d.ts +1 -1
- package/dist/esm/utilities/orientation/getOrientationStringLPS.d.ts +1 -1
- package/dist/esm/utilities/planar/filterAnnotationsForDisplay.d.ts +1 -1
- package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.d.ts +3 -0
- package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.js +26 -0
- package/dist/esm/utilities/planar/filterAnnotationsWithinSlice.d.ts +1 -1
- package/dist/esm/utilities/planar/index.d.ts +3 -1
- package/dist/esm/utilities/planar/index.js +3 -1
- package/dist/esm/utilities/planarFreehandROITool/interpolation/algorithms/bspline.d.ts +1 -1
- package/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.d.ts +1 -1
- package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.d.ts +2 -2
- package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.js +3 -3
- package/dist/esm/utilities/planarFreehandROITool/smoothPoints.d.ts +11 -3
- package/dist/esm/utilities/polyData/utils.d.ts +1 -1
- package/dist/esm/utilities/scroll.d.ts +4 -3
- package/dist/esm/utilities/scroll.js +3 -10
- package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.d.ts +1 -1
- package/dist/esm/utilities/segmentation/brushSizeForToolGroup.js +1 -1
- package/dist/esm/utilities/segmentation/brushThresholdForToolGroup.js +1 -1
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.d.ts +2 -11
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.js +1 -1
- package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.d.ts +1 -1
- package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.js +7 -7
- package/dist/esm/utilities/segmentation/floodFill.d.ts +1 -1
- package/dist/esm/utilities/segmentation/getBrushToolInstances.d.ts +1 -0
- package/dist/esm/utilities/segmentation/getBrushToolInstances.js +17 -0
- package/dist/esm/utilities/segmentation/getDefaultRepresentationConfig.d.ts +1 -1
- package/dist/esm/utilities/segmentation/getSegmentIndexAtLabelmapBorder.js +8 -5
- package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.d.ts +1 -1
- package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.js +7 -4
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.d.ts +0 -2
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +7 -27
- package/dist/esm/utilities/segmentation/index.d.ts +3 -3
- package/dist/esm/utilities/segmentation/index.js +3 -3
- package/dist/esm/utilities/segmentation/invalidateBrushCursor.js +1 -4
- package/dist/esm/utilities/segmentation/isValidRepresentationConfig.d.ts +1 -1
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.d.ts +1 -1
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.js +5 -3
- package/dist/esm/utilities/segmentation/segmentContourAction.d.ts +1 -1
- package/dist/esm/utilities/segmentation/segmentContourAction.js +9 -9
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.d.ts +2 -2
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.js +24 -17
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.d.ts +3 -3
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js +21 -12
- package/dist/esm/utilities/segmentation/utilities.d.ts +16 -3
- package/dist/esm/utilities/segmentation/utilities.js +28 -23
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.js +30 -25
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.js +3 -8
- package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.js +2 -3
- package/dist/esm/utilities/stackPrefetch/state.d.ts +20 -1
- package/dist/esm/utilities/touch/index.d.ts +1 -1
- package/dist/esm/utilities/triggerAnnotationRender.d.ts +0 -20
- package/dist/esm/utilities/triggerAnnotationRender.js +1 -112
- package/dist/esm/utilities/viewport/isViewportPreScaled.d.ts +1 -1
- package/dist/esm/utilities/viewport/isViewportPreScaled.js +2 -5
- package/dist/esm/utilities/viewport/jumpToSlice.d.ts +1 -1
- package/dist/esm/utilities/viewport/jumpToSlice.js +4 -6
- package/dist/esm/utilities/viewportFilters/filterViewportsWithToolEnabled.js +2 -2
- package/dist/esm/utilities/voi/colorbar/ColorbarCanvas.d.ts +2 -2
- package/dist/esm/utilities/voi/colorbar/ViewportColorbar.d.ts +1 -1
- package/dist/esm/utilities/voi/colorbar/ViewportColorbar.js +1 -1
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCanvasProps.d.ts +1 -1
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCommonProps.d.ts +1 -1
- package/dist/esm/utilities/voi/colorbar/types/ColorbarProps.d.ts +3 -3
- package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.d.ts +8 -0
- package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js +4 -10
- package/dist/esm/widgets/types/index.d.ts +2 -2
- package/dist/esm/workers/polySegConverters.js +65 -32
- package/dist/umd/78.index.js +1 -1
- package/dist/umd/78.index.js.map +1 -1
- package/dist/umd/985.index.js +1 -1
- package/dist/umd/985.index.js.map +1 -1
- package/dist/umd/index.js +2 -1
- package/dist/umd/index.js.LICENSE.txt +6 -0
- package/dist/umd/index.js.map +1 -1
- package/package.json +7 -8
- package/dist/esm/stateManagement/segmentation/addRepresentation.d.ts +0 -3
- package/dist/esm/stateManagement/segmentation/addRepresentations.d.ts +0 -3
- package/dist/esm/stateManagement/segmentation/addRepresentations.js +0 -9
- package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts +0 -17
- package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js +0 -54
- package/dist/esm/stateManagement/segmentation/helpers/getRepresentationRenderingConfig.d.ts +0 -2
- package/dist/esm/stateManagement/segmentation/helpers/getRepresentationRenderingConfig.js +0 -11
- package/dist/esm/stateManagement/segmentation/removeRepresentationsFromViewport.d.ts +0 -2
- package/dist/esm/tools/AdvancedMagnifyViewport.d.ts +0 -76
- package/dist/esm/tools/AdvancedMagnifyViewport.js +0 -351
- package/dist/esm/tools/AdvancedMagnifyViewportManager.d.ts +0 -37
- package/dist/esm/tools/AdvancedMagnifyViewportManager.js +0 -161
- package/dist/esm/utilities/contours/interpolation/index.d.ts +0 -2
- package/dist/esm/utilities/contours/interpolation/index.js +0 -2
- package/dist/esm/utilities/pointInShapeCallback.d.ts +0 -18
- package/dist/esm/utilities/pointInShapeCallback.js +0 -82
- package/dist/esm/utilities/pointInSurroundingSphereCallback.d.ts +0 -4
- package/dist/esm/utilities/pointInSurroundingSphereCallback.js +0 -63
- package/dist/esm/utilities/segmentation/triggerSegmentationRender.d.ts +0 -3
- package/dist/esm/utilities/segmentation/triggerSegmentationRender.js +0 -6
- package/dist/esm/utilities/segmentation/triggerSegmentationRenderForViewports.d.ts +0 -3
- package/dist/esm/utilities/segmentation/triggerSegmentationRenderForViewports.js +0 -6
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import { AnnotationTool } from './base';
|
|
2
|
-
import { getEnabledElement, utilities as csUtils } from '@cornerstonejs/core';
|
|
2
|
+
import { getEnabledElement, utilities as csUtils, eventTarget, Enums, getRenderingEngine, CONSTANTS, getEnabledElementByViewportId, } from '@cornerstonejs/core';
|
|
3
3
|
import { addAnnotation, getAllAnnotations, getAnnotations, removeAnnotation, } from '../stateManagement/annotation/annotationState';
|
|
4
4
|
import { isAnnotationLocked } from '../stateManagement/annotation/annotationLocking';
|
|
5
5
|
import { isAnnotationVisible } from '../stateManagement/annotation/annotationVisibility';
|
|
6
6
|
import { triggerAnnotationCompleted } from '../stateManagement/annotation/helpers/state';
|
|
7
7
|
import { drawCircle as drawCircleSvg, drawHandles as drawHandlesSvg, } from '../drawingSvg';
|
|
8
|
-
import { state } from '../store';
|
|
9
|
-
import { Events, MouseBindings, KeyboardBindings } from '../enums';
|
|
8
|
+
import { state } from '../store/state';
|
|
9
|
+
import { Events, MouseBindings, KeyboardBindings, Events as cstEvents, SegmentationRepresentations, ToolModes, } from '../enums';
|
|
10
10
|
import { getViewportIdsWithToolToRender } from '../utilities/viewportFilters';
|
|
11
11
|
import { resetElementCursor, hideElementCursor, } from '../cursors/elementCursor';
|
|
12
12
|
import triggerAnnotationRenderForViewportIds from '../utilities/triggerAnnotationRenderForViewportIds';
|
|
13
13
|
import { getCanvasCircleRadius } from '../utilities/math/circle';
|
|
14
|
-
import
|
|
14
|
+
import { vec2, vec3 } from 'gl-matrix';
|
|
15
|
+
import { getToolGroupForViewport } from '../store/ToolGroupManager';
|
|
16
|
+
import debounce from '../utilities/debounce';
|
|
17
|
+
import { distanceToPoint } from '../utilities/math/point';
|
|
18
|
+
import { addSegmentationRepresentations } from '../stateManagement';
|
|
19
|
+
const MAGNIFY_CLASSNAME = 'advancedMagnifyTool';
|
|
20
|
+
const MAGNIFY_VIEWPORT_INITIAL_RADIUS = 125;
|
|
21
|
+
const { Events: csEvents } = Enums;
|
|
22
|
+
const isSegmentation = (actor) => actor.uid !== actor.referencedId;
|
|
15
23
|
var AdvancedMagnifyToolActions;
|
|
16
24
|
(function (AdvancedMagnifyToolActions) {
|
|
17
25
|
AdvancedMagnifyToolActions["ShowZoomFactorsList"] = "showZoomFactorsList";
|
|
18
26
|
})(AdvancedMagnifyToolActions || (AdvancedMagnifyToolActions = {}));
|
|
27
|
+
const ADVANCED_MAGNIFY_TOOL_NAME = 'AdvancedMagnify';
|
|
28
|
+
const PARALLEL_THRESHOLD = 1 - CONSTANTS.EPSILON;
|
|
19
29
|
class AdvancedMagnifyTool extends AnnotationTool {
|
|
20
30
|
static { this.Actions = AdvancedMagnifyToolActions; }
|
|
21
31
|
constructor(toolProps = {}, defaultToolProps = {
|
|
@@ -421,5 +431,497 @@ class AdvancedMagnifyTool extends AnnotationTool {
|
|
|
421
431
|
return dropdown;
|
|
422
432
|
}
|
|
423
433
|
}
|
|
434
|
+
class AdvancedMagnifyViewportManager {
|
|
435
|
+
constructor() {
|
|
436
|
+
this.createViewport = (annotation, viewportInfo) => {
|
|
437
|
+
const { magnifyViewportId, sourceEnabledElement, position, radius, zoomFactor, autoPan, } = viewportInfo;
|
|
438
|
+
const { viewport: sourceViewport } = sourceEnabledElement;
|
|
439
|
+
const { element: sourceElement } = sourceViewport;
|
|
440
|
+
const magnifyViewport = new AdvancedMagnifyViewport({
|
|
441
|
+
magnifyViewportId,
|
|
442
|
+
sourceEnabledElement,
|
|
443
|
+
radius,
|
|
444
|
+
position,
|
|
445
|
+
zoomFactor,
|
|
446
|
+
autoPan,
|
|
447
|
+
});
|
|
448
|
+
this._addSourceElementEventListener(sourceElement);
|
|
449
|
+
this._magnifyViewportsMap.set(magnifyViewport.viewportId, {
|
|
450
|
+
annotation,
|
|
451
|
+
magnifyViewport,
|
|
452
|
+
magnifyViewportInfo: viewportInfo,
|
|
453
|
+
});
|
|
454
|
+
return magnifyViewport;
|
|
455
|
+
};
|
|
456
|
+
this._annotationRemovedCallback = (evt) => {
|
|
457
|
+
const { annotation } = evt.detail;
|
|
458
|
+
if (annotation.metadata.toolName !== ADVANCED_MAGNIFY_TOOL_NAME) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
this.destroyViewport(annotation.data.magnifyViewportId);
|
|
462
|
+
};
|
|
463
|
+
this._newStackImageCallback = (evt) => {
|
|
464
|
+
const { viewportId: sourceViewportId, imageId } = evt.detail;
|
|
465
|
+
const magnifyViewportsMapEntries = this._getMagnifyViewportsMapEntriesBySourceViewportId(sourceViewportId);
|
|
466
|
+
const { viewport } = getEnabledElementByViewportId(sourceViewportId);
|
|
467
|
+
if (viewport.stackActorReInitialized) {
|
|
468
|
+
this._reset(sourceViewportId);
|
|
469
|
+
}
|
|
470
|
+
magnifyViewportsMapEntries.forEach(({ annotation }) => {
|
|
471
|
+
annotation.metadata.referencedImageId = imageId;
|
|
472
|
+
annotation.invalidated = true;
|
|
473
|
+
});
|
|
474
|
+
};
|
|
475
|
+
this._newVolumeImageCallback = (evt) => {
|
|
476
|
+
const { renderingEngineId, viewportId: sourceViewportId } = evt.detail;
|
|
477
|
+
const renderingEngine = getRenderingEngine(renderingEngineId);
|
|
478
|
+
const sourceViewport = renderingEngine.getViewport(sourceViewportId);
|
|
479
|
+
const { viewPlaneNormal: currentViewPlaneNormal } = sourceViewport.getCamera();
|
|
480
|
+
const magnifyViewportsMapEntries = this._getMagnifyViewportsMapEntriesBySourceViewportId(sourceViewportId);
|
|
481
|
+
magnifyViewportsMapEntries.forEach(({ annotation }) => {
|
|
482
|
+
const { viewPlaneNormal } = annotation.metadata;
|
|
483
|
+
const isParallel = Math.abs(vec3.dot(viewPlaneNormal, currentViewPlaneNormal)) >
|
|
484
|
+
PARALLEL_THRESHOLD;
|
|
485
|
+
if (!isParallel) {
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
const { handles } = annotation.data;
|
|
489
|
+
const worldImagePlanePoint = sourceViewport.canvasToWorld([0, 0]);
|
|
490
|
+
const vecHandleToImagePlane = vec3.sub(vec3.create(), worldImagePlanePoint, handles.points[0]);
|
|
491
|
+
const worldDist = vec3.dot(vecHandleToImagePlane, currentViewPlaneNormal);
|
|
492
|
+
const worldDelta = vec3.scale(vec3.create(), currentViewPlaneNormal, worldDist);
|
|
493
|
+
for (let i = 0, len = handles.points.length; i < len; i++) {
|
|
494
|
+
const point = handles.points[i];
|
|
495
|
+
point[0] += worldDelta[0];
|
|
496
|
+
point[1] += worldDelta[1];
|
|
497
|
+
point[2] += worldDelta[2];
|
|
498
|
+
}
|
|
499
|
+
annotation.invalidated = true;
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
this._magnifyViewportsMap = new Map();
|
|
503
|
+
this._initialize();
|
|
504
|
+
}
|
|
505
|
+
static getInstance() {
|
|
506
|
+
AdvancedMagnifyViewportManager._singleton =
|
|
507
|
+
AdvancedMagnifyViewportManager._singleton ??
|
|
508
|
+
new AdvancedMagnifyViewportManager();
|
|
509
|
+
return AdvancedMagnifyViewportManager._singleton;
|
|
510
|
+
}
|
|
511
|
+
getViewport(magnifyViewportId) {
|
|
512
|
+
return this._magnifyViewportsMap.get(magnifyViewportId)?.magnifyViewport;
|
|
513
|
+
}
|
|
514
|
+
dispose() {
|
|
515
|
+
this._removeEventListeners();
|
|
516
|
+
this._destroyViewports();
|
|
517
|
+
}
|
|
518
|
+
destroyViewport(magnifyViewportId) {
|
|
519
|
+
const magnifyViewportMapEntry = this._magnifyViewportsMap.get(magnifyViewportId);
|
|
520
|
+
if (magnifyViewportMapEntry) {
|
|
521
|
+
const { magnifyViewport } = magnifyViewportMapEntry;
|
|
522
|
+
const { viewport: sourceViewport } = magnifyViewport.sourceEnabledElement;
|
|
523
|
+
const { element: sourceElement } = sourceViewport;
|
|
524
|
+
this._removeSourceElementEventListener(sourceElement);
|
|
525
|
+
magnifyViewport.dispose();
|
|
526
|
+
this._magnifyViewportsMap.delete(magnifyViewportId);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
_destroyViewports() {
|
|
530
|
+
const magnifyViewportIds = Array.from(this._magnifyViewportsMap.keys());
|
|
531
|
+
magnifyViewportIds.forEach((magnifyViewportId) => this.destroyViewport(magnifyViewportId));
|
|
532
|
+
}
|
|
533
|
+
_getMagnifyViewportsMapEntriesBySourceViewportId(sourceViewportId) {
|
|
534
|
+
const magnifyViewportsMapEntries = Array.from(this._magnifyViewportsMap.values());
|
|
535
|
+
return magnifyViewportsMapEntries.filter(({ magnifyViewport }) => {
|
|
536
|
+
const { viewport } = magnifyViewport.sourceEnabledElement;
|
|
537
|
+
return viewport.id === sourceViewportId;
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
_reset(sourceViewportId) {
|
|
541
|
+
const magnifyViewports = this._getMagnifyViewportsMapEntriesBySourceViewportId(sourceViewportId);
|
|
542
|
+
magnifyViewports.forEach(({ magnifyViewport, annotation, magnifyViewportInfo }) => {
|
|
543
|
+
this.destroyViewport(magnifyViewport.viewportId);
|
|
544
|
+
const newEnabledElement = getEnabledElementByViewportId(sourceViewportId);
|
|
545
|
+
this.createViewport(annotation, {
|
|
546
|
+
...magnifyViewportInfo,
|
|
547
|
+
sourceEnabledElement: {
|
|
548
|
+
...newEnabledElement,
|
|
549
|
+
},
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
_addEventListeners() {
|
|
554
|
+
eventTarget.addEventListener(cstEvents.ANNOTATION_REMOVED, this._annotationRemovedCallback);
|
|
555
|
+
}
|
|
556
|
+
_removeEventListeners() {
|
|
557
|
+
eventTarget.removeEventListener(cstEvents.ANNOTATION_REMOVED, this._annotationRemovedCallback);
|
|
558
|
+
}
|
|
559
|
+
_addSourceElementEventListener(element) {
|
|
560
|
+
element.addEventListener(csEvents.STACK_NEW_IMAGE, this._newStackImageCallback);
|
|
561
|
+
const newStackHandler = (evt) => {
|
|
562
|
+
const { viewportId: sourceViewportId } = evt.detail;
|
|
563
|
+
this._reset(sourceViewportId);
|
|
564
|
+
};
|
|
565
|
+
element.addEventListener(csEvents.STACK_VIEWPORT_NEW_STACK, newStackHandler);
|
|
566
|
+
const newVolumeHandler = (evt) => {
|
|
567
|
+
const { viewportId: sourceViewportId } = evt.detail;
|
|
568
|
+
this._reset(sourceViewportId);
|
|
569
|
+
};
|
|
570
|
+
element.addEventListener(csEvents.VOLUME_VIEWPORT_NEW_VOLUME, newVolumeHandler);
|
|
571
|
+
element.addEventListener(csEvents.VOLUME_NEW_IMAGE, this._newVolumeImageCallback);
|
|
572
|
+
element.newStackHandler = newStackHandler;
|
|
573
|
+
element.newVolumeHandler = newVolumeHandler;
|
|
574
|
+
}
|
|
575
|
+
_removeSourceElementEventListener(element) {
|
|
576
|
+
element.removeEventListener(csEvents.STACK_NEW_IMAGE, this._newStackImageCallback);
|
|
577
|
+
element.removeEventListener(csEvents.VOLUME_NEW_IMAGE, this._newVolumeImageCallback);
|
|
578
|
+
element.removeEventListener(csEvents.STACK_VIEWPORT_NEW_STACK, element.newStackHandler);
|
|
579
|
+
element.removeEventListener(csEvents.VOLUME_VIEWPORT_NEW_VOLUME, element.newVolumeHandler);
|
|
580
|
+
delete element.newStackHandler;
|
|
581
|
+
delete element.newVolumeHandler;
|
|
582
|
+
}
|
|
583
|
+
_initialize() {
|
|
584
|
+
this._addEventListeners();
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
class AdvancedMagnifyViewport {
|
|
588
|
+
constructor({ magnifyViewportId, sourceEnabledElement, radius = MAGNIFY_VIEWPORT_INITIAL_RADIUS, position = [0, 0], zoomFactor, autoPan, }) {
|
|
589
|
+
this._enabledElement = null;
|
|
590
|
+
this._sourceToolGroup = null;
|
|
591
|
+
this._magnifyToolGroup = null;
|
|
592
|
+
this._isViewportReady = false;
|
|
593
|
+
this._radius = 0;
|
|
594
|
+
this._resized = false;
|
|
595
|
+
this._canAutoPan = false;
|
|
596
|
+
this._viewportId = magnifyViewportId ?? csUtils.uuidv4();
|
|
597
|
+
this._sourceEnabledElement = sourceEnabledElement;
|
|
598
|
+
this._autoPan = autoPan;
|
|
599
|
+
this.radius = radius;
|
|
600
|
+
this.position = position;
|
|
601
|
+
this.zoomFactor = zoomFactor;
|
|
602
|
+
this.visible = true;
|
|
603
|
+
this._browserMouseDownCallback = this._browserMouseDownCallback.bind(this);
|
|
604
|
+
this._browserMouseUpCallback = this._browserMouseUpCallback.bind(this);
|
|
605
|
+
this._handleToolModeChanged = this._handleToolModeChanged.bind(this);
|
|
606
|
+
this._mouseDragCallback = this._mouseDragCallback.bind(this);
|
|
607
|
+
this._resizeViewportAsync = (debounce(this._resizeViewport.bind(this), 1));
|
|
608
|
+
this._initialize();
|
|
609
|
+
}
|
|
610
|
+
get sourceEnabledElement() {
|
|
611
|
+
return this._sourceEnabledElement;
|
|
612
|
+
}
|
|
613
|
+
get viewportId() {
|
|
614
|
+
return this._viewportId;
|
|
615
|
+
}
|
|
616
|
+
get radius() {
|
|
617
|
+
return this._radius;
|
|
618
|
+
}
|
|
619
|
+
set radius(radius) {
|
|
620
|
+
if (Math.abs(this._radius - radius) > 0.00001) {
|
|
621
|
+
this._radius = radius;
|
|
622
|
+
this._resized = true;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
update() {
|
|
626
|
+
const { radius, position, visible } = this;
|
|
627
|
+
const { viewport } = this._enabledElement;
|
|
628
|
+
const { element } = viewport;
|
|
629
|
+
const size = 2 * radius;
|
|
630
|
+
const [x, y] = position;
|
|
631
|
+
if (this._resized) {
|
|
632
|
+
this._resizeViewportAsync();
|
|
633
|
+
this._resized = false;
|
|
634
|
+
}
|
|
635
|
+
Object.assign(element.style, {
|
|
636
|
+
display: visible ? 'block' : 'hidden',
|
|
637
|
+
width: `${size}px`,
|
|
638
|
+
height: `${size}px`,
|
|
639
|
+
left: `${-radius}px`,
|
|
640
|
+
top: `${-radius}px`,
|
|
641
|
+
transform: `translate(${x}px, ${y}px)`,
|
|
642
|
+
});
|
|
643
|
+
if (this._isViewportReady) {
|
|
644
|
+
this._syncViewports();
|
|
645
|
+
viewport.render();
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
dispose() {
|
|
649
|
+
const { viewport } = this._enabledElement;
|
|
650
|
+
const { element } = viewport;
|
|
651
|
+
const renderingEngine = viewport.getRenderingEngine();
|
|
652
|
+
this._removeEventListeners(element);
|
|
653
|
+
renderingEngine.disableElement(viewport.id);
|
|
654
|
+
if (element.parentNode) {
|
|
655
|
+
element.parentNode.removeChild(element);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
_handleToolModeChanged(evt) {
|
|
659
|
+
const { _magnifyToolGroup: magnifyToolGroup } = this;
|
|
660
|
+
const { toolGroupId, toolName, mode, toolBindingsOptions } = evt.detail;
|
|
661
|
+
if (this._sourceToolGroup?.id !== toolGroupId) {
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
switch (mode) {
|
|
665
|
+
case ToolModes.Active:
|
|
666
|
+
magnifyToolGroup.setToolActive(toolName, toolBindingsOptions);
|
|
667
|
+
break;
|
|
668
|
+
case ToolModes.Passive:
|
|
669
|
+
magnifyToolGroup.setToolPassive(toolName);
|
|
670
|
+
break;
|
|
671
|
+
case ToolModes.Enabled:
|
|
672
|
+
magnifyToolGroup.setToolEnabled(toolName);
|
|
673
|
+
break;
|
|
674
|
+
case ToolModes.Disabled:
|
|
675
|
+
magnifyToolGroup.setToolDisabled(toolName);
|
|
676
|
+
break;
|
|
677
|
+
default:
|
|
678
|
+
throw new Error(`Unknow tool mode (${mode})`);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
_inheritBorderRadius(magnifyElement) {
|
|
682
|
+
const viewport = magnifyElement.querySelector('.viewport-element');
|
|
683
|
+
const canvas = magnifyElement.querySelector('.cornerstone-canvas');
|
|
684
|
+
viewport.style.borderRadius = 'inherit';
|
|
685
|
+
canvas.style.borderRadius = 'inherit';
|
|
686
|
+
}
|
|
687
|
+
_createViewportNode() {
|
|
688
|
+
const magnifyElement = document.createElement('div');
|
|
689
|
+
const { radius } = this;
|
|
690
|
+
const size = radius * 2;
|
|
691
|
+
magnifyElement.classList.add(MAGNIFY_CLASSNAME);
|
|
692
|
+
Object.assign(magnifyElement.style, {
|
|
693
|
+
display: 'block',
|
|
694
|
+
width: `${size}px`,
|
|
695
|
+
height: `${size}px`,
|
|
696
|
+
position: 'absolute',
|
|
697
|
+
overflow: 'hidden',
|
|
698
|
+
borderRadius: '50%',
|
|
699
|
+
boxSizing: 'border-box',
|
|
700
|
+
left: `${-radius}px`,
|
|
701
|
+
top: `${-radius}px`,
|
|
702
|
+
transform: `translate(-1000px, -1000px)`,
|
|
703
|
+
});
|
|
704
|
+
return magnifyElement;
|
|
705
|
+
}
|
|
706
|
+
_convertZoomFactorToParallelScale(viewport, magnifyViewport, zoomFactor) {
|
|
707
|
+
const { parallelScale } = viewport.getCamera();
|
|
708
|
+
const canvasRatio = magnifyViewport.canvas.offsetWidth / viewport.canvas.offsetWidth;
|
|
709
|
+
return parallelScale * (1 / zoomFactor) * canvasRatio;
|
|
710
|
+
}
|
|
711
|
+
_isStackViewport(viewport) {
|
|
712
|
+
return 'setStack' in viewport;
|
|
713
|
+
}
|
|
714
|
+
_isVolumeViewport(viewport) {
|
|
715
|
+
return 'addVolumes' in viewport;
|
|
716
|
+
}
|
|
717
|
+
_cloneToolGroups(sourceViewport, magnifyViewport) {
|
|
718
|
+
const sourceActors = sourceViewport.getActors();
|
|
719
|
+
const magnifyToolGroupId = `${magnifyViewport.id}-toolGroup`;
|
|
720
|
+
const sourceToolGroup = getToolGroupForViewport(sourceViewport.id, sourceViewport.renderingEngineId);
|
|
721
|
+
const magnifyToolGroup = sourceToolGroup.clone(magnifyToolGroupId, (toolName) => {
|
|
722
|
+
const toolInstance = sourceToolGroup.getToolInstance(toolName);
|
|
723
|
+
const isAnnotationTool = toolInstance instanceof AnnotationTool &&
|
|
724
|
+
!(toolInstance instanceof AdvancedMagnifyTool);
|
|
725
|
+
return isAnnotationTool;
|
|
726
|
+
});
|
|
727
|
+
magnifyToolGroup.addViewport(magnifyViewport.id, magnifyViewport.renderingEngineId);
|
|
728
|
+
sourceActors.filter(isSegmentation).forEach((actor) => {
|
|
729
|
+
addSegmentationRepresentations(this.viewportId, [
|
|
730
|
+
{
|
|
731
|
+
segmentationId: actor.referencedId,
|
|
732
|
+
type: SegmentationRepresentations.Labelmap,
|
|
733
|
+
},
|
|
734
|
+
]);
|
|
735
|
+
});
|
|
736
|
+
return { sourceToolGroup, magnifyToolGroup };
|
|
737
|
+
}
|
|
738
|
+
_cloneStack(sourceViewport, magnifyViewport) {
|
|
739
|
+
const imageIds = sourceViewport.getImageIds();
|
|
740
|
+
magnifyViewport.setStack(imageIds).then(() => {
|
|
741
|
+
this._isViewportReady = true;
|
|
742
|
+
this.update();
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
_cloneVolumes(sourceViewport, magnifyViewport) {
|
|
746
|
+
const actors = sourceViewport.getActors();
|
|
747
|
+
const volumeInputArray = actors
|
|
748
|
+
.filter((actor) => !isSegmentation(actor))
|
|
749
|
+
.map((actor) => ({ volumeId: actor.uid }));
|
|
750
|
+
magnifyViewport.setVolumes(volumeInputArray).then(() => {
|
|
751
|
+
this._isViewportReady = true;
|
|
752
|
+
this.update();
|
|
753
|
+
});
|
|
754
|
+
return magnifyViewport;
|
|
755
|
+
}
|
|
756
|
+
_cloneViewport(sourceViewport, magnifyElement) {
|
|
757
|
+
const { viewportId: magnifyViewportId } = this;
|
|
758
|
+
const renderingEngine = sourceViewport.getRenderingEngine();
|
|
759
|
+
const { options: sourceViewportOptions } = sourceViewport;
|
|
760
|
+
const viewportInput = {
|
|
761
|
+
element: magnifyElement,
|
|
762
|
+
viewportId: magnifyViewportId,
|
|
763
|
+
type: sourceViewport.type,
|
|
764
|
+
defaultOptions: { ...sourceViewportOptions },
|
|
765
|
+
};
|
|
766
|
+
renderingEngine.enableElement(viewportInput);
|
|
767
|
+
const magnifyViewport = (renderingEngine.getViewport(magnifyViewportId));
|
|
768
|
+
if (this._isStackViewport(sourceViewport)) {
|
|
769
|
+
this._cloneStack(sourceViewport, magnifyViewport);
|
|
770
|
+
}
|
|
771
|
+
else if (this._isVolumeViewport(sourceViewport)) {
|
|
772
|
+
this._cloneVolumes(sourceViewport, magnifyViewport);
|
|
773
|
+
}
|
|
774
|
+
this._inheritBorderRadius(magnifyElement);
|
|
775
|
+
const toolGroups = this._cloneToolGroups(sourceViewport, magnifyViewport);
|
|
776
|
+
this._sourceToolGroup = toolGroups.sourceToolGroup;
|
|
777
|
+
this._magnifyToolGroup = toolGroups.magnifyToolGroup;
|
|
778
|
+
}
|
|
779
|
+
_cancelMouseEventCallback(evt) {
|
|
780
|
+
evt.stopPropagation();
|
|
781
|
+
evt.preventDefault();
|
|
782
|
+
}
|
|
783
|
+
_browserMouseUpCallback(evt) {
|
|
784
|
+
const { element } = this._enabledElement.viewport;
|
|
785
|
+
document.removeEventListener('mouseup', this._browserMouseUpCallback);
|
|
786
|
+
element.addEventListener('mouseup', this._cancelMouseEventCallback);
|
|
787
|
+
element.addEventListener('mousemove', this._cancelMouseEventCallback);
|
|
788
|
+
}
|
|
789
|
+
_browserMouseDownCallback(evt) {
|
|
790
|
+
const { element } = this._enabledElement.viewport;
|
|
791
|
+
this._canAutoPan = !!evt.target?.closest('.advancedMagnifyTool');
|
|
792
|
+
document.addEventListener('mouseup', this._browserMouseUpCallback);
|
|
793
|
+
element.removeEventListener('mouseup', this._cancelMouseEventCallback);
|
|
794
|
+
element.removeEventListener('mousemove', this._cancelMouseEventCallback);
|
|
795
|
+
}
|
|
796
|
+
_mouseDragCallback(evt) {
|
|
797
|
+
if (!state.isInteractingWithTool) {
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
const { _autoPan: autoPan } = this;
|
|
801
|
+
if (!autoPan.enabled || !this._canAutoPan) {
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
const { currentPoints } = evt.detail;
|
|
805
|
+
const { viewport } = this._enabledElement;
|
|
806
|
+
const { canvasToWorld } = viewport;
|
|
807
|
+
const { canvas: canvasCurrent } = currentPoints;
|
|
808
|
+
const { radius: magnifyRadius } = this;
|
|
809
|
+
const canvasCenter = [magnifyRadius, magnifyRadius];
|
|
810
|
+
const dist = distanceToPoint(canvasCenter, canvasCurrent);
|
|
811
|
+
const maxDist = magnifyRadius - autoPan.padding;
|
|
812
|
+
if (dist <= maxDist) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
815
|
+
const panDist = dist - maxDist;
|
|
816
|
+
const canvasDeltaPos = vec2.sub(vec2.create(), canvasCurrent, canvasCenter);
|
|
817
|
+
vec2.normalize(canvasDeltaPos, canvasDeltaPos);
|
|
818
|
+
vec2.scale(canvasDeltaPos, canvasDeltaPos, panDist);
|
|
819
|
+
const newCanvasPosition = vec2.add(vec2.create(), this.position, canvasDeltaPos);
|
|
820
|
+
const currentWorldPos = canvasToWorld(this.position);
|
|
821
|
+
const newWorldPos = canvasToWorld(newCanvasPosition);
|
|
822
|
+
const worldDeltaPos = vec3.sub(vec3.create(), newWorldPos, currentWorldPos);
|
|
823
|
+
const autoPanCallbackData = {
|
|
824
|
+
points: {
|
|
825
|
+
currentPosition: {
|
|
826
|
+
canvas: this.position,
|
|
827
|
+
world: currentWorldPos,
|
|
828
|
+
},
|
|
829
|
+
newPosition: {
|
|
830
|
+
canvas: newCanvasPosition,
|
|
831
|
+
world: newWorldPos,
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
delta: {
|
|
835
|
+
canvas: canvasDeltaPos,
|
|
836
|
+
world: worldDeltaPos,
|
|
837
|
+
},
|
|
838
|
+
};
|
|
839
|
+
autoPan.callback(autoPanCallbackData);
|
|
840
|
+
}
|
|
841
|
+
_addBrowserEventListeners(element) {
|
|
842
|
+
document.addEventListener('mousedown', this._browserMouseDownCallback, true);
|
|
843
|
+
element.addEventListener('mousedown', this._cancelMouseEventCallback);
|
|
844
|
+
element.addEventListener('mouseup', this._cancelMouseEventCallback);
|
|
845
|
+
element.addEventListener('mousemove', this._cancelMouseEventCallback);
|
|
846
|
+
element.addEventListener('dblclick', this._cancelMouseEventCallback);
|
|
847
|
+
}
|
|
848
|
+
_removeBrowserEventListeners(element) {
|
|
849
|
+
document.removeEventListener('mousedown', this._browserMouseDownCallback, true);
|
|
850
|
+
document.removeEventListener('mouseup', this._browserMouseUpCallback);
|
|
851
|
+
element.removeEventListener('mousedown', this._cancelMouseEventCallback);
|
|
852
|
+
element.removeEventListener('mouseup', this._cancelMouseEventCallback);
|
|
853
|
+
element.removeEventListener('mousemove', this._cancelMouseEventCallback);
|
|
854
|
+
element.removeEventListener('dblclick', this._cancelMouseEventCallback);
|
|
855
|
+
}
|
|
856
|
+
_addEventListeners(element) {
|
|
857
|
+
eventTarget.addEventListener(cstEvents.TOOL_MODE_CHANGED, this._handleToolModeChanged);
|
|
858
|
+
element.addEventListener(cstEvents.MOUSE_MOVE, this._mouseDragCallback);
|
|
859
|
+
element.addEventListener(cstEvents.MOUSE_DRAG, this._mouseDragCallback);
|
|
860
|
+
this._addBrowserEventListeners(element);
|
|
861
|
+
}
|
|
862
|
+
_removeEventListeners(element) {
|
|
863
|
+
eventTarget.removeEventListener(cstEvents.TOOL_MODE_CHANGED, this._handleToolModeChanged);
|
|
864
|
+
element.addEventListener(cstEvents.MOUSE_MOVE, this._mouseDragCallback);
|
|
865
|
+
element.addEventListener(cstEvents.MOUSE_DRAG, this._mouseDragCallback);
|
|
866
|
+
this._removeBrowserEventListeners(element);
|
|
867
|
+
}
|
|
868
|
+
_initialize() {
|
|
869
|
+
const { _sourceEnabledElement: sourceEnabledElement } = this;
|
|
870
|
+
const { viewport: sourceViewport } = sourceEnabledElement;
|
|
871
|
+
const { canvas: sourceCanvas } = sourceViewport;
|
|
872
|
+
const magnifyElement = this._createViewportNode();
|
|
873
|
+
sourceCanvas.parentNode.appendChild(magnifyElement);
|
|
874
|
+
this._addEventListeners(magnifyElement);
|
|
875
|
+
this._cloneViewport(sourceViewport, magnifyElement);
|
|
876
|
+
this._enabledElement = getEnabledElement(magnifyElement);
|
|
877
|
+
}
|
|
878
|
+
_syncViewportsCameras(sourceViewport, magnifyViewport) {
|
|
879
|
+
const worldPos = sourceViewport.canvasToWorld(this.position);
|
|
880
|
+
const parallelScale = this._convertZoomFactorToParallelScale(sourceViewport, magnifyViewport, this.zoomFactor);
|
|
881
|
+
const { focalPoint, position, viewPlaneNormal } = magnifyViewport.getCamera();
|
|
882
|
+
const distance = Math.sqrt(Math.pow(focalPoint[0] - position[0], 2) +
|
|
883
|
+
Math.pow(focalPoint[1] - position[1], 2) +
|
|
884
|
+
Math.pow(focalPoint[2] - position[2], 2));
|
|
885
|
+
const updatedFocalPoint = [
|
|
886
|
+
worldPos[0],
|
|
887
|
+
worldPos[1],
|
|
888
|
+
worldPos[2],
|
|
889
|
+
];
|
|
890
|
+
const updatedPosition = [
|
|
891
|
+
updatedFocalPoint[0] + distance * viewPlaneNormal[0],
|
|
892
|
+
updatedFocalPoint[1] + distance * viewPlaneNormal[1],
|
|
893
|
+
updatedFocalPoint[2] + distance * viewPlaneNormal[2],
|
|
894
|
+
];
|
|
895
|
+
magnifyViewport.setCamera({
|
|
896
|
+
parallelScale,
|
|
897
|
+
focalPoint: updatedFocalPoint,
|
|
898
|
+
position: updatedPosition,
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
_syncStackViewports(sourceViewport, magnifyViewport) {
|
|
902
|
+
magnifyViewport.setImageIdIndex(sourceViewport.getCurrentImageIdIndex());
|
|
903
|
+
}
|
|
904
|
+
_syncViewports() {
|
|
905
|
+
const { viewport: sourceViewport } = this._sourceEnabledElement;
|
|
906
|
+
const { viewport: magnifyViewport } = this._enabledElement;
|
|
907
|
+
const sourceProperties = sourceViewport.getProperties();
|
|
908
|
+
const imageData = magnifyViewport.getImageData();
|
|
909
|
+
if (!imageData) {
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
magnifyViewport.setProperties(sourceProperties);
|
|
913
|
+
this._syncViewportsCameras(sourceViewport, magnifyViewport);
|
|
914
|
+
if (this._isStackViewport(sourceViewport)) {
|
|
915
|
+
this._syncStackViewports(sourceViewport, magnifyViewport);
|
|
916
|
+
}
|
|
917
|
+
this._syncViewportsCameras(sourceViewport, magnifyViewport);
|
|
918
|
+
magnifyViewport.render();
|
|
919
|
+
}
|
|
920
|
+
_resizeViewport() {
|
|
921
|
+
const { viewport } = this._enabledElement;
|
|
922
|
+
const renderingEngine = viewport.getRenderingEngine();
|
|
923
|
+
renderingEngine.resize();
|
|
924
|
+
}
|
|
925
|
+
}
|
|
424
926
|
AdvancedMagnifyTool.toolName = 'AdvancedMagnify';
|
|
425
927
|
export { AdvancedMagnifyTool as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseTool } from './base';
|
|
2
|
-
import { EventTypes, PublicToolProps, ToolProps } from '../types';
|
|
2
|
+
import type { EventTypes, PublicToolProps, ToolProps } from '../types';
|
|
3
3
|
declare class AnnotationEraserTool extends BaseTool {
|
|
4
4
|
static toolName: any;
|
|
5
5
|
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseTool } from './base';
|
|
2
|
-
import { ToolGroupManager } from '../store';
|
|
3
2
|
import { getAnnotations, removeAnnotation, } from '../stateManagement/annotation/annotationState';
|
|
4
3
|
import { setAnnotationSelected } from '../stateManagement/annotation/annotationSelection';
|
|
4
|
+
import { getToolGroupForViewport } from '../store/ToolGroupManager';
|
|
5
5
|
class AnnotationEraserTool extends BaseTool {
|
|
6
6
|
constructor(toolProps = {}, defaultToolProps = {
|
|
7
7
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -16,7 +16,7 @@ class AnnotationEraserTool extends BaseTool {
|
|
|
16
16
|
}
|
|
17
17
|
_deleteNearbyAnnotations(evt, interactionType) {
|
|
18
18
|
const { renderingEngineId, viewportId, element, currentPoints } = evt.detail;
|
|
19
|
-
const toolGroup =
|
|
19
|
+
const toolGroup = getToolGroupForViewport(viewportId, renderingEngineId);
|
|
20
20
|
if (!toolGroup) {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AnnotationTool } from './base';
|
|
2
2
|
import type { Types } from '@cornerstonejs/core';
|
|
3
|
-
import { Annotation, Annotations, EventTypes, ToolHandle, PublicToolProps, ToolProps, InteractionTypes, SVGDrawingHelper } from '../types';
|
|
3
|
+
import type { Annotation, Annotations, EventTypes, ToolHandle, PublicToolProps, ToolProps, InteractionTypes, SVGDrawingHelper } from '../types';
|
|
4
4
|
interface CrosshairsAnnotation extends Annotation {
|
|
5
5
|
data: {
|
|
6
6
|
handles: {
|
|
7
|
-
rotationPoints:
|
|
8
|
-
slabThicknessPoints:
|
|
7
|
+
rotationPoints: Types.Point3[];
|
|
8
|
+
slabThicknessPoints: Types.Point3[];
|
|
9
9
|
activeOperation: number | null;
|
|
10
10
|
toolCenter: Types.Point3;
|
|
11
11
|
};
|
|
@@ -21,7 +21,7 @@ declare class CrosshairsTool extends AnnotationTool {
|
|
|
21
21
|
_getReferenceLineDraggableRotatable?: (viewportId: string) => boolean;
|
|
22
22
|
_getReferenceLineSlabThicknessControlsOn?: (viewportId: string) => boolean;
|
|
23
23
|
editData: {
|
|
24
|
-
annotation:
|
|
24
|
+
annotation: Annotation;
|
|
25
25
|
} | null;
|
|
26
26
|
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
|
|
27
27
|
initializeViewport: ({ renderingEngineId, viewportId, }: Types.IViewportId) => {
|
|
@@ -47,7 +47,7 @@ declare class CrosshairsTool extends AnnotationTool {
|
|
|
47
47
|
filterInteractableAnnotationsForElement: (element: any, annotations: any) => any;
|
|
48
48
|
renderAnnotation: (enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean;
|
|
49
49
|
_getAnnotations: (enabledElement: Types.IEnabledElement) => Annotation[];
|
|
50
|
-
_onNewVolume: (
|
|
50
|
+
_onNewVolume: () => void;
|
|
51
51
|
_unsubscribeToViewportNewVolumeSet(viewportsInfo: any): void;
|
|
52
52
|
_subscribeToViewportNewVolumeSet(viewports: any): void;
|
|
53
53
|
_autoPanViewportIfNecessary(viewportId: string, renderingEngine: Types.IRenderingEngine): void;
|
|
@@ -6,7 +6,7 @@ import { getEnabledElementByIds, getEnabledElement, utilities as csUtils, Enums,
|
|
|
6
6
|
import { getToolGroup, getToolGroupForViewport, } from '../store/ToolGroupManager';
|
|
7
7
|
import { addAnnotation, getAnnotations, removeAnnotation, } from '../stateManagement/annotation/annotationState';
|
|
8
8
|
import { drawCircle as drawCircleSvg, drawHandles as drawHandlesSvg, drawLine as drawLineSvg, } from '../drawingSvg';
|
|
9
|
-
import { state } from '../store';
|
|
9
|
+
import { state } from '../store/state';
|
|
10
10
|
import { Events } from '../enums';
|
|
11
11
|
import { getViewportIdsWithToolToRender } from '../utilities/viewportFilters';
|
|
12
12
|
import { resetElementCursor, hideElementCursor, } from '../cursors/elementCursor';
|
|
@@ -105,7 +105,8 @@ class CrosshairsTool extends AnnotationTool {
|
|
|
105
105
|
};
|
|
106
106
|
this.resetCrosshairs = () => {
|
|
107
107
|
const viewportsInfo = this._getViewportsInfo();
|
|
108
|
-
|
|
108
|
+
for (const viewportInfo of viewportsInfo) {
|
|
109
|
+
const { viewportId, renderingEngineId } = viewportInfo;
|
|
109
110
|
const enabledElement = getEnabledElementByIds(viewportId, renderingEngineId);
|
|
110
111
|
const viewport = enabledElement.viewport;
|
|
111
112
|
const resetPan = true;
|
|
@@ -128,7 +129,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
|
128
129
|
removeAnnotation(annotations[0].annotationUID);
|
|
129
130
|
}
|
|
130
131
|
viewport.render();
|
|
131
|
-
}
|
|
132
|
+
}
|
|
132
133
|
this.computeToolCenter(viewportsInfo);
|
|
133
134
|
};
|
|
134
135
|
this.computeToolCenter = (viewportsInfo) => {
|
|
@@ -672,7 +673,7 @@ class CrosshairsTool extends AnnotationTool {
|
|
|
672
673
|
});
|
|
673
674
|
return toolGroupAnnotations;
|
|
674
675
|
};
|
|
675
|
-
this._onNewVolume = (
|
|
676
|
+
this._onNewVolume = () => {
|
|
676
677
|
const viewportsInfo = this._getViewportsInfo();
|
|
677
678
|
this.computeToolCenter(viewportsInfo);
|
|
678
679
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { BaseTool } from './base';
|
|
2
|
-
import { PublicToolProps, ToolProps } from '../types';
|
|
2
|
+
import type { PublicToolProps, ToolProps } from '../types';
|
|
3
3
|
declare class MIPJumpToClickTool extends BaseTool {
|
|
4
4
|
static toolName: any;
|
|
5
|
-
_bounds: any;
|
|
6
5
|
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
|
|
7
6
|
mouseClickCallback(evt: any): void;
|
|
8
7
|
}
|
|
@@ -17,11 +17,10 @@ class MIPJumpToClickTool extends BaseTool {
|
|
|
17
17
|
const { element, currentPoints } = evt.detail;
|
|
18
18
|
const enabledElement = getEnabledElement(element);
|
|
19
19
|
const { viewport, renderingEngine } = enabledElement;
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
20
|
+
const volumeId = this.getTargetVolumeId(viewport);
|
|
21
|
+
if (!volumeId) {
|
|
22
22
|
throw new Error(`MIPJumpToClickTool: targetId is not a volumeId, you should only use MIPJumpToClickTool with a volumeId as the targetId`);
|
|
23
23
|
}
|
|
24
|
-
const volumeId = utilities.getVolumeId(targetId);
|
|
25
24
|
let maxIntensity = -Infinity;
|
|
26
25
|
const maxFn = (intensity, point) => {
|
|
27
26
|
if (intensity > maxIntensity) {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { BaseTool } from './base';
|
|
2
2
|
import type { Types } from '@cornerstonejs/core';
|
|
3
|
-
import { EventTypes, PublicToolProps, ToolProps } from '../types';
|
|
4
|
-
import { IPoints } from '../types';
|
|
3
|
+
import type { EventTypes, PublicToolProps, ToolProps } from '../types';
|
|
4
|
+
import type { IPoints } from '../types';
|
|
5
5
|
declare class MagnifyTool extends BaseTool {
|
|
6
6
|
static toolName: any;
|
|
7
|
-
_bounds: any;
|
|
8
7
|
editData: {
|
|
9
8
|
referencedImageId: string;
|
|
10
9
|
viewportIdsToRender: string[];
|