@cornerstonejs/tools 3.0.2 → 3.0.3
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/LICENSE +2 -2
- package/README.md +4 -183
- package/dist/esm/config.d.ts +30 -0
- package/dist/esm/config.js +23 -0
- package/dist/esm/constants/COLOR_LUT.d.ts +3 -0
- package/dist/esm/constants/COLOR_LUT.js +258 -0
- package/dist/esm/constants/index.d.ts +2 -0
- package/dist/esm/constants/index.js +2 -0
- package/dist/esm/cursors/ImageMouseCursor.d.ts +9 -0
- package/dist/esm/cursors/ImageMouseCursor.js +22 -0
- package/dist/esm/cursors/MouseCursor.d.ts +12 -0
- package/dist/esm/cursors/MouseCursor.js +88 -0
- package/dist/esm/cursors/SVGCursorDescriptor.d.ts +9 -0
- package/dist/esm/cursors/SVGCursorDescriptor.js +442 -0
- package/dist/esm/cursors/SVGMouseCursor.d.ts +6 -0
- package/dist/esm/cursors/SVGMouseCursor.js +74 -0
- package/dist/esm/cursors/elementCursor.d.ts +6 -0
- package/dist/esm/cursors/elementCursor.js +36 -0
- package/dist/esm/cursors/index.d.ts +8 -0
- package/dist/esm/cursors/index.js +8 -0
- package/dist/esm/cursors/setCursorForElement.d.ts +2 -0
- package/dist/esm/cursors/setCursorForElement.js +15 -0
- package/dist/esm/drawingSvg/_getHash.d.ts +2 -0
- package/dist/esm/drawingSvg/_getHash.js +4 -0
- package/dist/esm/drawingSvg/clearByToolType.d.ts +2 -0
- package/dist/esm/drawingSvg/clearByToolType.js +13 -0
- package/dist/esm/drawingSvg/draw.d.ts +3 -0
- package/dist/esm/drawingSvg/draw.js +7 -0
- package/dist/esm/drawingSvg/drawArrow.d.ts +3 -0
- package/dist/esm/drawingSvg/drawArrow.js +79 -0
- package/dist/esm/drawingSvg/drawCircle.d.ts +4 -0
- package/dist/esm/drawingSvg/drawCircle.js +42 -0
- package/dist/esm/drawingSvg/drawEllipse.d.ts +4 -0
- package/dist/esm/drawingSvg/drawEllipse.js +10 -0
- package/dist/esm/drawingSvg/drawEllipseByCoordinates.d.ts +4 -0
- package/dist/esm/drawingSvg/drawEllipseByCoordinates.js +46 -0
- package/dist/esm/drawingSvg/drawHandle.d.ts +4 -0
- package/dist/esm/drawingSvg/drawHandle.js +60 -0
- package/dist/esm/drawingSvg/drawHandles.d.ts +4 -0
- package/dist/esm/drawingSvg/drawHandles.js +7 -0
- package/dist/esm/drawingSvg/drawHeight.d.ts +3 -0
- package/dist/esm/drawingSvg/drawHeight.js +45 -0
- package/dist/esm/drawingSvg/drawLine.d.ts +3 -0
- package/dist/esm/drawingSvg/drawLine.js +39 -0
- package/dist/esm/drawingSvg/drawLink.d.ts +4 -0
- package/dist/esm/drawingSvg/drawLink.js +26 -0
- package/dist/esm/drawingSvg/drawLinkedTextBox.d.ts +4 -0
- package/dist/esm/drawingSvg/drawLinkedTextBox.js +15 -0
- package/dist/esm/drawingSvg/drawPath.d.ts +11 -0
- package/dist/esm/drawingSvg/drawPath.js +48 -0
- package/dist/esm/drawingSvg/drawPolyline.d.ts +13 -0
- package/dist/esm/drawingSvg/drawPolyline.js +40 -0
- package/dist/esm/drawingSvg/drawRect.d.ts +3 -0
- package/dist/esm/drawingSvg/drawRect.js +9 -0
- package/dist/esm/drawingSvg/drawRectByCoordinates.d.ts +3 -0
- package/dist/esm/drawingSvg/drawRectByCoordinates.js +52 -0
- package/dist/esm/drawingSvg/drawRedactionRect.d.ts +3 -0
- package/dist/esm/drawingSvg/drawRedactionRect.js +37 -0
- package/dist/esm/drawingSvg/drawTextBox.d.ts +4 -0
- package/dist/esm/drawingSvg/drawTextBox.js +123 -0
- package/dist/esm/drawingSvg/getSvgDrawingHelper.d.ts +3 -0
- package/dist/esm/drawingSvg/getSvgDrawingHelper.js +65 -0
- package/dist/esm/drawingSvg/index.d.ts +19 -0
- package/dist/esm/drawingSvg/index.js +19 -0
- package/dist/esm/drawingSvg/setAttributesIfNecessary.d.ts +2 -0
- package/dist/esm/drawingSvg/setAttributesIfNecessary.js +13 -0
- package/dist/esm/drawingSvg/setNewAttributesIfValid.d.ts +2 -0
- package/dist/esm/drawingSvg/setNewAttributesIfValid.js +9 -0
- package/dist/esm/enums/AnnotationStyleStates.d.ts +8 -0
- package/dist/esm/enums/AnnotationStyleStates.js +9 -0
- package/dist/esm/enums/ChangeTypes.d.ts +11 -0
- package/dist/esm/enums/ChangeTypes.js +12 -0
- package/dist/esm/enums/Events.d.ts +42 -0
- package/dist/esm/enums/Events.js +43 -0
- package/dist/esm/enums/SegmentationRepresentations.d.ts +6 -0
- package/dist/esm/enums/SegmentationRepresentations.js +7 -0
- package/dist/esm/enums/StrategyCallbacks.d.ts +19 -0
- package/dist/esm/enums/StrategyCallbacks.js +20 -0
- package/dist/esm/enums/ToolBindings.d.ts +26 -0
- package/dist/esm/enums/ToolBindings.js +28 -0
- package/dist/esm/enums/ToolModes.d.ts +7 -0
- package/dist/esm/enums/ToolModes.js +8 -0
- package/dist/esm/enums/Touch.d.ts +7 -0
- package/dist/esm/enums/Touch.js +8 -0
- package/dist/esm/enums/WorkerTypes.d.ts +10 -0
- package/dist/esm/enums/WorkerTypes.js +11 -0
- package/dist/esm/enums/index.d.ts +11 -0
- package/dist/esm/enums/index.js +10 -0
- package/dist/esm/eventDispatchers/annotationInterpolationEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/annotationInterpolationEventDispatcher.js +17 -0
- package/dist/esm/eventDispatchers/annotationModifiedEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/annotationModifiedEventDispatcher.js +18 -0
- package/dist/esm/eventDispatchers/cameraModifiedEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/cameraModifiedEventDispatcher.js +26 -0
- package/dist/esm/eventDispatchers/cameraResetEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/cameraResetEventDispatcher.js +26 -0
- package/dist/esm/eventDispatchers/imageRenderedEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/imageRenderedEventDispatcher.js +15 -0
- package/dist/esm/eventDispatchers/imageSpacingCalibratedEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/imageSpacingCalibratedEventDispatcher.js +26 -0
- package/dist/esm/eventDispatchers/index.d.ts +9 -0
- package/dist/esm/eventDispatchers/index.js +9 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/index.d.ts +3 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/index.js +3 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.d.ts +2 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.js +25 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.d.ts +2 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.js +16 -0
- package/dist/esm/eventDispatchers/keyboardToolEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/keyboardToolEventDispatcher.js +15 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/index.d.ts +9 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/index.js +9 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseClick.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseClick.js +3 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDoubleClick.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDoubleClick.js +3 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.js +90 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.js +19 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.js +34 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDrag.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDrag.js +13 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.js +37 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseUp.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseUp.js +3 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.d.ts +3 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.js +16 -0
- package/dist/esm/eventDispatchers/mouseToolEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/mouseToolEventDispatcher.js +27 -0
- package/dist/esm/eventDispatchers/shared/customCallbackHandler.d.ts +1 -0
- package/dist/esm/eventDispatchers/shared/customCallbackHandler.js +30 -0
- package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.d.ts +2 -0
- package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.js +29 -0
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.d.ts +2 -0
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js +28 -0
- package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.d.ts +2 -0
- package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.js +29 -0
- package/dist/esm/eventDispatchers/shared/getMouseModifier.d.ts +3 -0
- package/dist/esm/eventDispatchers/shared/getMouseModifier.js +32 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForKeyboardEvents.d.ts +3 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForKeyboardEvents.js +28 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.d.ts +4 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.js +32 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.d.ts +5 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.js +23 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForTouchEvent.d.ts +5 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForTouchEvent.js +23 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/index.d.ts +7 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/index.js +7 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchDrag.d.ts +2 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchDrag.js +13 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchEnd.d.ts +2 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchEnd.js +3 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchPress.d.ts +2 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchPress.js +3 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStart.d.ts +2 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStart.js +79 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.d.ts +2 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.js +19 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchTap.d.ts +2 -0
- package/dist/esm/eventDispatchers/touchEventHandlers/touchTap.js +3 -0
- package/dist/esm/eventDispatchers/touchToolEventDispatcher.d.ts +5 -0
- package/dist/esm/eventDispatchers/touchToolEventDispatcher.js +22 -0
- package/dist/esm/eventListeners/annotations/annotationCompletedListener.d.ts +2 -0
- package/dist/esm/eventListeners/annotations/annotationCompletedListener.js +8 -0
- package/dist/esm/eventListeners/annotations/annotationModifiedListener.d.ts +2 -0
- package/dist/esm/eventListeners/annotations/annotationModifiedListener.js +6 -0
- package/dist/esm/eventListeners/annotations/annotationRemovedListener.d.ts +2 -0
- package/dist/esm/eventListeners/annotations/annotationRemovedListener.js +8 -0
- package/dist/esm/eventListeners/annotations/annotationSelectionListener.d.ts +2 -0
- package/dist/esm/eventListeners/annotations/annotationSelectionListener.js +15 -0
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +5 -0
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +233 -0
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationRemoved.d.ts +2 -0
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationRemoved.js +5 -0
- package/dist/esm/eventListeners/annotations/contourSegmentation/index.d.ts +2 -0
- package/dist/esm/eventListeners/annotations/contourSegmentation/index.js +2 -0
- package/dist/esm/eventListeners/annotations/index.d.ts +5 -0
- package/dist/esm/eventListeners/annotations/index.js +5 -0
- package/dist/esm/eventListeners/index.d.ts +7 -0
- package/dist/esm/eventListeners/index.js +7 -0
- package/dist/esm/eventListeners/keyboard/index.d.ts +9 -0
- package/dist/esm/eventListeners/keyboard/index.js +13 -0
- package/dist/esm/eventListeners/keyboard/keyDownListener.d.ts +4 -0
- package/dist/esm/eventListeners/keyboard/keyDownListener.js +64 -0
- package/dist/esm/eventListeners/mouse/getMouseEventPoints.d.ts +2 -0
- package/dist/esm/eventListeners/mouse/getMouseEventPoints.js +31 -0
- package/dist/esm/eventListeners/mouse/index.d.ts +7 -0
- package/dist/esm/eventListeners/mouse/index.js +24 -0
- package/dist/esm/eventListeners/mouse/mouseDoubleClickListener.d.ts +2 -0
- package/dist/esm/eventListeners/mouse/mouseDoubleClickListener.js +32 -0
- package/dist/esm/eventListeners/mouse/mouseDownListener.d.ts +4 -0
- package/dist/esm/eventListeners/mouse/mouseDownListener.js +266 -0
- package/dist/esm/eventListeners/mouse/mouseMoveListener.d.ts +2 -0
- package/dist/esm/eventListeners/mouse/mouseMoveListener.js +28 -0
- package/dist/esm/eventListeners/segmentation/imageChangeEventListener.d.ts +5 -0
- package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js +128 -0
- package/dist/esm/eventListeners/segmentation/index.d.ts +4 -0
- package/dist/esm/eventListeners/segmentation/index.js +4 -0
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.d.ts +3 -0
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +83 -0
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.d.ts +3 -0
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js +12 -0
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.d.ts +3 -0
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.js +6 -0
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedListener.d.ts +3 -0
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedListener.js +6 -0
- package/dist/esm/eventListeners/touch/getTouchEventPoints.d.ts +2 -0
- package/dist/esm/eventListeners/touch/getTouchEventPoints.js +38 -0
- package/dist/esm/eventListeners/touch/index.d.ts +7 -0
- package/dist/esm/eventListeners/touch/index.js +17 -0
- package/dist/esm/eventListeners/touch/preventGhostClick.d.ts +7 -0
- package/dist/esm/eventListeners/touch/preventGhostClick.js +47 -0
- package/dist/esm/eventListeners/touch/touchStartListener.d.ts +2 -0
- package/dist/esm/eventListeners/touch/touchStartListener.js +282 -0
- package/dist/esm/eventListeners/wheel/index.d.ts +7 -0
- package/dist/esm/eventListeners/wheel/index.js +12 -0
- package/dist/esm/eventListeners/wheel/normalizeWheel.d.ts +6 -0
- package/dist/esm/eventListeners/wheel/normalizeWheel.js +48 -0
- package/dist/esm/eventListeners/wheel/wheelListener.d.ts +2 -0
- package/dist/esm/eventListeners/wheel/wheelListener.js +34 -0
- package/dist/esm/index.d.ts +17 -0
- package/dist/esm/index.js +17 -0
- package/dist/esm/init.d.ts +4 -0
- package/dist/esm/init.js +70 -0
- package/dist/esm/stateManagement/annotation/AnnotationGroup.d.ts +18 -0
- package/dist/esm/stateManagement/annotation/AnnotationGroup.js +69 -0
- 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 +27 -0
- package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +210 -0
- package/dist/esm/stateManagement/annotation/annotationLocking.d.ts +7 -0
- package/dist/esm/stateManagement/annotation/annotationLocking.js +73 -0
- package/dist/esm/stateManagement/annotation/annotationSelection.d.ts +7 -0
- package/dist/esm/stateManagement/annotation/annotationSelection.js +85 -0
- package/dist/esm/stateManagement/annotation/annotationState.d.ts +18 -0
- package/dist/esm/stateManagement/annotation/annotationState.js +118 -0
- package/dist/esm/stateManagement/annotation/annotationVisibility.d.ts +5 -0
- package/dist/esm/stateManagement/annotation/annotationVisibility.js +65 -0
- package/dist/esm/stateManagement/annotation/config/ToolStyle.d.ts +18 -0
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js +135 -0
- package/dist/esm/stateManagement/annotation/config/getFont.d.ts +4 -0
- package/dist/esm/stateManagement/annotation/config/getFont.js +7 -0
- package/dist/esm/stateManagement/annotation/config/getState.d.ts +4 -0
- package/dist/esm/stateManagement/annotation/config/getState.js +21 -0
- package/dist/esm/stateManagement/annotation/config/helpers.d.ts +4 -0
- package/dist/esm/stateManagement/annotation/config/helpers.js +21 -0
- package/dist/esm/stateManagement/annotation/config/index.d.ts +4 -0
- package/dist/esm/stateManagement/annotation/config/index.js +4 -0
- package/dist/esm/stateManagement/annotation/helpers/state.d.ts +10 -0
- package/dist/esm/stateManagement/annotation/helpers/state.js +76 -0
- package/dist/esm/stateManagement/annotation/index.d.ts +34 -0
- package/dist/esm/stateManagement/annotation/index.js +15 -0
- package/dist/esm/stateManagement/annotation/resetAnnotationManager.d.ts +1 -0
- package/dist/esm/stateManagement/annotation/resetAnnotationManager.js +21 -0
- package/dist/esm/stateManagement/annotation/utilities/defineProperties.d.ts +4 -0
- package/dist/esm/stateManagement/annotation/utilities/defineProperties.js +22 -0
- package/dist/esm/stateManagement/index.d.ts +18 -0
- package/dist/esm/stateManagement/index.js +6 -0
- package/dist/esm/stateManagement/segmentation/SegmentationRenderingEngine.d.ts +20 -0
- package/dist/esm/stateManagement/segmentation/SegmentationRenderingEngine.js +153 -0
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.d.ts +91 -0
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +470 -0
- package/dist/esm/stateManagement/segmentation/SegmentationStyle.d.ts +39 -0
- package/dist/esm/stateManagement/segmentation/SegmentationStyle.js +223 -0
- package/dist/esm/stateManagement/segmentation/activeSegmentation.d.ts +4 -0
- package/dist/esm/stateManagement/segmentation/activeSegmentation.js +9 -0
- package/dist/esm/stateManagement/segmentation/addColorLUT.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/addColorLUT.js +25 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentationsToViewport.d.ts +15 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentationsToViewport.js +49 -0
- package/dist/esm/stateManagement/segmentation/addSegmentations.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/addSegmentations.js +14 -0
- package/dist/esm/stateManagement/segmentation/config/index.d.ts +4 -0
- package/dist/esm/stateManagement/segmentation/config/index.js +4 -0
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.d.ts +6 -0
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.js +50 -0
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.d.ts +22 -0
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +49 -0
- package/dist/esm/stateManagement/segmentation/config/styleHelpers.d.ts +25 -0
- package/dist/esm/stateManagement/segmentation/config/styleHelpers.js +37 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationAdded.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationAdded.js +8 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationDataModified.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationDataModified.js +12 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationModified.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationModified.js +8 -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 +2 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationModified.js +10 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationRemoved.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationRemoved.js +10 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentIndex.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentIndex.js +9 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getActiveSegmentation.js +5 -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/getGlobalStyle.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/getGlobalStyle.js +4 -0
- package/dist/esm/stateManagement/segmentation/getLabelmapImageIds.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getLabelmapImageIds.js +7 -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/getSegmentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/getSegmentation.js +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentation.d.ts +14 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentation.js +17 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationVisibility.d.ts +5 -0
- package/dist/esm/stateManagement/segmentation/getSegmentationRepresentationVisibility.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/getStackSegmentationImageIdsForViewport.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/getStackSegmentationImageIdsForViewport.js +5 -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/getViewportSegmentations.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/getViewportSegmentations.js +15 -0
- package/dist/esm/stateManagement/segmentation/helpers/clearSegmentValue.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/helpers/clearSegmentValue.js +30 -0
- package/dist/esm/stateManagement/segmentation/helpers/computeStackLabelmapFromVolume.d.ts +13 -0
- package/dist/esm/stateManagement/segmentation/helpers/computeStackLabelmapFromVolume.js +22 -0
- package/dist/esm/stateManagement/segmentation/helpers/computeVolumeLabelmapFromStack.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/helpers/computeVolumeLabelmapFromStack.js +4 -0
- package/dist/esm/stateManagement/segmentation/helpers/convertStackToVolumeLabelmap.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/helpers/convertStackToVolumeLabelmap.js +7 -0
- package/dist/esm/stateManagement/segmentation/helpers/getSegmentationActor.d.ts +6 -0
- package/dist/esm/stateManagement/segmentation/helpers/getSegmentationActor.js +34 -0
- package/dist/esm/stateManagement/segmentation/helpers/index.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/helpers/index.js +3 -0
- package/dist/esm/stateManagement/segmentation/helpers/internalGetHiddenSegmentIndices.d.ts +5 -0
- package/dist/esm/stateManagement/segmentation/helpers/internalGetHiddenSegmentIndices.js +14 -0
- package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.js +71 -0
- 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 +3 -0
- package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js +20 -0
- package/dist/esm/stateManagement/segmentation/index.d.ts +28 -0
- package/dist/esm/stateManagement/segmentation/index.js +28 -0
- package/dist/esm/stateManagement/segmentation/internalAddRepresentationData.d.ts +12 -0
- package/dist/esm/stateManagement/segmentation/internalAddRepresentationData.js +32 -0
- package/dist/esm/stateManagement/segmentation/internalAddSegmentationRepresentation.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/internalAddSegmentationRepresentation.js +38 -0
- package/dist/esm/stateManagement/segmentation/removeColorLUT.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/removeColorLUT.js +5 -0
- package/dist/esm/stateManagement/segmentation/removeSegment.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/removeSegment.js +50 -0
- package/dist/esm/stateManagement/segmentation/removeSegmentation.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/removeSegmentation.js +24 -0
- package/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.d.ts +20 -0
- package/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.js +73 -0
- package/dist/esm/stateManagement/segmentation/segmentIndex.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/segmentIndex.js +48 -0
- package/dist/esm/stateManagement/segmentation/segmentLocking.d.ts +4 -0
- package/dist/esm/stateManagement/segmentation/segmentLocking.js +29 -0
- package/dist/esm/stateManagement/segmentation/segmentationState.d.ts +17 -0
- package/dist/esm/stateManagement/segmentation/segmentationState.js +20 -0
- package/dist/esm/stateManagement/segmentation/setActiveSegmentation.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/setActiveSegmentation.js +5 -0
- package/dist/esm/stateManagement/segmentation/setGlobalStyle.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/setGlobalStyle.js +8 -0
- package/dist/esm/stateManagement/segmentation/setSegmentationRepresentationVisibility.d.ts +5 -0
- package/dist/esm/stateManagement/segmentation/setSegmentationRepresentationVisibility.js +5 -0
- package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.d.ts +6 -0
- package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.js +6 -0
- package/dist/esm/stateManagement/segmentation/updateLabelmapSegmentationImageReferences.d.ts +1 -0
- package/dist/esm/stateManagement/segmentation/updateLabelmapSegmentationImageReferences.js +5 -0
- package/dist/esm/stateManagement/segmentation/updateSegmentations.d.ts +5 -0
- package/dist/esm/stateManagement/segmentation/updateSegmentations.js +11 -0
- package/dist/esm/store/SynchronizerManager/Synchronizer.d.ts +48 -0
- package/dist/esm/store/SynchronizerManager/Synchronizer.js +221 -0
- package/dist/esm/store/SynchronizerManager/createSynchronizer.d.ts +4 -0
- package/dist/esm/store/SynchronizerManager/createSynchronizer.js +12 -0
- package/dist/esm/store/SynchronizerManager/destroy.d.ts +2 -0
- package/dist/esm/store/SynchronizerManager/destroy.js +8 -0
- package/dist/esm/store/SynchronizerManager/destroySynchronizer.d.ts +2 -0
- package/dist/esm/store/SynchronizerManager/destroySynchronizer.js +10 -0
- package/dist/esm/store/SynchronizerManager/getAllSynchronizers.d.ts +3 -0
- package/dist/esm/store/SynchronizerManager/getAllSynchronizers.js +5 -0
- package/dist/esm/store/SynchronizerManager/getSynchronizer.d.ts +3 -0
- package/dist/esm/store/SynchronizerManager/getSynchronizer.js +5 -0
- package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.d.ts +3 -0
- package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.js +18 -0
- package/dist/esm/store/SynchronizerManager/index.d.ts +7 -0
- package/dist/esm/store/SynchronizerManager/index.js +7 -0
- package/dist/esm/store/ToolGroupManager/ToolGroup.d.ts +48 -0
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +460 -0
- package/dist/esm/store/ToolGroupManager/createToolGroup.d.ts +3 -0
- package/dist/esm/store/ToolGroupManager/createToolGroup.js +13 -0
- package/dist/esm/store/ToolGroupManager/destroy.d.ts +2 -0
- package/dist/esm/store/ToolGroupManager/destroy.js +10 -0
- package/dist/esm/store/ToolGroupManager/destroyToolGroup.d.ts +2 -0
- package/dist/esm/store/ToolGroupManager/destroyToolGroup.js +8 -0
- package/dist/esm/store/ToolGroupManager/getAllToolGroups.d.ts +3 -0
- package/dist/esm/store/ToolGroupManager/getAllToolGroups.js +5 -0
- package/dist/esm/store/ToolGroupManager/getToolGroup.d.ts +3 -0
- package/dist/esm/store/ToolGroupManager/getToolGroup.js +5 -0
- package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.d.ts +3 -0
- package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.js +18 -0
- package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.d.ts +3 -0
- package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.js +21 -0
- package/dist/esm/store/ToolGroupManager/index.d.ts +8 -0
- package/dist/esm/store/ToolGroupManager/index.js +8 -0
- package/dist/esm/store/addEnabledElement.d.ts +2 -0
- package/dist/esm/store/addEnabledElement.js +68 -0
- package/dist/esm/store/addTool.d.ts +5 -0
- package/dist/esm/store/addTool.js +31 -0
- package/dist/esm/store/cancelActiveManipulations.d.ts +1 -0
- package/dist/esm/store/cancelActiveManipulations.js +16 -0
- package/dist/esm/store/filterMoveableAnnotationTools.d.ts +3 -0
- package/dist/esm/store/filterMoveableAnnotationTools.js +20 -0
- package/dist/esm/store/filterToolsWithAnnotationsForElement.d.ts +3 -0
- package/dist/esm/store/filterToolsWithAnnotationsForElement.js +22 -0
- package/dist/esm/store/filterToolsWithMoveableHandles.d.ts +3 -0
- package/dist/esm/store/filterToolsWithMoveableHandles.js +21 -0
- package/dist/esm/store/index.d.ts +10 -0
- package/dist/esm/store/index.js +10 -0
- package/dist/esm/store/removeEnabledElement.d.ts +3 -0
- package/dist/esm/store/removeEnabledElement.js +85 -0
- package/dist/esm/store/state.d.ts +18 -0
- package/dist/esm/store/state.js +34 -0
- package/dist/esm/store/svgNodeCache.d.ts +3 -0
- package/dist/esm/store/svgNodeCache.js +5 -0
- package/dist/esm/synchronizers/callbacks/areViewportsCoplanar.d.ts +2 -0
- package/dist/esm/synchronizers/callbacks/areViewportsCoplanar.js +7 -0
- package/dist/esm/synchronizers/callbacks/cameraSyncCallback.d.ts +3 -0
- package/dist/esm/synchronizers/callbacks/cameraSyncCallback.js +11 -0
- package/dist/esm/synchronizers/callbacks/imageSliceSyncCallback.d.ts +3 -0
- package/dist/esm/synchronizers/callbacks/imageSliceSyncCallback.js +67 -0
- package/dist/esm/synchronizers/callbacks/presentationViewSyncCallback.d.ts +2 -0
- package/dist/esm/synchronizers/callbacks/presentationViewSyncCallback.js +12 -0
- package/dist/esm/synchronizers/callbacks/slabThicknessSyncCallback.d.ts +2 -0
- package/dist/esm/synchronizers/callbacks/slabThicknessSyncCallback.js +15 -0
- package/dist/esm/synchronizers/callbacks/voiSyncCallback.d.ts +5 -0
- package/dist/esm/synchronizers/callbacks/voiSyncCallback.js +35 -0
- package/dist/esm/synchronizers/callbacks/zoomPanSyncCallback.d.ts +3 -0
- package/dist/esm/synchronizers/callbacks/zoomPanSyncCallback.js +19 -0
- package/dist/esm/synchronizers/index.d.ts +8 -0
- package/dist/esm/synchronizers/index.js +8 -0
- package/dist/esm/synchronizers/synchronizers/createCameraPositionSynchronizer.d.ts +2 -0
- package/dist/esm/synchronizers/synchronizers/createCameraPositionSynchronizer.js +8 -0
- package/dist/esm/synchronizers/synchronizers/createImageSliceSynchronizer.d.ts +2 -0
- package/dist/esm/synchronizers/synchronizers/createImageSliceSynchronizer.js +14 -0
- package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.d.ts +3 -0
- package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.js +8 -0
- package/dist/esm/synchronizers/synchronizers/createSlabThicknessSynchronizer.d.ts +2 -0
- package/dist/esm/synchronizers/synchronizers/createSlabThicknessSynchronizer.js +8 -0
- package/dist/esm/synchronizers/synchronizers/createVOISynchronizer.d.ts +7 -0
- package/dist/esm/synchronizers/synchronizers/createVOISynchronizer.js +15 -0
- package/dist/esm/synchronizers/synchronizers/createZoomPanSynchronizer.d.ts +2 -0
- package/dist/esm/synchronizers/synchronizers/createZoomPanSynchronizer.js +8 -0
- package/dist/esm/synchronizers/synchronizers/index.d.ts +7 -0
- package/dist/esm/synchronizers/synchronizers/index.js +7 -0
- package/dist/esm/tools/AdvancedMagnifyTool.d.ts +130 -0
- package/dist/esm/tools/AdvancedMagnifyTool.js +927 -0
- package/dist/esm/tools/AnnotationEraserTool.d.ts +10 -0
- package/dist/esm/tools/AnnotationEraserTool.js +56 -0
- package/dist/esm/tools/CrosshairsTool.d.ts +71 -0
- package/dist/esm/tools/CrosshairsTool.js +1449 -0
- package/dist/esm/tools/MIPJumpToClickTool.d.ts +8 -0
- package/dist/esm/tools/MIPJumpToClickTool.js +56 -0
- package/dist/esm/tools/MagnifyTool.d.ts +25 -0
- package/dist/esm/tools/MagnifyTool.js +180 -0
- package/dist/esm/tools/OrientationMarkerTool.d.ts +78 -0
- package/dist/esm/tools/OrientationMarkerTool.js +284 -0
- package/dist/esm/tools/OverlayGridTool.d.ts +29 -0
- package/dist/esm/tools/OverlayGridTool.js +164 -0
- package/dist/esm/tools/PanTool.d.ts +10 -0
- package/dist/esm/tools/PanTool.js +44 -0
- package/dist/esm/tools/PlanarRotateTool.d.ts +12 -0
- package/dist/esm/tools/PlanarRotateTool.js +64 -0
- package/dist/esm/tools/ReferenceCursors.d.ts +24 -0
- package/dist/esm/tools/ReferenceCursors.js +308 -0
- package/dist/esm/tools/ReferenceLinesTool.d.ts +27 -0
- package/dist/esm/tools/ReferenceLinesTool.js +232 -0
- package/dist/esm/tools/ScaleOverlayTool.d.ts +38 -0
- package/dist/esm/tools/ScaleOverlayTool.js +397 -0
- package/dist/esm/tools/SculptorTool/CircleSculptCursor.d.ts +20 -0
- package/dist/esm/tools/SculptorTool/CircleSculptCursor.js +107 -0
- package/dist/esm/tools/SculptorTool.d.ts +41 -0
- package/dist/esm/tools/SculptorTool.js +289 -0
- package/dist/esm/tools/SegmentationIntersectionTool.d.ts +18 -0
- package/dist/esm/tools/SegmentationIntersectionTool.js +177 -0
- package/dist/esm/tools/StackScrollTool.d.ts +15 -0
- package/dist/esm/tools/StackScrollTool.js +78 -0
- package/dist/esm/tools/TrackballRotateTool.d.ts +19 -0
- package/dist/esm/tools/TrackballRotateTool.js +179 -0
- package/dist/esm/tools/VolumeRotateTool.d.ts +10 -0
- package/dist/esm/tools/VolumeRotateTool.js +52 -0
- package/dist/esm/tools/WindowLevelRegionTool.d.ts +26 -0
- package/dist/esm/tools/WindowLevelRegionTool.js +220 -0
- package/dist/esm/tools/WindowLevelTool.d.ts +37 -0
- package/dist/esm/tools/WindowLevelTool.js +201 -0
- package/dist/esm/tools/ZoomTool.d.ts +19 -0
- package/dist/esm/tools/ZoomTool.js +180 -0
- package/dist/esm/tools/annotation/AngleTool.d.ts +37 -0
- package/dist/esm/tools/annotation/AngleTool.js +486 -0
- package/dist/esm/tools/annotation/ArrowAnnotateTool.d.ts +39 -0
- package/dist/esm/tools/annotation/ArrowAnnotateTool.js +467 -0
- package/dist/esm/tools/annotation/BidirectionalTool.d.ts +40 -0
- package/dist/esm/tools/annotation/BidirectionalTool.js +728 -0
- package/dist/esm/tools/annotation/CircleROITool.d.ts +39 -0
- package/dist/esm/tools/annotation/CircleROITool.js +638 -0
- package/dist/esm/tools/annotation/CobbAngleTool.d.ts +61 -0
- package/dist/esm/tools/annotation/CobbAngleTool.js +688 -0
- package/dist/esm/tools/annotation/DragProbeTool.d.ts +23 -0
- package/dist/esm/tools/annotation/DragProbeTool.js +130 -0
- package/dist/esm/tools/annotation/ETDRSGridTool.d.ts +41 -0
- package/dist/esm/tools/annotation/ETDRSGridTool.js +354 -0
- package/dist/esm/tools/annotation/EllipticalROITool.d.ts +45 -0
- package/dist/esm/tools/annotation/EllipticalROITool.js +710 -0
- 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 +34 -0
- package/dist/esm/tools/annotation/KeyImageTool.js +269 -0
- package/dist/esm/tools/annotation/LabelTool.d.ts +35 -0
- package/dist/esm/tools/annotation/LabelTool.js +323 -0
- package/dist/esm/tools/annotation/LengthTool.d.ts +38 -0
- package/dist/esm/tools/annotation/LengthTool.js +468 -0
- package/dist/esm/tools/annotation/LivewireContourSegmentationTool.d.ts +10 -0
- package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js +89 -0
- package/dist/esm/tools/annotation/LivewireContourTool.d.ts +67 -0
- package/dist/esm/tools/annotation/LivewireContourTool.js +657 -0
- package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +9 -0
- package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js +29 -0
- package/dist/esm/tools/annotation/PlanarFreehandROITool.d.ts +59 -0
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +530 -0
- package/dist/esm/tools/annotation/ProbeTool.d.ts +35 -0
- package/dist/esm/tools/annotation/ProbeTool.js +363 -0
- package/dist/esm/tools/annotation/RectangleROITool.d.ts +43 -0
- package/dist/esm/tools/annotation/RectangleROITool.js +566 -0
- package/dist/esm/tools/annotation/RegionSegmentPlusTool.d.ts +16 -0
- package/dist/esm/tools/annotation/RegionSegmentPlusTool.js +55 -0
- package/dist/esm/tools/annotation/RegionSegmentTool.d.ts +21 -0
- package/dist/esm/tools/annotation/RegionSegmentTool.js +102 -0
- package/dist/esm/tools/annotation/SplineContourSegmentationTool.d.ts +8 -0
- package/dist/esm/tools/annotation/SplineContourSegmentationTool.js +17 -0
- package/dist/esm/tools/annotation/SplineROITool.d.ts +73 -0
- package/dist/esm/tools/annotation/SplineROITool.js +788 -0
- package/dist/esm/tools/annotation/UltrasoundDirectionalTool.d.ts +34 -0
- package/dist/esm/tools/annotation/UltrasoundDirectionalTool.js +461 -0
- package/dist/esm/tools/annotation/VideoRedactionTool.d.ts +46 -0
- package/dist/esm/tools/annotation/VideoRedactionTool.js +442 -0
- package/dist/esm/tools/annotation/WholeBodySegmentTool.d.ts +29 -0
- package/dist/esm/tools/annotation/WholeBodySegmentTool.js +223 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.d.ts +2 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +260 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.d.ts +2 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js +289 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/editLoopCommon.d.ts +2 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/editLoopCommon.js +146 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.d.ts +4 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.js +39 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.d.ts +2 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js +329 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.d.ts +2 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +48 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.d.ts +2 -0
- package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js +216 -0
- package/dist/esm/tools/annotation/splines/BSpline.d.ts +5 -0
- package/dist/esm/tools/annotation/splines/BSpline.js +9 -0
- package/dist/esm/tools/annotation/splines/CardinalSpline.d.ts +12 -0
- package/dist/esm/tools/annotation/splines/CardinalSpline.js +32 -0
- package/dist/esm/tools/annotation/splines/CatmullRomSpline.d.ts +5 -0
- package/dist/esm/tools/annotation/splines/CatmullRomSpline.js +7 -0
- package/dist/esm/tools/annotation/splines/CubicSpline.d.ts +13 -0
- package/dist/esm/tools/annotation/splines/CubicSpline.js +164 -0
- package/dist/esm/tools/annotation/splines/LinearSpline.d.ts +5 -0
- package/dist/esm/tools/annotation/splines/LinearSpline.js +7 -0
- package/dist/esm/tools/annotation/splines/QuadraticBezier.d.ts +6 -0
- package/dist/esm/tools/annotation/splines/QuadraticBezier.js +15 -0
- package/dist/esm/tools/annotation/splines/QuadraticSpline.d.ts +9 -0
- package/dist/esm/tools/annotation/splines/QuadraticSpline.js +13 -0
- package/dist/esm/tools/annotation/splines/Spline.d.ts +51 -0
- package/dist/esm/tools/annotation/splines/Spline.js +395 -0
- package/dist/esm/tools/annotation/splines/index.d.ts +9 -0
- package/dist/esm/tools/annotation/splines/index.js +9 -0
- package/dist/esm/tools/base/AnnotationDisplayTool.d.ts +14 -0
- package/dist/esm/tools/base/AnnotationDisplayTool.js +98 -0
- package/dist/esm/tools/base/AnnotationTool.d.ts +71 -0
- package/dist/esm/tools/base/AnnotationTool.js +271 -0
- package/dist/esm/tools/base/BaseTool.d.ts +38 -0
- package/dist/esm/tools/base/BaseTool.js +128 -0
- package/dist/esm/tools/base/ContourBaseTool.d.ts +25 -0
- package/dist/esm/tools/base/ContourBaseTool.js +121 -0
- package/dist/esm/tools/base/ContourSegmentationBaseTool.d.ts +19 -0
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js +133 -0
- package/dist/esm/tools/base/GrowCutBaseTool.d.ts +64 -0
- package/dist/esm/tools/base/GrowCutBaseTool.js +209 -0
- package/dist/esm/tools/base/index.d.ts +4 -0
- package/dist/esm/tools/base/index.js +4 -0
- package/dist/esm/tools/displayTools/Contour/contourConfig.d.ts +3 -0
- package/dist/esm/tools/displayTools/Contour/contourConfig.js +20 -0
- package/dist/esm/tools/displayTools/Contour/contourDisplay.d.ts +9 -0
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js +51 -0
- package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.d.ts +5 -0
- package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.js +77 -0
- package/dist/esm/tools/displayTools/Contour/contourHandler/utils.d.ts +4 -0
- package/dist/esm/tools/displayTools/Contour/contourHandler/utils.js +41 -0
- package/dist/esm/tools/displayTools/Contour/index.d.ts +2 -0
- package/dist/esm/tools/displayTools/Contour/index.js +2 -0
- package/dist/esm/tools/displayTools/Contour/removeContourFromElement.d.ts +2 -0
- package/dist/esm/tools/displayTools/Contour/removeContourFromElement.js +12 -0
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.d.ts +7 -0
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +93 -0
- package/dist/esm/tools/displayTools/Labelmap/addVolumesAsIndependentComponents.d.ts +10 -0
- package/dist/esm/tools/displayTools/Labelmap/addVolumesAsIndependentComponents.js +123 -0
- package/dist/esm/tools/displayTools/Labelmap/index.d.ts +4 -0
- package/dist/esm/tools/displayTools/Labelmap/index.js +4 -0
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.d.ts +3 -0
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.js +17 -0
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.d.ts +11 -0
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +267 -0
- package/dist/esm/tools/displayTools/Labelmap/removeLabelmapFromElement.d.ts +2 -0
- package/dist/esm/tools/displayTools/Labelmap/removeLabelmapFromElement.js +8 -0
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts +3 -0
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +67 -0
- package/dist/esm/tools/displayTools/Surface/index.d.ts +2 -0
- package/dist/esm/tools/displayTools/Surface/index.js +2 -0
- package/dist/esm/tools/displayTools/Surface/removeSurfaceFromElement.d.ts +2 -0
- package/dist/esm/tools/displayTools/Surface/removeSurfaceFromElement.js +10 -0
- package/dist/esm/tools/displayTools/Surface/surfaceConfig.d.ts +3 -0
- package/dist/esm/tools/displayTools/Surface/surfaceConfig.js +8 -0
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.d.ts +10 -0
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +76 -0
- package/dist/esm/tools/distancePointToContour.d.ts +3 -0
- package/dist/esm/tools/distancePointToContour.js +18 -0
- package/dist/esm/tools/index.d.ts +57 -0
- package/dist/esm/tools/index.js +57 -0
- package/dist/esm/tools/segmentation/BrushTool.d.ts +27 -0
- package/dist/esm/tools/segmentation/BrushTool.js +355 -0
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.d.ts +68 -0
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js +478 -0
- package/dist/esm/tools/segmentation/CircleScissorsTool.d.ts +34 -0
- package/dist/esm/tools/segmentation/CircleScissorsTool.js +233 -0
- package/dist/esm/tools/segmentation/LabelmapBaseTool.d.ts +99 -0
- package/dist/esm/tools/segmentation/LabelmapBaseTool.js +289 -0
- package/dist/esm/tools/segmentation/PaintFillTool.d.ts +13 -0
- package/dist/esm/tools/segmentation/PaintFillTool.js +231 -0
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +69 -0
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +437 -0
- package/dist/esm/tools/segmentation/RectangleROIThresholdTool.d.ts +45 -0
- package/dist/esm/tools/segmentation/RectangleROIThresholdTool.js +145 -0
- package/dist/esm/tools/segmentation/RectangleScissorsTool.d.ts +32 -0
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js +227 -0
- package/dist/esm/tools/segmentation/SegmentSelectTool.d.ts +20 -0
- package/dist/esm/tools/segmentation/SegmentSelectTool.js +99 -0
- package/dist/esm/tools/segmentation/SphereScissorsTool.d.ts +33 -0
- package/dist/esm/tools/segmentation/SphereScissorsTool.js +227 -0
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.d.ts +125 -0
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +156 -0
- package/dist/esm/tools/segmentation/strategies/compositions/determineSegmentIndex.d.ts +6 -0
- package/dist/esm/tools/segmentation/strategies/compositions/determineSegmentIndex.js +59 -0
- package/dist/esm/tools/segmentation/strategies/compositions/dynamicThreshold.d.ts +7 -0
- package/dist/esm/tools/segmentation/strategies/compositions/dynamicThreshold.js +83 -0
- package/dist/esm/tools/segmentation/strategies/compositions/ensureImageVolume.d.ts +4 -0
- package/dist/esm/tools/segmentation/strategies/compositions/ensureImageVolume.js +35 -0
- package/dist/esm/tools/segmentation/strategies/compositions/ensureSegmentationVolume.d.ts +4 -0
- package/dist/esm/tools/segmentation/strategies/compositions/ensureSegmentationVolume.js +20 -0
- package/dist/esm/tools/segmentation/strategies/compositions/erase.d.ts +5 -0
- package/dist/esm/tools/segmentation/strategies/compositions/erase.js +6 -0
- package/dist/esm/tools/segmentation/strategies/compositions/index.d.ts +47 -0
- package/dist/esm/tools/segmentation/strategies/compositions/index.js +24 -0
- package/dist/esm/tools/segmentation/strategies/compositions/islandRemovalComposition.d.ts +5 -0
- package/dist/esm/tools/segmentation/strategies/compositions/islandRemovalComposition.js +28 -0
- package/dist/esm/tools/segmentation/strategies/compositions/labelmapStatistics.d.ts +7 -0
- package/dist/esm/tools/segmentation/strategies/compositions/labelmapStatistics.js +12 -0
- package/dist/esm/tools/segmentation/strategies/compositions/preview.d.ts +8 -0
- package/dist/esm/tools/segmentation/strategies/compositions/preview.js +92 -0
- package/dist/esm/tools/segmentation/strategies/compositions/regionFill.d.ts +5 -0
- package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js +23 -0
- package/dist/esm/tools/segmentation/strategies/compositions/setValue.d.ts +8 -0
- package/dist/esm/tools/segmentation/strategies/compositions/setValue.js +29 -0
- package/dist/esm/tools/segmentation/strategies/compositions/threshold.d.ts +5 -0
- package/dist/esm/tools/segmentation/strategies/compositions/threshold.js +21 -0
- package/dist/esm/tools/segmentation/strategies/eraseCircle.d.ts +2 -0
- package/dist/esm/tools/segmentation/strategies/eraseCircle.js +6 -0
- package/dist/esm/tools/segmentation/strategies/eraseRectangle.d.ts +8 -0
- package/dist/esm/tools/segmentation/strategies/eraseRectangle.js +13 -0
- package/dist/esm/tools/segmentation/strategies/eraseSphere.d.ts +2 -0
- package/dist/esm/tools/segmentation/strategies/eraseSphere.js +6 -0
- package/dist/esm/tools/segmentation/strategies/fillCircle.d.ts +14 -0
- package/dist/esm/tools/segmentation/strategies/fillCircle.js +71 -0
- package/dist/esm/tools/segmentation/strategies/fillRectangle.d.ts +6 -0
- package/dist/esm/tools/segmentation/strategies/fillRectangle.js +71 -0
- package/dist/esm/tools/segmentation/strategies/fillSphere.d.ts +7 -0
- package/dist/esm/tools/segmentation/strategies/fillSphere.js +40 -0
- package/dist/esm/tools/segmentation/strategies/index.d.ts +3 -0
- package/dist/esm/tools/segmentation/strategies/index.js +3 -0
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.d.ts +15 -0
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +112 -0
- package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.d.ts +5 -0
- package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.js +8 -0
- package/dist/esm/types/AnnotationGroupSelector.d.ts +2 -0
- package/dist/esm/types/AnnotationGroupSelector.js +0 -0
- package/dist/esm/types/AnnotationRenderContext.d.ts +12 -0
- package/dist/esm/types/AnnotationRenderContext.js +0 -0
- package/dist/esm/types/AnnotationStyle.d.ts +30 -0
- package/dist/esm/types/AnnotationStyle.js +0 -0
- package/dist/esm/types/AnnotationTypes.d.ts +45 -0
- package/dist/esm/types/AnnotationTypes.js +0 -0
- package/dist/esm/types/BoundsIJK.d.ts +3 -0
- package/dist/esm/types/BoundsIJK.js +0 -0
- package/dist/esm/types/CINETypes.d.ts +30 -0
- package/dist/esm/types/CINETypes.js +0 -0
- package/dist/esm/types/CalculatorTypes.d.ts +42 -0
- package/dist/esm/types/CalculatorTypes.js +0 -0
- package/dist/esm/types/CardinalSplineProps.d.ts +5 -0
- package/dist/esm/types/CardinalSplineProps.js +0 -0
- package/dist/esm/types/ClosestControlPoint.d.ts +4 -0
- package/dist/esm/types/ClosestControlPoint.js +0 -0
- package/dist/esm/types/ClosestPoint.d.ts +5 -0
- package/dist/esm/types/ClosestPoint.js +0 -0
- package/dist/esm/types/ClosestSplinePoint.d.ts +4 -0
- package/dist/esm/types/ClosestSplinePoint.js +0 -0
- package/dist/esm/types/ContourAnnotation.d.ts +20 -0
- package/dist/esm/types/ContourAnnotation.js +6 -0
- package/dist/esm/types/ContourSegmentationAnnotation.d.ts +24 -0
- package/dist/esm/types/ContourSegmentationAnnotation.js +0 -0
- package/dist/esm/types/ContourTypes.d.ts +27 -0
- package/dist/esm/types/ContourTypes.js +0 -0
- package/dist/esm/types/ControlPointInfo.d.ts +5 -0
- package/dist/esm/types/ControlPointInfo.js +0 -0
- package/dist/esm/types/CursorTypes.d.ts +18 -0
- package/dist/esm/types/CursorTypes.js +0 -0
- package/dist/esm/types/EventTypes.d.ts +234 -0
- package/dist/esm/types/EventTypes.js +0 -0
- package/dist/esm/types/FloodFillTypes.d.ts +16 -0
- package/dist/esm/types/FloodFillTypes.js +0 -0
- package/dist/esm/types/IAnnotationManager.d.ts +14 -0
- package/dist/esm/types/IAnnotationManager.js +0 -0
- package/dist/esm/types/IBaseTool.d.ts +2 -0
- package/dist/esm/types/IBaseTool.js +0 -0
- package/dist/esm/types/IDistance.d.ts +7 -0
- package/dist/esm/types/IDistance.js +0 -0
- package/dist/esm/types/IPoints.d.ts +8 -0
- package/dist/esm/types/IPoints.js +0 -0
- package/dist/esm/types/ISculptToolShape.d.ts +12 -0
- package/dist/esm/types/ISculptToolShape.js +0 -0
- package/dist/esm/types/ISetToolModeOptions.d.ts +16 -0
- package/dist/esm/types/ISetToolModeOptions.js +0 -0
- package/dist/esm/types/ISpline.d.ts +30 -0
- package/dist/esm/types/ISpline.js +0 -0
- package/dist/esm/types/ISynchronizerEventHandler.d.ts +5 -0
- package/dist/esm/types/ISynchronizerEventHandler.js +0 -0
- package/dist/esm/types/IToolClassReference.d.ts +3 -0
- package/dist/esm/types/IToolClassReference.js +0 -0
- package/dist/esm/types/IToolGroup.d.ts +3 -0
- package/dist/esm/types/IToolGroup.js +0 -0
- package/dist/esm/types/ITouchPoints.d.ts +11 -0
- package/dist/esm/types/ITouchPoints.js +0 -0
- package/dist/esm/types/InteractionTypes.d.ts +2 -0
- package/dist/esm/types/InteractionTypes.js +0 -0
- package/dist/esm/types/InternalToolTypes.d.ts +15 -0
- package/dist/esm/types/InternalToolTypes.js +0 -0
- package/dist/esm/types/InterpolationTypes.d.ts +20 -0
- package/dist/esm/types/InterpolationTypes.js +0 -0
- package/dist/esm/types/LabelmapToolOperationData.d.ts +26 -0
- package/dist/esm/types/LabelmapToolOperationData.js +0 -0
- package/dist/esm/types/LabelmapTypes.d.ts +29 -0
- package/dist/esm/types/LabelmapTypes.js +0 -0
- package/dist/esm/types/PlanarBoundingBox.d.ts +7 -0
- package/dist/esm/types/PlanarBoundingBox.js +0 -0
- package/dist/esm/types/SVGDrawingHelper.d.ts +9 -0
- package/dist/esm/types/SVGDrawingHelper.js +0 -0
- package/dist/esm/types/SegmentationStateTypes.d.ts +96 -0
- package/dist/esm/types/SegmentationStateTypes.js +0 -0
- package/dist/esm/types/SplineCurveSegment.d.ts +14 -0
- package/dist/esm/types/SplineCurveSegment.js +0 -0
- package/dist/esm/types/SplineLineSegment.d.ts +10 -0
- package/dist/esm/types/SplineLineSegment.js +0 -0
- package/dist/esm/types/SplineProps.d.ts +5 -0
- package/dist/esm/types/SplineProps.js +0 -0
- package/dist/esm/types/SurfaceTypes.d.ts +5 -0
- package/dist/esm/types/SurfaceTypes.js +0 -0
- package/dist/esm/types/ToolAction.d.ts +8 -0
- package/dist/esm/types/ToolAction.js +0 -0
- package/dist/esm/types/ToolHandle.d.ts +15 -0
- package/dist/esm/types/ToolHandle.js +0 -0
- package/dist/esm/types/ToolProps.d.ts +13 -0
- package/dist/esm/types/ToolProps.js +0 -0
- package/dist/esm/types/ToolSpecificAnnotationTypes.d.ts +477 -0
- package/dist/esm/types/ToolSpecificAnnotationTypes.js +0 -0
- package/dist/esm/types/index.d.ts +49 -0
- package/dist/esm/types/index.js +0 -0
- package/dist/esm/utilities/AnnotationMultiSlice.d.ts +11 -0
- package/dist/esm/utilities/AnnotationMultiSlice.js +68 -0
- package/dist/esm/utilities/BucketQueue.d.ts +20 -0
- package/dist/esm/utilities/BucketQueue.js +78 -0
- package/dist/esm/utilities/annotationHydration.d.ts +9 -0
- package/dist/esm/utilities/annotationHydration.js +82 -0
- package/dist/esm/utilities/boundingBox/extend2DBoundingBoxInViewAxis.d.ts +3 -0
- package/dist/esm/utilities/boundingBox/extend2DBoundingBoxInViewAxis.js +10 -0
- package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.d.ts +5 -0
- package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js +55 -0
- package/dist/esm/utilities/boundingBox/index.d.ts +3 -0
- package/dist/esm/utilities/boundingBox/index.js +3 -0
- package/dist/esm/utilities/calibrateImageSpacing.d.ts +2 -0
- package/dist/esm/utilities/calibrateImageSpacing.js +18 -0
- package/dist/esm/utilities/cine/events.d.ts +5 -0
- package/dist/esm/utilities/cine/events.js +6 -0
- package/dist/esm/utilities/cine/index.d.ts +4 -0
- package/dist/esm/utilities/cine/index.js +4 -0
- package/dist/esm/utilities/cine/playClip.d.ts +8 -0
- package/dist/esm/utilities/cine/playClip.js +352 -0
- package/dist/esm/utilities/cine/state.d.ts +5 -0
- package/dist/esm/utilities/cine/state.js +16 -0
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +2 -0
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js +24 -0
- package/dist/esm/utilities/contourSegmentation/areSameSegment.d.ts +2 -0
- package/dist/esm/utilities/contourSegmentation/areSameSegment.js +6 -0
- package/dist/esm/utilities/contourSegmentation/index.d.ts +4 -0
- package/dist/esm/utilities/contourSegmentation/index.js +4 -0
- package/dist/esm/utilities/contourSegmentation/isContourSegmentationAnnotation.d.ts +3 -0
- package/dist/esm/utilities/contourSegmentation/isContourSegmentationAnnotation.js +3 -0
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +2 -0
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +17 -0
- package/dist/esm/utilities/contours/AnnotationToPointData.d.ts +11 -0
- package/dist/esm/utilities/contours/AnnotationToPointData.js +38 -0
- package/dist/esm/utilities/contours/RectangleROIStartEndThreshold.d.ts +6 -0
- package/dist/esm/utilities/contours/RectangleROIStartEndThreshold.js +40 -0
- package/dist/esm/utilities/contours/areCoplanarContours.d.ts +2 -0
- package/dist/esm/utilities/contours/areCoplanarContours.js +15 -0
- package/dist/esm/utilities/contours/calculatePerimeter.d.ts +2 -0
- package/dist/esm/utilities/contours/calculatePerimeter.js +16 -0
- package/dist/esm/utilities/contours/contourFinder.d.ts +7 -0
- package/dist/esm/utilities/contours/contourFinder.js +62 -0
- package/dist/esm/utilities/contours/detectContourHoles.d.ts +5 -0
- package/dist/esm/utilities/contours/detectContourHoles.js +73 -0
- package/dist/esm/utilities/contours/findHandlePolylineIndex.d.ts +2 -0
- package/dist/esm/utilities/contours/findHandlePolylineIndex.js +31 -0
- package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.d.ts +4 -0
- package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js +110 -0
- package/dist/esm/utilities/contours/getContourHolesDataCanvas.d.ts +3 -0
- package/dist/esm/utilities/contours/getContourHolesDataCanvas.js +14 -0
- package/dist/esm/utilities/contours/getContourHolesDataWorld.d.ts +3 -0
- package/dist/esm/utilities/contours/getContourHolesDataWorld.js +5 -0
- package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts +11 -0
- package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js +45 -0
- package/dist/esm/utilities/contours/index.d.ts +13 -0
- package/dist/esm/utilities/contours/index.js +13 -0
- package/dist/esm/utilities/contours/interpolation/acceptAutogeneratedInterpolations.d.ts +3 -0
- package/dist/esm/utilities/contours/interpolation/acceptAutogeneratedInterpolations.js +4 -0
- package/dist/esm/utilities/contours/interpolation/createPolylineToolData.d.ts +2 -0
- package/dist/esm/utilities/contours/interpolation/createPolylineToolData.js +38 -0
- package/dist/esm/utilities/contours/interpolation/findAnnotationForInterpolation.d.ts +7 -0
- package/dist/esm/utilities/contours/interpolation/findAnnotationForInterpolation.js +106 -0
- package/dist/esm/utilities/contours/interpolation/getInterpolationData.d.ts +7 -0
- package/dist/esm/utilities/contours/interpolation/getInterpolationData.js +47 -0
- package/dist/esm/utilities/contours/interpolation/getInterpolationDataCollection.d.ts +4 -0
- package/dist/esm/utilities/contours/interpolation/getInterpolationDataCollection.js +14 -0
- package/dist/esm/utilities/contours/interpolation/interpolate.d.ts +11 -0
- package/dist/esm/utilities/contours/interpolation/interpolate.js +339 -0
- package/dist/esm/utilities/contours/interpolation/selectHandles.d.ts +4 -0
- package/dist/esm/utilities/contours/interpolation/selectHandles.js +162 -0
- package/dist/esm/utilities/contours/interpolation/updateChildInterpolationUID.d.ts +2 -0
- package/dist/esm/utilities/contours/interpolation/updateChildInterpolationUID.js +12 -0
- package/dist/esm/utilities/contours/reverseIfAntiClockwise.d.ts +2 -0
- package/dist/esm/utilities/contours/reverseIfAntiClockwise.js +11 -0
- package/dist/esm/utilities/contours/updateContourPolyline.d.ts +17 -0
- package/dist/esm/utilities/contours/updateContourPolyline.js +52 -0
- package/dist/esm/utilities/debounce.d.ts +6 -0
- package/dist/esm/utilities/debounce.js +113 -0
- package/dist/esm/utilities/drawing/getTextBoxCoordsCanvas.d.ts +2 -0
- package/dist/esm/utilities/drawing/getTextBoxCoordsCanvas.js +24 -0
- package/dist/esm/utilities/drawing/index.d.ts +2 -0
- package/dist/esm/utilities/drawing/index.js +2 -0
- package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.d.ts +12 -0
- package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.js +98 -0
- package/dist/esm/utilities/dynamicVolume/getDataInTime.d.ts +8 -0
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js +111 -0
- package/dist/esm/utilities/dynamicVolume/index.d.ts +4 -0
- package/dist/esm/utilities/dynamicVolume/index.js +4 -0
- package/dist/esm/utilities/geometricSurfaceUtils.d.ts +8 -0
- package/dist/esm/utilities/geometricSurfaceUtils.js +103 -0
- package/dist/esm/utilities/getAnnotationNearPoint.d.ts +5 -0
- package/dist/esm/utilities/getAnnotationNearPoint.js +46 -0
- package/dist/esm/utilities/getCalibratedUnits.d.ts +16 -0
- package/dist/esm/utilities/getCalibratedUnits.js +155 -0
- package/dist/esm/utilities/getPixelValueUnits.d.ts +8 -0
- package/dist/esm/utilities/getPixelValueUnits.js +31 -0
- package/dist/esm/utilities/getSphereBoundsInfo.d.ts +14 -0
- package/dist/esm/utilities/getSphereBoundsInfo.js +64 -0
- package/dist/esm/utilities/getToolsWithModesForElement.d.ts +4 -0
- package/dist/esm/utilities/getToolsWithModesForElement.js +24 -0
- package/dist/esm/utilities/getVOIMultipliers.d.ts +5 -0
- package/dist/esm/utilities/getVOIMultipliers.js +18 -0
- package/dist/esm/utilities/getViewportForAnnotation.d.ts +3 -0
- package/dist/esm/utilities/getViewportForAnnotation.js +5 -0
- package/dist/esm/utilities/getViewportsForAnnotation.d.ts +3 -0
- package/dist/esm/utilities/getViewportsForAnnotation.js +16 -0
- package/dist/esm/utilities/index.d.ts +40 -0
- package/dist/esm/utilities/index.js +40 -0
- package/dist/esm/utilities/isObject.d.ts +2 -0
- package/dist/esm/utilities/isObject.js +5 -0
- package/dist/esm/utilities/livewire/LiveWirePath.d.ts +19 -0
- package/dist/esm/utilities/livewire/LiveWirePath.js +71 -0
- package/dist/esm/utilities/livewire/LivewireScissors.d.ts +38 -0
- package/dist/esm/utilities/livewire/LivewireScissors.js +305 -0
- package/dist/esm/utilities/math/aabb/distanceToPoint.d.ts +2 -0
- package/dist/esm/utilities/math/aabb/distanceToPoint.js +4 -0
- package/dist/esm/utilities/math/aabb/distanceToPointSquared.d.ts +2 -0
- package/dist/esm/utilities/math/aabb/distanceToPointSquared.js +20 -0
- package/dist/esm/utilities/math/aabb/index.d.ts +3 -0
- package/dist/esm/utilities/math/aabb/index.js +3 -0
- package/dist/esm/utilities/math/aabb/intersectAABB.d.ts +2 -0
- package/dist/esm/utilities/math/aabb/intersectAABB.js +6 -0
- package/dist/esm/utilities/math/angle/angleBetweenLines.d.ts +6 -0
- package/dist/esm/utilities/math/angle/angleBetweenLines.js +30 -0
- package/dist/esm/utilities/math/angle/index.d.ts +2 -0
- package/dist/esm/utilities/math/angle/index.js +2 -0
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.d.ts +26 -0
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.js +119 -0
- package/dist/esm/utilities/math/basic/Calculator.d.ts +8 -0
- package/dist/esm/utilities/math/basic/Calculator.js +3 -0
- package/dist/esm/utilities/math/basic/index.d.ts +3 -0
- package/dist/esm/utilities/math/basic/index.js +3 -0
- package/dist/esm/utilities/math/circle/_types.d.ts +5 -0
- package/dist/esm/utilities/math/circle/_types.js +0 -0
- package/dist/esm/utilities/math/circle/getCanvasCircleCorners.d.ts +3 -0
- package/dist/esm/utilities/math/circle/getCanvasCircleCorners.js +8 -0
- package/dist/esm/utilities/math/circle/getCanvasCircleRadius.d.ts +2 -0
- package/dist/esm/utilities/math/circle/getCanvasCircleRadius.js +5 -0
- package/dist/esm/utilities/math/circle/index.d.ts +3 -0
- package/dist/esm/utilities/math/circle/index.js +3 -0
- package/dist/esm/utilities/math/ellipse/getCanvasEllipseCorners.d.ts +8 -0
- package/dist/esm/utilities/math/ellipse/getCanvasEllipseCorners.js +6 -0
- package/dist/esm/utilities/math/ellipse/index.d.ts +3 -0
- package/dist/esm/utilities/math/ellipse/index.js +3 -0
- package/dist/esm/utilities/math/ellipse/pointInEllipse.d.ts +11 -0
- package/dist/esm/utilities/math/ellipse/pointInEllipse.js +36 -0
- package/dist/esm/utilities/math/ellipse/pointInEllipsoidWithConstraint.d.ts +9 -0
- package/dist/esm/utilities/math/ellipse/pointInEllipsoidWithConstraint.js +2 -0
- package/dist/esm/utilities/math/index.d.ts +11 -0
- package/dist/esm/utilities/math/index.js +11 -0
- package/dist/esm/utilities/math/line/distanceToPoint.d.ts +2 -0
- package/dist/esm/utilities/math/line/distanceToPoint.js +7 -0
- package/dist/esm/utilities/math/line/distanceToPointSquared.d.ts +2 -0
- package/dist/esm/utilities/math/line/distanceToPointSquared.js +4 -0
- package/dist/esm/utilities/math/line/distanceToPointSquaredInfo.d.ts +5 -0
- package/dist/esm/utilities/math/line/distanceToPointSquaredInfo.js +29 -0
- package/dist/esm/utilities/math/line/index.d.ts +6 -0
- package/dist/esm/utilities/math/line/index.js +6 -0
- package/dist/esm/utilities/math/line/intersectLine.d.ts +2 -0
- package/dist/esm/utilities/math/line/intersectLine.js +41 -0
- package/dist/esm/utilities/math/line/isPointOnLineSegment.d.ts +2 -0
- package/dist/esm/utilities/math/line/isPointOnLineSegment.js +18 -0
- package/dist/esm/utilities/math/midPoint.d.ts +5 -0
- package/dist/esm/utilities/math/midPoint.js +15 -0
- package/dist/esm/utilities/math/point/distanceToPoint.d.ts +4 -0
- package/dist/esm/utilities/math/point/distanceToPoint.js +4 -0
- package/dist/esm/utilities/math/point/distanceToPointSquared.d.ts +4 -0
- package/dist/esm/utilities/math/point/distanceToPointSquared.js +11 -0
- package/dist/esm/utilities/math/point/index.d.ts +3 -0
- package/dist/esm/utilities/math/point/index.js +3 -0
- package/dist/esm/utilities/math/point/mirror.d.ts +2 -0
- package/dist/esm/utilities/math/point/mirror.js +7 -0
- package/dist/esm/utilities/math/polyline/addCanvasPointsToArray.d.ts +4 -0
- package/dist/esm/utilities/math/polyline/addCanvasPointsToArray.js +38 -0
- package/dist/esm/utilities/math/polyline/areLineSegmentsIntersecting.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/areLineSegmentsIntersecting.js +55 -0
- package/dist/esm/utilities/math/polyline/combinePolyline.d.ts +4 -0
- package/dist/esm/utilities/math/polyline/combinePolyline.js +186 -0
- package/dist/esm/utilities/math/polyline/containsPoint.d.ts +5 -0
- package/dist/esm/utilities/math/polyline/containsPoint.js +39 -0
- package/dist/esm/utilities/math/polyline/containsPoints.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/containsPoints.js +9 -0
- package/dist/esm/utilities/math/polyline/decimate.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/decimate.js +46 -0
- package/dist/esm/utilities/math/polyline/getAABB.d.ts +4 -0
- package/dist/esm/utilities/math/polyline/getAABB.js +40 -0
- package/dist/esm/utilities/math/polyline/getArea.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getArea.js +10 -0
- package/dist/esm/utilities/math/polyline/getClosestLineSegmentIntersection.d.ts +5 -0
- package/dist/esm/utilities/math/polyline/getClosestLineSegmentIntersection.js +44 -0
- package/dist/esm/utilities/math/polyline/getFirstLineSegmentIntersectionIndexes.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getFirstLineSegmentIntersectionIndexes.js +21 -0
- package/dist/esm/utilities/math/polyline/getLineSegmentIntersectionsCoordinates.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getLineSegmentIntersectionsCoordinates.js +13 -0
- package/dist/esm/utilities/math/polyline/getLineSegmentIntersectionsIndexes.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getLineSegmentIntersectionsIndexes.js +15 -0
- package/dist/esm/utilities/math/polyline/getLinesIntersection.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getLinesIntersection.js +51 -0
- package/dist/esm/utilities/math/polyline/getNormal2.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getNormal2.js +5 -0
- package/dist/esm/utilities/math/polyline/getNormal3.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getNormal3.js +25 -0
- package/dist/esm/utilities/math/polyline/getSignedArea.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getSignedArea.js +19 -0
- package/dist/esm/utilities/math/polyline/getSubPixelSpacingAndXYDirections.d.ts +7 -0
- package/dist/esm/utilities/math/polyline/getSubPixelSpacingAndXYDirections.js +72 -0
- package/dist/esm/utilities/math/polyline/getWindingDirection.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/getWindingDirection.js +5 -0
- package/dist/esm/utilities/math/polyline/index.d.ts +23 -0
- package/dist/esm/utilities/math/polyline/index.js +23 -0
- package/dist/esm/utilities/math/polyline/intersectPolyline.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/intersectPolyline.js +13 -0
- package/dist/esm/utilities/math/polyline/isClosed.d.ts +2 -0
- package/dist/esm/utilities/math/polyline/isClosed.js +12 -0
- package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.d.ts +4 -0
- package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js +25 -0
- package/dist/esm/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +25 -0
- package/dist/esm/utilities/math/polyline/planarFreehandROIInternalTypes.js +0 -0
- package/dist/esm/utilities/math/polyline/pointCanProjectOnLine.d.ts +3 -0
- package/dist/esm/utilities/math/polyline/pointCanProjectOnLine.js +32 -0
- package/dist/esm/utilities/math/polyline/pointsAreWithinCloseContourProximity.d.ts +3 -0
- package/dist/esm/utilities/math/polyline/pointsAreWithinCloseContourProximity.js +5 -0
- package/dist/esm/utilities/math/polyline/projectTo2D.d.ts +5 -0
- package/dist/esm/utilities/math/polyline/projectTo2D.js +25 -0
- package/dist/esm/utilities/math/rectangle/distanceToPoint.d.ts +2 -0
- package/dist/esm/utilities/math/rectangle/distanceToPoint.js +34 -0
- package/dist/esm/utilities/math/rectangle/index.d.ts +2 -0
- package/dist/esm/utilities/math/rectangle/index.js +2 -0
- package/dist/esm/utilities/math/sphere/index.d.ts +2 -0
- package/dist/esm/utilities/math/sphere/index.js +2 -0
- package/dist/esm/utilities/math/sphere/pointInSphere.d.ts +9 -0
- package/dist/esm/utilities/math/sphere/pointInSphere.js +8 -0
- package/dist/esm/utilities/math/vec2/findClosestPoint.d.ts +2 -0
- package/dist/esm/utilities/math/vec2/findClosestPoint.js +17 -0
- package/dist/esm/utilities/math/vec2/index.d.ts +3 -0
- package/dist/esm/utilities/math/vec2/index.js +3 -0
- package/dist/esm/utilities/math/vec2/liangBarksyClip.d.ts +1 -0
- package/dist/esm/utilities/math/vec2/liangBarksyClip.js +68 -0
- package/dist/esm/utilities/math/vec3/interpolateVec3.d.ts +2 -0
- package/dist/esm/utilities/math/vec3/interpolateVec3.js +8 -0
- package/dist/esm/utilities/normalizeViewportPlane.d.ts +19 -0
- package/dist/esm/utilities/normalizeViewportPlane.js +35 -0
- package/dist/esm/utilities/orientation/getOrientationStringLPS.d.ts +2 -0
- package/dist/esm/utilities/orientation/getOrientationStringLPS.js +41 -0
- package/dist/esm/utilities/orientation/index.d.ts +3 -0
- package/dist/esm/utilities/orientation/index.js +3 -0
- package/dist/esm/utilities/orientation/invertOrientationStringLPS.d.ts +1 -0
- package/dist/esm/utilities/orientation/invertOrientationStringLPS.js +10 -0
- package/dist/esm/utilities/planar/filterAnnotationsForDisplay.d.ts +3 -0
- package/dist/esm/utilities/planar/filterAnnotationsForDisplay.js +26 -0
- 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 +3 -0
- package/dist/esm/utilities/planar/filterAnnotationsWithinSlice.js +46 -0
- package/dist/esm/utilities/planar/getPointInLineOfSightWithCriteria.d.ts +6 -0
- package/dist/esm/utilities/planar/getPointInLineOfSightWithCriteria.js +49 -0
- package/dist/esm/utilities/planar/getWorldWidthAndHeightFromCorners.d.ts +5 -0
- package/dist/esm/utilities/planar/getWorldWidthAndHeightFromCorners.js +18 -0
- package/dist/esm/utilities/planar/getWorldWidthAndHeightFromTwoPoints.d.ts +5 -0
- package/dist/esm/utilities/planar/getWorldWidthAndHeightFromTwoPoints.js +18 -0
- package/dist/esm/utilities/planar/index.d.ts +19 -0
- package/dist/esm/utilities/planar/index.js +18 -0
- package/dist/esm/utilities/planar/isPlaneIntersectingAABB.d.ts +1 -0
- package/dist/esm/utilities/planar/isPlaneIntersectingAABB.js +27 -0
- package/dist/esm/utilities/planarFreehandROITool/index.d.ts +6 -0
- package/dist/esm/utilities/planarFreehandROITool/index.js +5 -0
- package/dist/esm/utilities/planarFreehandROITool/interpolation/algorithms/bspline.d.ts +2 -0
- package/dist/esm/utilities/planarFreehandROITool/interpolation/algorithms/bspline.js +22 -0
- package/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.d.ts +2 -0
- package/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.js +41 -0
- package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.d.ts +6 -0
- package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.js +56 -0
- package/dist/esm/utilities/planarFreehandROITool/smoothPoints.d.ts +11 -0
- package/dist/esm/utilities/planarFreehandROITool/smoothPoints.js +91 -0
- package/dist/esm/utilities/pointInSurroundingSphereCallback.d.ts +8 -0
- package/dist/esm/utilities/pointInSurroundingSphereCallback.js +71 -0
- package/dist/esm/utilities/pointToString.d.ts +1 -0
- package/dist/esm/utilities/pointToString.js +8 -0
- package/dist/esm/utilities/polyData/utils.d.ts +5 -0
- package/dist/esm/utilities/polyData/utils.js +53 -0
- package/dist/esm/utilities/rectangleROITool/getBoundsIJKFromRectangleAnnotations.d.ts +5 -0
- package/dist/esm/utilities/rectangleROITool/getBoundsIJKFromRectangleAnnotations.js +44 -0
- package/dist/esm/utilities/rectangleROITool/index.d.ts +3 -0
- package/dist/esm/utilities/rectangleROITool/index.js +3 -0
- package/dist/esm/utilities/rectangleROITool/isAxisAlignedRectangle.d.ts +2 -0
- package/dist/esm/utilities/rectangleROITool/isAxisAlignedRectangle.js +22 -0
- package/dist/esm/utilities/registerComputeWorker.d.ts +1 -0
- package/dist/esm/utilities/registerComputeWorker.js +23 -0
- package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.d.ts +11 -0
- package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.js +177 -0
- package/dist/esm/utilities/segmentation/InterpolationManager/deleteRelatedAnnotations.d.ts +2 -0
- package/dist/esm/utilities/segmentation/InterpolationManager/deleteRelatedAnnotations.js +66 -0
- package/dist/esm/utilities/segmentation/VolumetricCalculator.d.ts +15 -0
- package/dist/esm/utilities/segmentation/VolumetricCalculator.js +48 -0
- package/dist/esm/utilities/segmentation/brushSizeForToolGroup.d.ts +2 -0
- package/dist/esm/utilities/segmentation/brushSizeForToolGroup.js +40 -0
- package/dist/esm/utilities/segmentation/brushThresholdForToolGroup.d.ts +7 -0
- package/dist/esm/utilities/segmentation/brushThresholdForToolGroup.js +45 -0
- package/dist/esm/utilities/segmentation/computeAndAddRepresentation.d.ts +3 -0
- package/dist/esm/utilities/segmentation/computeAndAddRepresentation.js +45 -0
- package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.d.ts +1 -0
- package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.js +23 -0
- package/dist/esm/utilities/segmentation/createBidirectionalToolData.d.ts +14 -0
- package/dist/esm/utilities/segmentation/createBidirectionalToolData.js +35 -0
- package/dist/esm/utilities/segmentation/createLabelmapMemo.d.ts +44 -0
- package/dist/esm/utilities/segmentation/createLabelmapMemo.js +68 -0
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.d.ts +9 -0
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.js +28 -0
- package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.d.ts +3 -0
- package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.js +34 -0
- package/dist/esm/utilities/segmentation/findLargestBidirectional.d.ts +1 -0
- package/dist/esm/utilities/segmentation/findLargestBidirectional.js +95 -0
- package/dist/esm/utilities/segmentation/floodFill.d.ts +4 -0
- package/dist/esm/utilities/segmentation/floodFill.js +120 -0
- package/dist/esm/utilities/segmentation/getBrushToolInstances.d.ts +1 -0
- package/dist/esm/utilities/segmentation/getBrushToolInstances.js +17 -0
- package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts +1 -0
- package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.js +13 -0
- package/dist/esm/utilities/segmentation/getOrCreateSegmentationVolume.d.ts +2 -0
- package/dist/esm/utilities/segmentation/getOrCreateSegmentationVolume.js +21 -0
- package/dist/esm/utilities/segmentation/getSVGStyleForSegment.d.ts +17 -0
- package/dist/esm/utilities/segmentation/getSVGStyleForSegment.js +68 -0
- package/dist/esm/utilities/segmentation/getSegmentIndexAtLabelmapBorder.d.ts +7 -0
- package/dist/esm/utilities/segmentation/getSegmentIndexAtLabelmapBorder.js +76 -0
- package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.d.ts +11 -0
- package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.js +74 -0
- package/dist/esm/utilities/segmentation/getStatistics.d.ts +5 -0
- package/dist/esm/utilities/segmentation/getStatistics.js +210 -0
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.d.ts +2 -0
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +80 -0
- package/dist/esm/utilities/segmentation/growCut/growCutShader.d.ts +2 -0
- package/dist/esm/utilities/segmentation/growCut/growCutShader.js +106 -0
- package/dist/esm/utilities/segmentation/growCut/index.d.ts +7 -0
- package/dist/esm/utilities/segmentation/growCut/index.js +4 -0
- package/dist/esm/utilities/segmentation/growCut/runGrowCut.d.ts +16 -0
- package/dist/esm/utilities/segmentation/growCut/runGrowCut.js +269 -0
- package/dist/esm/utilities/segmentation/growCut/runGrowCutForBoundingBox.d.ts +15 -0
- package/dist/esm/utilities/segmentation/growCut/runGrowCutForBoundingBox.js +110 -0
- package/dist/esm/utilities/segmentation/growCut/runGrowCutForSphere.d.ts +9 -0
- package/dist/esm/utilities/segmentation/growCut/runGrowCutForSphere.js +164 -0
- package/dist/esm/utilities/segmentation/growCut/runOneClickGrowCut.d.ts +9 -0
- package/dist/esm/utilities/segmentation/growCut/runOneClickGrowCut.js +176 -0
- package/dist/esm/utilities/segmentation/index.d.ts +28 -0
- package/dist/esm/utilities/segmentation/index.js +28 -0
- package/dist/esm/utilities/segmentation/invalidateBrushCursor.d.ts +1 -0
- package/dist/esm/utilities/segmentation/invalidateBrushCursor.js +20 -0
- package/dist/esm/utilities/segmentation/isLineInSegment.d.ts +9 -0
- package/dist/esm/utilities/segmentation/isLineInSegment.js +49 -0
- package/dist/esm/utilities/segmentation/islandRemoval.d.ts +28 -0
- package/dist/esm/utilities/segmentation/islandRemoval.js +181 -0
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.d.ts +20 -0
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.js +35 -0
- package/dist/esm/utilities/segmentation/segmentContourAction.d.ts +17 -0
- package/dist/esm/utilities/segmentation/segmentContourAction.js +95 -0
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.d.ts +4 -0
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.js +58 -0
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.d.ts +11 -0
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js +79 -0
- package/dist/esm/utilities/segmentation/utilities.d.ts +25 -0
- package/dist/esm/utilities/segmentation/utilities.js +86 -0
- package/dist/esm/utilities/segmentation/validateLabelmap.d.ts +4 -0
- package/dist/esm/utilities/segmentation/validateLabelmap.js +32 -0
- package/dist/esm/utilities/stackPrefetch/index.d.ts +3 -0
- package/dist/esm/utilities/stackPrefetch/index.js +3 -0
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.d.ts +16 -0
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.js +221 -0
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.d.ts +14 -0
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.js +150 -0
- package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.d.ts +14 -0
- package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.js +76 -0
- package/dist/esm/utilities/stackPrefetch/state.d.ts +22 -0
- package/dist/esm/utilities/stackPrefetch/state.js +13 -0
- package/dist/esm/utilities/throttle.d.ts +5 -0
- package/dist/esm/utilities/throttle.js +19 -0
- package/dist/esm/utilities/touch/index.d.ts +10 -0
- package/dist/esm/utilities/touch/index.js +152 -0
- package/dist/esm/utilities/triggerAnnotationRender.d.ts +2 -0
- package/dist/esm/utilities/triggerAnnotationRender.js +5 -0
- package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.d.ts +2 -0
- package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js +24 -0
- package/dist/esm/utilities/triggerAnnotationRenderForViewportIds.d.ts +2 -0
- package/dist/esm/utilities/triggerAnnotationRenderForViewportIds.js +22 -0
- package/dist/esm/utilities/viewport/index.d.ts +2 -0
- package/dist/esm/utilities/viewport/index.js +2 -0
- package/dist/esm/utilities/viewport/isViewportPreScaled.d.ts +3 -0
- package/dist/esm/utilities/viewport/isViewportPreScaled.js +16 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithFrameOfReferenceUID.d.ts +2 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithFrameOfReferenceUID.js +11 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithParallelNormals.d.ts +2 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithParallelNormals.js +10 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithSameOrientation.d.ts +2 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithSameOrientation.js +9 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithToolEnabled.d.ts +2 -0
- package/dist/esm/utilities/viewportFilters/filterViewportsWithToolEnabled.js +28 -0
- package/dist/esm/utilities/viewportFilters/getViewportIdsWithToolToRender.d.ts +1 -0
- package/dist/esm/utilities/viewportFilters/getViewportIdsWithToolToRender.js +17 -0
- package/dist/esm/utilities/viewportFilters/index.d.ts +5 -0
- package/dist/esm/utilities/viewportFilters/index.js +5 -0
- package/dist/esm/utilities/voi/colorbar/Colorbar.d.ts +44 -0
- package/dist/esm/utilities/voi/colorbar/Colorbar.js +242 -0
- package/dist/esm/utilities/voi/colorbar/ColorbarCanvas.d.ts +29 -0
- package/dist/esm/utilities/voi/colorbar/ColorbarCanvas.js +182 -0
- package/dist/esm/utilities/voi/colorbar/ColorbarTicks.d.ts +46 -0
- package/dist/esm/utilities/voi/colorbar/ColorbarTicks.js +280 -0
- package/dist/esm/utilities/voi/colorbar/ViewportColorbar.d.ts +25 -0
- package/dist/esm/utilities/voi/colorbar/ViewportColorbar.js +146 -0
- package/dist/esm/utilities/voi/colorbar/common/areColorbarRangesEqual.d.ts +3 -0
- package/dist/esm/utilities/voi/colorbar/common/areColorbarRangesEqual.js +4 -0
- package/dist/esm/utilities/voi/colorbar/common/areColorbarSizesEqual.d.ts +3 -0
- package/dist/esm/utilities/voi/colorbar/common/areColorbarSizesEqual.js +4 -0
- package/dist/esm/utilities/voi/colorbar/common/index.d.ts +4 -0
- package/dist/esm/utilities/voi/colorbar/common/index.js +4 -0
- package/dist/esm/utilities/voi/colorbar/common/isColorbarSizeValid.d.ts +3 -0
- package/dist/esm/utilities/voi/colorbar/common/isColorbarSizeValid.js +4 -0
- package/dist/esm/utilities/voi/colorbar/common/isRangeTextPositionValid.d.ts +3 -0
- package/dist/esm/utilities/voi/colorbar/common/isRangeTextPositionValid.js +9 -0
- package/dist/esm/utilities/voi/colorbar/common/isRangeValid.d.ts +3 -0
- package/dist/esm/utilities/voi/colorbar/common/isRangeValid.js +4 -0
- package/dist/esm/utilities/voi/colorbar/enums/ColorbarRangeTextPosition.d.ts +6 -0
- package/dist/esm/utilities/voi/colorbar/enums/ColorbarRangeTextPosition.js +7 -0
- package/dist/esm/utilities/voi/colorbar/enums/index.d.ts +1 -0
- package/dist/esm/utilities/voi/colorbar/enums/index.js +1 -0
- package/dist/esm/utilities/voi/colorbar/index.d.ts +6 -0
- package/dist/esm/utilities/voi/colorbar/index.js +4 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCanvasProps.d.ts +12 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCanvasProps.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCommonProps.d.ts +11 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCommonProps.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarImageRange.d.ts +4 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarImageRange.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarProps.d.ts +7 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarProps.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarSize.d.ts +4 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarSize.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarTicksProps.d.ts +7 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarTicksProps.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarTicksStyle.d.ts +8 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarTicksStyle.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarVOIRange.d.ts +2 -0
- package/dist/esm/utilities/voi/colorbar/types/ColorbarVOIRange.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/ViewportColorbarProps.d.ts +5 -0
- package/dist/esm/utilities/voi/colorbar/types/ViewportColorbarProps.js +0 -0
- package/dist/esm/utilities/voi/colorbar/types/index.d.ts +8 -0
- package/dist/esm/utilities/voi/colorbar/types/index.js +0 -0
- package/dist/esm/utilities/voi/index.d.ts +3 -0
- package/dist/esm/utilities/voi/index.js +3 -0
- package/dist/esm/utilities/voi/windowlevel/calculateMinMaxMean.d.ts +6 -0
- package/dist/esm/utilities/voi/windowlevel/calculateMinMaxMean.js +25 -0
- package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.d.ts +11 -0
- package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js +42 -0
- package/dist/esm/utilities/voi/windowlevel/getLuminanceFromRegion.d.ts +2 -0
- package/dist/esm/utilities/voi/windowlevel/getLuminanceFromRegion.js +27 -0
- package/dist/esm/utilities/voi/windowlevel/index.d.ts +4 -0
- package/dist/esm/utilities/voi/windowlevel/index.js +4 -0
- package/dist/esm/widgets/Widget.d.ts +17 -0
- package/dist/esm/widgets/Widget.js +66 -0
- package/dist/esm/widgets/types/WidgetProps.d.ts +4 -0
- package/dist/esm/widgets/types/WidgetProps.js +0 -0
- package/dist/esm/widgets/types/WidgetSize.d.ts +4 -0
- package/dist/esm/widgets/types/WidgetSize.js +0 -0
- package/dist/esm/widgets/types/index.d.ts +2 -0
- package/dist/esm/widgets/types/index.js +0 -0
- package/dist/esm/workers/computeWorker.d.ts +1 -0
- package/dist/esm/workers/computeWorker.js +78 -0
- package/package.json +113 -100
- package/changelog.md +0 -304
- package/dist/cornerstoneTools.js +0 -27391
- package/dist/cornerstoneTools.js.map +0 -1
- package/dist/cornerstoneTools.min.js +0 -3
- package/dist/cornerstoneTools.min.js.map +0 -1
|
@@ -0,0 +1,1449 @@
|
|
|
1
|
+
import { vec2, vec3 } from 'gl-matrix';
|
|
2
|
+
import vtkMath from '@kitware/vtk.js/Common/Core/Math';
|
|
3
|
+
import vtkMatrixBuilder from '@kitware/vtk.js/Common/Core/MatrixBuilder';
|
|
4
|
+
import { AnnotationTool } from './base';
|
|
5
|
+
import { getEnabledElementByIds, getEnabledElement, utilities as csUtils, Enums, CONSTANTS, } from '@cornerstonejs/core';
|
|
6
|
+
import { getToolGroup, getToolGroupForViewport, } from '../store/ToolGroupManager';
|
|
7
|
+
import { addAnnotation, getAnnotations, removeAnnotation, } from '../stateManagement/annotation/annotationState';
|
|
8
|
+
import { drawCircle as drawCircleSvg, drawHandles as drawHandlesSvg, drawLine as drawLineSvg, } from '../drawingSvg';
|
|
9
|
+
import { state } from '../store/state';
|
|
10
|
+
import { Events } from '../enums';
|
|
11
|
+
import { getViewportIdsWithToolToRender } from '../utilities/viewportFilters';
|
|
12
|
+
import { resetElementCursor, hideElementCursor, } from '../cursors/elementCursor';
|
|
13
|
+
import liangBarksyClip from '../utilities/math/vec2/liangBarksyClip';
|
|
14
|
+
import * as lineSegment from '../utilities/math/line';
|
|
15
|
+
import { isAnnotationLocked } from '../stateManagement/annotation/annotationLocking';
|
|
16
|
+
import triggerAnnotationRenderForViewportIds from '../utilities/triggerAnnotationRenderForViewportIds';
|
|
17
|
+
const { RENDERING_DEFAULTS } = CONSTANTS;
|
|
18
|
+
function defaultReferenceLineColor() {
|
|
19
|
+
return 'rgb(0, 200, 0)';
|
|
20
|
+
}
|
|
21
|
+
function defaultReferenceLineControllable() {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
function defaultReferenceLineDraggableRotatable() {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
function defaultReferenceLineSlabThicknessControlsOn() {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
const OPERATION = {
|
|
31
|
+
DRAG: 1,
|
|
32
|
+
ROTATE: 2,
|
|
33
|
+
SLAB: 3,
|
|
34
|
+
};
|
|
35
|
+
const EPSILON = 1e-3;
|
|
36
|
+
class CrosshairsTool extends AnnotationTool {
|
|
37
|
+
constructor(toolProps = {}, defaultToolProps = {
|
|
38
|
+
supportedInteractionTypes: ['Mouse'],
|
|
39
|
+
configuration: {
|
|
40
|
+
shadow: true,
|
|
41
|
+
viewportIndicators: false,
|
|
42
|
+
viewportIndicatorsConfig: {
|
|
43
|
+
radius: 5,
|
|
44
|
+
x: null,
|
|
45
|
+
y: null,
|
|
46
|
+
},
|
|
47
|
+
autoPan: {
|
|
48
|
+
enabled: false,
|
|
49
|
+
panSize: 10,
|
|
50
|
+
},
|
|
51
|
+
handleRadius: 3,
|
|
52
|
+
enableHDPIHandles: false,
|
|
53
|
+
referenceLinesCenterGapRadius: 20,
|
|
54
|
+
filterActorUIDsToSetSlabThickness: [],
|
|
55
|
+
slabThicknessBlendMode: Enums.BlendModes.MAXIMUM_INTENSITY_BLEND,
|
|
56
|
+
mobile: {
|
|
57
|
+
enabled: false,
|
|
58
|
+
opacity: 0.8,
|
|
59
|
+
handleRadius: 9,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
}) {
|
|
63
|
+
super(toolProps, defaultToolProps);
|
|
64
|
+
this.toolCenter = [0, 0, 0];
|
|
65
|
+
this.initializeViewport = ({ renderingEngineId, viewportId, }) => {
|
|
66
|
+
const enabledElement = getEnabledElementByIds(viewportId, renderingEngineId);
|
|
67
|
+
if (!enabledElement) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const { FrameOfReferenceUID, viewport } = enabledElement;
|
|
71
|
+
const { element } = viewport;
|
|
72
|
+
const { position, focalPoint, viewPlaneNormal } = viewport.getCamera();
|
|
73
|
+
let annotations = this._getAnnotations(enabledElement);
|
|
74
|
+
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
75
|
+
if (annotations?.length) {
|
|
76
|
+
removeAnnotation(annotations[0].annotationUID);
|
|
77
|
+
}
|
|
78
|
+
const annotation = {
|
|
79
|
+
highlighted: false,
|
|
80
|
+
metadata: {
|
|
81
|
+
cameraPosition: [...position],
|
|
82
|
+
cameraFocalPoint: [...focalPoint],
|
|
83
|
+
FrameOfReferenceUID,
|
|
84
|
+
toolName: this.getToolName(),
|
|
85
|
+
},
|
|
86
|
+
data: {
|
|
87
|
+
handles: {
|
|
88
|
+
rotationPoints: [],
|
|
89
|
+
slabThicknessPoints: [],
|
|
90
|
+
toolCenter: this.toolCenter,
|
|
91
|
+
},
|
|
92
|
+
activeOperation: null,
|
|
93
|
+
activeViewportIds: [],
|
|
94
|
+
viewportId,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
addAnnotation(annotation, element);
|
|
98
|
+
return {
|
|
99
|
+
normal: viewPlaneNormal,
|
|
100
|
+
point: viewport.canvasToWorld([
|
|
101
|
+
viewport.canvas.clientWidth / 2,
|
|
102
|
+
viewport.canvas.clientHeight / 2,
|
|
103
|
+
]),
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
this._getViewportsInfo = () => {
|
|
107
|
+
const viewports = getToolGroup(this.toolGroupId).viewportsInfo;
|
|
108
|
+
return viewports;
|
|
109
|
+
};
|
|
110
|
+
this.resetCrosshairs = () => {
|
|
111
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
112
|
+
for (const viewportInfo of viewportsInfo) {
|
|
113
|
+
const { viewportId, renderingEngineId } = viewportInfo;
|
|
114
|
+
const enabledElement = getEnabledElementByIds(viewportId, renderingEngineId);
|
|
115
|
+
const viewport = enabledElement.viewport;
|
|
116
|
+
const resetPan = true;
|
|
117
|
+
const resetZoom = true;
|
|
118
|
+
const resetToCenter = true;
|
|
119
|
+
const resetRotation = true;
|
|
120
|
+
const suppressEvents = true;
|
|
121
|
+
viewport.resetCamera({
|
|
122
|
+
resetPan,
|
|
123
|
+
resetZoom,
|
|
124
|
+
resetToCenter,
|
|
125
|
+
resetRotation,
|
|
126
|
+
suppressEvents,
|
|
127
|
+
});
|
|
128
|
+
viewport.resetSlabThickness();
|
|
129
|
+
const { element } = viewport;
|
|
130
|
+
let annotations = this._getAnnotations(enabledElement);
|
|
131
|
+
annotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
132
|
+
if (annotations.length) {
|
|
133
|
+
removeAnnotation(annotations[0].annotationUID);
|
|
134
|
+
}
|
|
135
|
+
viewport.render();
|
|
136
|
+
}
|
|
137
|
+
this._computeToolCenter(viewportsInfo);
|
|
138
|
+
};
|
|
139
|
+
this.computeToolCenter = () => {
|
|
140
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
141
|
+
this._computeToolCenter(viewportsInfo);
|
|
142
|
+
};
|
|
143
|
+
this._computeToolCenter = (viewportsInfo) => {
|
|
144
|
+
if (!viewportsInfo.length || viewportsInfo.length === 1) {
|
|
145
|
+
console.warn('For crosshairs to operate, at least two viewports must be given.');
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const [firstViewport, secondViewport, thirdViewport] = viewportsInfo;
|
|
149
|
+
const { normal: normal1, point: point1 } = this.initializeViewport(firstViewport);
|
|
150
|
+
const { normal: normal2, point: point2 } = this.initializeViewport(secondViewport);
|
|
151
|
+
let normal3 = [0, 0, 0];
|
|
152
|
+
let point3 = vec3.create();
|
|
153
|
+
if (thirdViewport) {
|
|
154
|
+
({ normal: normal3, point: point3 } =
|
|
155
|
+
this.initializeViewport(thirdViewport));
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
vec3.add(point3, point1, point2);
|
|
159
|
+
vec3.scale(point3, point3, 0.5);
|
|
160
|
+
vec3.cross(normal3, normal1, normal2);
|
|
161
|
+
}
|
|
162
|
+
const firstPlane = csUtils.planar.planeEquation(normal1, point1);
|
|
163
|
+
const secondPlane = csUtils.planar.planeEquation(normal2, point2);
|
|
164
|
+
const thirdPlane = csUtils.planar.planeEquation(normal3, point3);
|
|
165
|
+
this.toolCenter = csUtils.planar.threePlaneIntersection(firstPlane, secondPlane, thirdPlane);
|
|
166
|
+
triggerAnnotationRenderForViewportIds(viewportsInfo.map(({ viewportId }) => viewportId));
|
|
167
|
+
};
|
|
168
|
+
this.addNewAnnotation = (evt) => {
|
|
169
|
+
const eventDetail = evt.detail;
|
|
170
|
+
const { element } = eventDetail;
|
|
171
|
+
const { currentPoints } = eventDetail;
|
|
172
|
+
const jumpWorld = currentPoints.world;
|
|
173
|
+
const enabledElement = getEnabledElement(element);
|
|
174
|
+
const { viewport } = enabledElement;
|
|
175
|
+
this._jump(enabledElement, jumpWorld);
|
|
176
|
+
const annotations = this._getAnnotations(enabledElement);
|
|
177
|
+
const filteredAnnotations = this.filterInteractableAnnotationsForElement(viewport.element, annotations);
|
|
178
|
+
const { data } = filteredAnnotations[0];
|
|
179
|
+
const { rotationPoints } = data.handles;
|
|
180
|
+
const viewportIdArray = [];
|
|
181
|
+
for (let i = 0; i < rotationPoints.length - 1; ++i) {
|
|
182
|
+
const otherViewport = rotationPoints[i][1];
|
|
183
|
+
const viewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
184
|
+
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
185
|
+
if (!viewportControllable || !viewportDraggableRotatable) {
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
viewportIdArray.push(otherViewport.id);
|
|
189
|
+
i++;
|
|
190
|
+
}
|
|
191
|
+
data.activeViewportIds = [...viewportIdArray];
|
|
192
|
+
data.handles.activeOperation = OPERATION.DRAG;
|
|
193
|
+
evt.preventDefault();
|
|
194
|
+
hideElementCursor(element);
|
|
195
|
+
this._activateModify(element);
|
|
196
|
+
return filteredAnnotations[0];
|
|
197
|
+
};
|
|
198
|
+
this.cancel = () => {
|
|
199
|
+
console.log('Not implemented yet');
|
|
200
|
+
};
|
|
201
|
+
this.handleSelectedCallback = (evt, annotation) => {
|
|
202
|
+
const eventDetail = evt.detail;
|
|
203
|
+
const { element } = eventDetail;
|
|
204
|
+
annotation.highlighted = true;
|
|
205
|
+
this._activateModify(element);
|
|
206
|
+
hideElementCursor(element);
|
|
207
|
+
evt.preventDefault();
|
|
208
|
+
};
|
|
209
|
+
this.isPointNearTool = (element, annotation, canvasCoords, proximity) => {
|
|
210
|
+
if (this._pointNearTool(element, annotation, canvasCoords, 6)) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
return false;
|
|
214
|
+
};
|
|
215
|
+
this.toolSelectedCallback = (evt, annotation, interactionType) => {
|
|
216
|
+
const eventDetail = evt.detail;
|
|
217
|
+
const { element } = eventDetail;
|
|
218
|
+
annotation.highlighted = true;
|
|
219
|
+
this._activateModify(element);
|
|
220
|
+
hideElementCursor(element);
|
|
221
|
+
evt.preventDefault();
|
|
222
|
+
};
|
|
223
|
+
this.onCameraModified = (evt) => {
|
|
224
|
+
const eventDetail = evt.detail;
|
|
225
|
+
const { element } = eventDetail;
|
|
226
|
+
const enabledElement = getEnabledElement(element);
|
|
227
|
+
const { renderingEngine } = enabledElement;
|
|
228
|
+
const viewport = enabledElement.viewport;
|
|
229
|
+
const annotations = this._getAnnotations(enabledElement);
|
|
230
|
+
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
231
|
+
const viewportAnnotation = filteredToolAnnotations[0];
|
|
232
|
+
if (!viewportAnnotation) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const currentCamera = viewport.getCamera();
|
|
236
|
+
const oldCameraPosition = viewportAnnotation.metadata.cameraPosition;
|
|
237
|
+
const deltaCameraPosition = [0, 0, 0];
|
|
238
|
+
vtkMath.subtract(currentCamera.position, oldCameraPosition, deltaCameraPosition);
|
|
239
|
+
const oldCameraFocalPoint = viewportAnnotation.metadata.cameraFocalPoint;
|
|
240
|
+
const deltaCameraFocalPoint = [0, 0, 0];
|
|
241
|
+
vtkMath.subtract(currentCamera.focalPoint, oldCameraFocalPoint, deltaCameraFocalPoint);
|
|
242
|
+
viewportAnnotation.metadata.cameraPosition = [...currentCamera.position];
|
|
243
|
+
viewportAnnotation.metadata.cameraFocalPoint = [
|
|
244
|
+
...currentCamera.focalPoint,
|
|
245
|
+
];
|
|
246
|
+
const viewportControllable = this._getReferenceLineControllable(viewport.id);
|
|
247
|
+
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(viewport.id);
|
|
248
|
+
if (!csUtils.isEqual(currentCamera.position, oldCameraPosition, 1e-3) &&
|
|
249
|
+
viewportControllable &&
|
|
250
|
+
viewportDraggableRotatable) {
|
|
251
|
+
let isRotation = false;
|
|
252
|
+
const cameraModifiedSameForPosAndFocalPoint = csUtils.isEqual(deltaCameraPosition, deltaCameraFocalPoint, 1e-3);
|
|
253
|
+
if (!cameraModifiedSameForPosAndFocalPoint) {
|
|
254
|
+
isRotation = true;
|
|
255
|
+
}
|
|
256
|
+
const cameraModifiedInPlane = Math.abs(vtkMath.dot(deltaCameraPosition, currentCamera.viewPlaneNormal)) < 1e-2;
|
|
257
|
+
if (!isRotation && !cameraModifiedInPlane) {
|
|
258
|
+
this.toolCenter[0] += deltaCameraPosition[0];
|
|
259
|
+
this.toolCenter[1] += deltaCameraPosition[1];
|
|
260
|
+
this.toolCenter[2] += deltaCameraPosition[2];
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (this.configuration.autoPan?.enabled) {
|
|
264
|
+
const toolGroup = getToolGroupForViewport(viewport.id, renderingEngine.id);
|
|
265
|
+
const otherViewportIds = toolGroup
|
|
266
|
+
.getViewportIds()
|
|
267
|
+
.filter((id) => id !== viewport.id);
|
|
268
|
+
otherViewportIds.forEach((viewportId) => {
|
|
269
|
+
this._autoPanViewportIfNecessary(viewportId, renderingEngine);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
const requireSameOrientation = false;
|
|
273
|
+
const viewportIdsToRender = getViewportIdsWithToolToRender(element, this.getToolName(), requireSameOrientation);
|
|
274
|
+
triggerAnnotationRenderForViewportIds(viewportIdsToRender);
|
|
275
|
+
};
|
|
276
|
+
this.onResetCamera = (evt) => {
|
|
277
|
+
this.resetCrosshairs();
|
|
278
|
+
};
|
|
279
|
+
this.mouseMoveCallback = (evt, filteredToolAnnotations) => {
|
|
280
|
+
const { element, currentPoints } = evt.detail;
|
|
281
|
+
const canvasCoords = currentPoints.canvas;
|
|
282
|
+
let imageNeedsUpdate = false;
|
|
283
|
+
for (let i = 0; i < filteredToolAnnotations.length; i++) {
|
|
284
|
+
const annotation = filteredToolAnnotations[i];
|
|
285
|
+
if (isAnnotationLocked(annotation.annotationUID)) {
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
const { data, highlighted } = annotation;
|
|
289
|
+
if (!data.handles) {
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
const previousActiveOperation = data.handles.activeOperation;
|
|
293
|
+
const previousActiveViewportIds = data.activeViewportIds && data.activeViewportIds.length > 0
|
|
294
|
+
? [...data.activeViewportIds]
|
|
295
|
+
: [];
|
|
296
|
+
data.activeViewportIds = [];
|
|
297
|
+
data.handles.activeOperation = null;
|
|
298
|
+
const handleNearImagePoint = this.getHandleNearImagePoint(element, annotation, canvasCoords, 6);
|
|
299
|
+
let near = false;
|
|
300
|
+
if (handleNearImagePoint) {
|
|
301
|
+
near = true;
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
near = this._pointNearTool(element, annotation, canvasCoords, 6);
|
|
305
|
+
}
|
|
306
|
+
const nearToolAndNotMarkedActive = near && !highlighted;
|
|
307
|
+
const notNearToolAndMarkedActive = !near && highlighted;
|
|
308
|
+
if (nearToolAndNotMarkedActive || notNearToolAndMarkedActive) {
|
|
309
|
+
annotation.highlighted = !highlighted;
|
|
310
|
+
imageNeedsUpdate = true;
|
|
311
|
+
}
|
|
312
|
+
else if (data.handles.activeOperation !== previousActiveOperation ||
|
|
313
|
+
!this._areViewportIdArraysEqual(data.activeViewportIds, previousActiveViewportIds)) {
|
|
314
|
+
imageNeedsUpdate = true;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return imageNeedsUpdate;
|
|
318
|
+
};
|
|
319
|
+
this.filterInteractableAnnotationsForElement = (element, annotations) => {
|
|
320
|
+
if (!annotations || !annotations.length) {
|
|
321
|
+
return [];
|
|
322
|
+
}
|
|
323
|
+
const enabledElement = getEnabledElement(element);
|
|
324
|
+
const { viewportId } = enabledElement;
|
|
325
|
+
const viewportUIDSpecificCrosshairs = annotations.filter((annotation) => annotation.data.viewportId === viewportId);
|
|
326
|
+
return viewportUIDSpecificCrosshairs;
|
|
327
|
+
};
|
|
328
|
+
this.renderAnnotation = (enabledElement, svgDrawingHelper) => {
|
|
329
|
+
let renderStatus = false;
|
|
330
|
+
const { viewport, renderingEngine } = enabledElement;
|
|
331
|
+
const { element } = viewport;
|
|
332
|
+
const annotations = this._getAnnotations(enabledElement);
|
|
333
|
+
const camera = viewport.getCamera();
|
|
334
|
+
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
335
|
+
const viewportAnnotation = filteredToolAnnotations[0];
|
|
336
|
+
if (!annotations?.length || !viewportAnnotation?.data) {
|
|
337
|
+
return renderStatus;
|
|
338
|
+
}
|
|
339
|
+
const annotationUID = viewportAnnotation.annotationUID;
|
|
340
|
+
const { clientWidth, clientHeight } = viewport.canvas;
|
|
341
|
+
const canvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
342
|
+
const canvasMinDimensionLength = Math.min(clientWidth, clientHeight);
|
|
343
|
+
const data = viewportAnnotation.data;
|
|
344
|
+
const crosshairCenterCanvas = viewport.worldToCanvas(this.toolCenter);
|
|
345
|
+
const otherViewportAnnotations = this._filterAnnotationsByUniqueViewportOrientations(enabledElement, annotations);
|
|
346
|
+
const referenceLines = [];
|
|
347
|
+
const canvasBox = [0, 0, clientWidth, clientHeight];
|
|
348
|
+
otherViewportAnnotations.forEach((annotation) => {
|
|
349
|
+
const { data } = annotation;
|
|
350
|
+
data.handles.toolCenter = this.toolCenter;
|
|
351
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
352
|
+
const otherCamera = otherViewport.getCamera();
|
|
353
|
+
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
354
|
+
const otherViewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
355
|
+
const otherViewportSlabThicknessControlsOn = this._getReferenceLineSlabThicknessControlsOn(otherViewport.id);
|
|
356
|
+
const { clientWidth, clientHeight } = otherViewport.canvas;
|
|
357
|
+
const otherCanvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
358
|
+
const otherCanvasCenter = [
|
|
359
|
+
clientWidth * 0.5,
|
|
360
|
+
clientHeight * 0.5,
|
|
361
|
+
];
|
|
362
|
+
const otherViewportCenterWorld = otherViewport.canvasToWorld(otherCanvasCenter);
|
|
363
|
+
const direction = [0, 0, 0];
|
|
364
|
+
vtkMath.cross(camera.viewPlaneNormal, otherCamera.viewPlaneNormal, direction);
|
|
365
|
+
vtkMath.normalize(direction);
|
|
366
|
+
vtkMath.multiplyScalar(direction, otherCanvasDiagonalLength);
|
|
367
|
+
const pointWorld0 = [0, 0, 0];
|
|
368
|
+
vtkMath.add(otherViewportCenterWorld, direction, pointWorld0);
|
|
369
|
+
const pointWorld1 = [0, 0, 0];
|
|
370
|
+
vtkMath.subtract(otherViewportCenterWorld, direction, pointWorld1);
|
|
371
|
+
const pointCanvas0 = viewport.worldToCanvas(pointWorld0);
|
|
372
|
+
const otherViewportCenterCanvas = viewport.worldToCanvas(otherViewportCenterWorld);
|
|
373
|
+
const canvasUnitVectorFromCenter = vec2.create();
|
|
374
|
+
vec2.subtract(canvasUnitVectorFromCenter, pointCanvas0, otherViewportCenterCanvas);
|
|
375
|
+
vec2.normalize(canvasUnitVectorFromCenter, canvasUnitVectorFromCenter);
|
|
376
|
+
const canvasVectorFromCenterLong = vec2.create();
|
|
377
|
+
vec2.scale(canvasVectorFromCenterLong, canvasUnitVectorFromCenter, canvasDiagonalLength * 100);
|
|
378
|
+
const canvasVectorFromCenterMid = vec2.create();
|
|
379
|
+
vec2.scale(canvasVectorFromCenterMid, canvasUnitVectorFromCenter, canvasMinDimensionLength * 0.4);
|
|
380
|
+
const canvasVectorFromCenterShort = vec2.create();
|
|
381
|
+
vec2.scale(canvasVectorFromCenterShort, canvasUnitVectorFromCenter, canvasMinDimensionLength * 0.2);
|
|
382
|
+
const canvasVectorFromCenterStart = vec2.create();
|
|
383
|
+
const centerGap = this.configuration.referenceLinesCenterGapRadius;
|
|
384
|
+
vec2.scale(canvasVectorFromCenterStart, canvasUnitVectorFromCenter, otherViewportAnnotations.length === 2 ? centerGap : 0);
|
|
385
|
+
const refLinePointOne = vec2.create();
|
|
386
|
+
const refLinePointTwo = vec2.create();
|
|
387
|
+
const refLinePointThree = vec2.create();
|
|
388
|
+
const refLinePointFour = vec2.create();
|
|
389
|
+
let refLinesCenter = vec2.clone(crosshairCenterCanvas);
|
|
390
|
+
if (!otherViewportDraggableRotatable || !otherViewportControllable) {
|
|
391
|
+
refLinesCenter = vec2.clone(otherViewportCenterCanvas);
|
|
392
|
+
}
|
|
393
|
+
vec2.add(refLinePointOne, refLinesCenter, canvasVectorFromCenterStart);
|
|
394
|
+
vec2.add(refLinePointTwo, refLinesCenter, canvasVectorFromCenterLong);
|
|
395
|
+
vec2.subtract(refLinePointThree, refLinesCenter, canvasVectorFromCenterStart);
|
|
396
|
+
vec2.subtract(refLinePointFour, refLinesCenter, canvasVectorFromCenterLong);
|
|
397
|
+
liangBarksyClip(refLinePointOne, refLinePointTwo, canvasBox);
|
|
398
|
+
liangBarksyClip(refLinePointThree, refLinePointFour, canvasBox);
|
|
399
|
+
const rotHandleOne = vec2.create();
|
|
400
|
+
vec2.subtract(rotHandleOne, crosshairCenterCanvas, canvasVectorFromCenterMid);
|
|
401
|
+
const rotHandleTwo = vec2.create();
|
|
402
|
+
vec2.add(rotHandleTwo, crosshairCenterCanvas, canvasVectorFromCenterMid);
|
|
403
|
+
let stHandlesCenterCanvas = vec2.clone(crosshairCenterCanvas);
|
|
404
|
+
if (!otherViewportDraggableRotatable &&
|
|
405
|
+
otherViewportSlabThicknessControlsOn) {
|
|
406
|
+
stHandlesCenterCanvas = vec2.clone(otherViewportCenterCanvas);
|
|
407
|
+
}
|
|
408
|
+
let stHandlesCenterWorld = [...this.toolCenter];
|
|
409
|
+
if (!otherViewportDraggableRotatable &&
|
|
410
|
+
otherViewportSlabThicknessControlsOn) {
|
|
411
|
+
stHandlesCenterWorld = [...otherViewportCenterWorld];
|
|
412
|
+
}
|
|
413
|
+
const worldUnitVectorFromCenter = [0, 0, 0];
|
|
414
|
+
vtkMath.subtract(pointWorld0, pointWorld1, worldUnitVectorFromCenter);
|
|
415
|
+
vtkMath.normalize(worldUnitVectorFromCenter);
|
|
416
|
+
const { viewPlaneNormal } = camera;
|
|
417
|
+
const { matrix } = vtkMatrixBuilder
|
|
418
|
+
.buildFromDegree()
|
|
419
|
+
.rotate(90, viewPlaneNormal);
|
|
420
|
+
const worldUnitOrthoVectorFromCenter = [0, 0, 0];
|
|
421
|
+
vec3.transformMat4(worldUnitOrthoVectorFromCenter, worldUnitVectorFromCenter, matrix);
|
|
422
|
+
const slabThicknessValue = otherViewport.getSlabThickness();
|
|
423
|
+
const worldOrthoVectorFromCenter = [
|
|
424
|
+
...worldUnitOrthoVectorFromCenter,
|
|
425
|
+
];
|
|
426
|
+
vtkMath.multiplyScalar(worldOrthoVectorFromCenter, slabThicknessValue);
|
|
427
|
+
const worldVerticalRefPoint = [0, 0, 0];
|
|
428
|
+
vtkMath.add(stHandlesCenterWorld, worldOrthoVectorFromCenter, worldVerticalRefPoint);
|
|
429
|
+
const canvasVerticalRefPoint = viewport.worldToCanvas(worldVerticalRefPoint);
|
|
430
|
+
const canvasOrthoVectorFromCenter = vec2.create();
|
|
431
|
+
vec2.subtract(canvasOrthoVectorFromCenter, stHandlesCenterCanvas, canvasVerticalRefPoint);
|
|
432
|
+
const stLinePointOne = vec2.create();
|
|
433
|
+
vec2.subtract(stLinePointOne, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
434
|
+
vec2.add(stLinePointOne, stLinePointOne, canvasOrthoVectorFromCenter);
|
|
435
|
+
const stLinePointTwo = vec2.create();
|
|
436
|
+
vec2.add(stLinePointTwo, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
437
|
+
vec2.add(stLinePointTwo, stLinePointTwo, canvasOrthoVectorFromCenter);
|
|
438
|
+
liangBarksyClip(stLinePointOne, stLinePointTwo, canvasBox);
|
|
439
|
+
const stLinePointThree = vec2.create();
|
|
440
|
+
vec2.add(stLinePointThree, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
441
|
+
vec2.subtract(stLinePointThree, stLinePointThree, canvasOrthoVectorFromCenter);
|
|
442
|
+
const stLinePointFour = vec2.create();
|
|
443
|
+
vec2.subtract(stLinePointFour, stHandlesCenterCanvas, canvasVectorFromCenterLong);
|
|
444
|
+
vec2.subtract(stLinePointFour, stLinePointFour, canvasOrthoVectorFromCenter);
|
|
445
|
+
liangBarksyClip(stLinePointThree, stLinePointFour, canvasBox);
|
|
446
|
+
const stHandleOne = vec2.create();
|
|
447
|
+
const stHandleTwo = vec2.create();
|
|
448
|
+
const stHandleThree = vec2.create();
|
|
449
|
+
const stHandleFour = vec2.create();
|
|
450
|
+
vec2.subtract(stHandleOne, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
451
|
+
vec2.add(stHandleOne, stHandleOne, canvasOrthoVectorFromCenter);
|
|
452
|
+
vec2.add(stHandleTwo, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
453
|
+
vec2.add(stHandleTwo, stHandleTwo, canvasOrthoVectorFromCenter);
|
|
454
|
+
vec2.subtract(stHandleThree, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
455
|
+
vec2.subtract(stHandleThree, stHandleThree, canvasOrthoVectorFromCenter);
|
|
456
|
+
vec2.add(stHandleFour, stHandlesCenterCanvas, canvasVectorFromCenterShort);
|
|
457
|
+
vec2.subtract(stHandleFour, stHandleFour, canvasOrthoVectorFromCenter);
|
|
458
|
+
referenceLines.push([
|
|
459
|
+
otherViewport,
|
|
460
|
+
refLinePointOne,
|
|
461
|
+
refLinePointTwo,
|
|
462
|
+
refLinePointThree,
|
|
463
|
+
refLinePointFour,
|
|
464
|
+
stLinePointOne,
|
|
465
|
+
stLinePointTwo,
|
|
466
|
+
stLinePointThree,
|
|
467
|
+
stLinePointFour,
|
|
468
|
+
rotHandleOne,
|
|
469
|
+
rotHandleTwo,
|
|
470
|
+
stHandleOne,
|
|
471
|
+
stHandleTwo,
|
|
472
|
+
stHandleThree,
|
|
473
|
+
stHandleFour,
|
|
474
|
+
]);
|
|
475
|
+
});
|
|
476
|
+
const newRtpoints = [];
|
|
477
|
+
const newStpoints = [];
|
|
478
|
+
const viewportColor = this._getReferenceLineColor(viewport.id);
|
|
479
|
+
const color = viewportColor !== undefined ? viewportColor : 'rgb(200, 200, 200)';
|
|
480
|
+
referenceLines.forEach((line, lineIndex) => {
|
|
481
|
+
const otherViewport = line[0];
|
|
482
|
+
const viewportColor = this._getReferenceLineColor(otherViewport.id);
|
|
483
|
+
const viewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
484
|
+
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id) ||
|
|
485
|
+
this.configuration.mobile?.enabled;
|
|
486
|
+
const viewportSlabThicknessControlsOn = this._getReferenceLineSlabThicknessControlsOn(otherViewport.id) ||
|
|
487
|
+
this.configuration.mobile?.enabled;
|
|
488
|
+
const selectedViewportId = data.activeViewportIds.find((id) => id === otherViewport.id);
|
|
489
|
+
let color = viewportColor !== undefined ? viewportColor : 'rgb(200, 200, 200)';
|
|
490
|
+
let lineWidth = 1;
|
|
491
|
+
const lineActive = data.handles.activeOperation !== null &&
|
|
492
|
+
data.handles.activeOperation === OPERATION.DRAG &&
|
|
493
|
+
selectedViewportId;
|
|
494
|
+
if (lineActive) {
|
|
495
|
+
lineWidth = 2.5;
|
|
496
|
+
}
|
|
497
|
+
let lineUID = `${lineIndex}`;
|
|
498
|
+
if (viewportControllable && viewportDraggableRotatable) {
|
|
499
|
+
lineUID = `${lineIndex}One`;
|
|
500
|
+
drawLineSvg(svgDrawingHelper, annotationUID, lineUID, line[1], line[2], {
|
|
501
|
+
color,
|
|
502
|
+
lineWidth,
|
|
503
|
+
});
|
|
504
|
+
lineUID = `${lineIndex}Two`;
|
|
505
|
+
drawLineSvg(svgDrawingHelper, annotationUID, lineUID, line[3], line[4], {
|
|
506
|
+
color,
|
|
507
|
+
lineWidth,
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
drawLineSvg(svgDrawingHelper, annotationUID, lineUID, line[2], line[4], {
|
|
512
|
+
color,
|
|
513
|
+
lineWidth,
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
if (viewportControllable) {
|
|
517
|
+
color =
|
|
518
|
+
viewportColor !== undefined ? viewportColor : 'rgb(200, 200, 200)';
|
|
519
|
+
const rotHandlesActive = data.handles.activeOperation === OPERATION.ROTATE;
|
|
520
|
+
const rotationHandles = [line[9], line[10]];
|
|
521
|
+
const rotHandleWorldOne = [
|
|
522
|
+
viewport.canvasToWorld(line[9]),
|
|
523
|
+
otherViewport,
|
|
524
|
+
line[1],
|
|
525
|
+
line[2],
|
|
526
|
+
];
|
|
527
|
+
const rotHandleWorldTwo = [
|
|
528
|
+
viewport.canvasToWorld(line[10]),
|
|
529
|
+
otherViewport,
|
|
530
|
+
line[3],
|
|
531
|
+
line[4],
|
|
532
|
+
];
|
|
533
|
+
newRtpoints.push(rotHandleWorldOne, rotHandleWorldTwo);
|
|
534
|
+
const slabThicknessHandlesActive = data.handles.activeOperation === OPERATION.SLAB;
|
|
535
|
+
const slabThicknessHandles = [line[11], line[12], line[13], line[14]];
|
|
536
|
+
const slabThicknessHandleWorldOne = [
|
|
537
|
+
viewport.canvasToWorld(line[11]),
|
|
538
|
+
otherViewport,
|
|
539
|
+
line[5],
|
|
540
|
+
line[6],
|
|
541
|
+
];
|
|
542
|
+
const slabThicknessHandleWorldTwo = [
|
|
543
|
+
viewport.canvasToWorld(line[12]),
|
|
544
|
+
otherViewport,
|
|
545
|
+
line[5],
|
|
546
|
+
line[6],
|
|
547
|
+
];
|
|
548
|
+
const slabThicknessHandleWorldThree = [
|
|
549
|
+
viewport.canvasToWorld(line[13]),
|
|
550
|
+
otherViewport,
|
|
551
|
+
line[7],
|
|
552
|
+
line[8],
|
|
553
|
+
];
|
|
554
|
+
const slabThicknessHandleWorldFour = [
|
|
555
|
+
viewport.canvasToWorld(line[14]),
|
|
556
|
+
otherViewport,
|
|
557
|
+
line[7],
|
|
558
|
+
line[8],
|
|
559
|
+
];
|
|
560
|
+
newStpoints.push(slabThicknessHandleWorldOne, slabThicknessHandleWorldTwo, slabThicknessHandleWorldThree, slabThicknessHandleWorldFour);
|
|
561
|
+
let handleRadius = this.configuration.handleRadius *
|
|
562
|
+
(this.configuration.enableHDPIHandles ? window.devicePixelRatio : 1);
|
|
563
|
+
let opacity = 1;
|
|
564
|
+
if (this.configuration.mobile?.enabled) {
|
|
565
|
+
handleRadius = this.configuration.mobile.handleRadius;
|
|
566
|
+
opacity = this.configuration.mobile.opacity;
|
|
567
|
+
}
|
|
568
|
+
if ((lineActive || this.configuration.mobile?.enabled) &&
|
|
569
|
+
!rotHandlesActive &&
|
|
570
|
+
!slabThicknessHandlesActive &&
|
|
571
|
+
viewportDraggableRotatable &&
|
|
572
|
+
viewportSlabThicknessControlsOn) {
|
|
573
|
+
let handleUID = `${lineIndex}One`;
|
|
574
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
575
|
+
color,
|
|
576
|
+
handleRadius,
|
|
577
|
+
opacity,
|
|
578
|
+
type: 'circle',
|
|
579
|
+
});
|
|
580
|
+
handleUID = `${lineIndex}Two`;
|
|
581
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, slabThicknessHandles, {
|
|
582
|
+
color,
|
|
583
|
+
handleRadius,
|
|
584
|
+
opacity,
|
|
585
|
+
type: 'rect',
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
else if (lineActive &&
|
|
589
|
+
!rotHandlesActive &&
|
|
590
|
+
!slabThicknessHandlesActive &&
|
|
591
|
+
viewportDraggableRotatable) {
|
|
592
|
+
const handleUID = `${lineIndex}`;
|
|
593
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
594
|
+
color,
|
|
595
|
+
handleRadius,
|
|
596
|
+
opacity,
|
|
597
|
+
type: 'circle',
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
else if (selectedViewportId &&
|
|
601
|
+
!rotHandlesActive &&
|
|
602
|
+
!slabThicknessHandlesActive &&
|
|
603
|
+
viewportSlabThicknessControlsOn) {
|
|
604
|
+
const handleUID = `${lineIndex}`;
|
|
605
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, slabThicknessHandles, {
|
|
606
|
+
color,
|
|
607
|
+
handleRadius,
|
|
608
|
+
opacity,
|
|
609
|
+
type: 'rect',
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
else if (rotHandlesActive && viewportDraggableRotatable) {
|
|
613
|
+
const handleUID = `${lineIndex}`;
|
|
614
|
+
const handleRadius = this.configuration.handleRadius *
|
|
615
|
+
(this.configuration.enableHDPIHandles
|
|
616
|
+
? window.devicePixelRatio
|
|
617
|
+
: 1);
|
|
618
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, handleUID, rotationHandles, {
|
|
619
|
+
color,
|
|
620
|
+
handleRadius,
|
|
621
|
+
fill: color,
|
|
622
|
+
type: 'circle',
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
else if (slabThicknessHandlesActive &&
|
|
626
|
+
selectedViewportId &&
|
|
627
|
+
viewportSlabThicknessControlsOn) {
|
|
628
|
+
const handleRadius = this.configuration.handleRadius *
|
|
629
|
+
(this.configuration.enableHDPIHandles
|
|
630
|
+
? window.devicePixelRatio
|
|
631
|
+
: 1);
|
|
632
|
+
drawHandlesSvg(svgDrawingHelper, annotationUID, lineUID, slabThicknessHandles, {
|
|
633
|
+
color,
|
|
634
|
+
handleRadius,
|
|
635
|
+
fill: color,
|
|
636
|
+
type: 'rect',
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
const slabThicknessValue = otherViewport.getSlabThickness();
|
|
640
|
+
if (slabThicknessValue > 0.5 && viewportSlabThicknessControlsOn) {
|
|
641
|
+
lineUID = `${lineIndex}STOne`;
|
|
642
|
+
drawLineSvg(svgDrawingHelper, annotationUID, lineUID, line[5], line[6], {
|
|
643
|
+
color,
|
|
644
|
+
width: 1,
|
|
645
|
+
lineDash: [2, 3],
|
|
646
|
+
});
|
|
647
|
+
lineUID = `${lineIndex}STTwo`;
|
|
648
|
+
drawLineSvg(svgDrawingHelper, annotationUID, lineUID, line[7], line[8], {
|
|
649
|
+
color,
|
|
650
|
+
width: line,
|
|
651
|
+
lineDash: [2, 3],
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
renderStatus = true;
|
|
657
|
+
data.handles.rotationPoints = newRtpoints;
|
|
658
|
+
data.handles.slabThicknessPoints = newStpoints;
|
|
659
|
+
if (this.configuration.viewportIndicators) {
|
|
660
|
+
const { viewportIndicatorsConfig } = this.configuration;
|
|
661
|
+
const xOffset = viewportIndicatorsConfig?.xOffset || 0.95;
|
|
662
|
+
const yOffset = viewportIndicatorsConfig?.yOffset || 0.05;
|
|
663
|
+
const referenceColorCoordinates = [
|
|
664
|
+
clientWidth * xOffset,
|
|
665
|
+
clientHeight * yOffset,
|
|
666
|
+
];
|
|
667
|
+
const circleRadius = viewportIndicatorsConfig?.circleRadius || canvasDiagonalLength * 0.01;
|
|
668
|
+
const circleUID = '0';
|
|
669
|
+
drawCircleSvg(svgDrawingHelper, annotationUID, circleUID, referenceColorCoordinates, circleRadius, { color, fill: color });
|
|
670
|
+
}
|
|
671
|
+
return renderStatus;
|
|
672
|
+
};
|
|
673
|
+
this._getAnnotations = (enabledElement) => {
|
|
674
|
+
const { viewport } = enabledElement;
|
|
675
|
+
const annotations = getAnnotations(this.getToolName(), viewport.element) || [];
|
|
676
|
+
const viewportIds = this._getViewportsInfo().map(({ viewportId }) => viewportId);
|
|
677
|
+
const toolGroupAnnotations = annotations.filter((annotation) => {
|
|
678
|
+
const { data } = annotation;
|
|
679
|
+
return viewportIds.includes(data.viewportId);
|
|
680
|
+
});
|
|
681
|
+
return toolGroupAnnotations;
|
|
682
|
+
};
|
|
683
|
+
this._onNewVolume = () => {
|
|
684
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
685
|
+
this._computeToolCenter(viewportsInfo);
|
|
686
|
+
};
|
|
687
|
+
this._areViewportIdArraysEqual = (viewportIdArrayOne, viewportIdArrayTwo) => {
|
|
688
|
+
if (viewportIdArrayOne.length !== viewportIdArrayTwo.length) {
|
|
689
|
+
return false;
|
|
690
|
+
}
|
|
691
|
+
viewportIdArrayOne.forEach((id) => {
|
|
692
|
+
let itemFound = false;
|
|
693
|
+
for (let i = 0; i < viewportIdArrayTwo.length; ++i) {
|
|
694
|
+
if (id === viewportIdArrayTwo[i]) {
|
|
695
|
+
itemFound = true;
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
if (itemFound === false) {
|
|
700
|
+
return false;
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
return true;
|
|
704
|
+
};
|
|
705
|
+
this._getAnnotationsForViewportsWithDifferentCameras = (enabledElement, annotations) => {
|
|
706
|
+
const { viewportId, renderingEngine, viewport } = enabledElement;
|
|
707
|
+
const otherViewportAnnotations = annotations.filter((annotation) => annotation.data.viewportId !== viewportId);
|
|
708
|
+
if (!otherViewportAnnotations || !otherViewportAnnotations.length) {
|
|
709
|
+
return [];
|
|
710
|
+
}
|
|
711
|
+
const camera = viewport.getCamera();
|
|
712
|
+
const { viewPlaneNormal, position } = camera;
|
|
713
|
+
const viewportsWithDifferentCameras = otherViewportAnnotations.filter((annotation) => {
|
|
714
|
+
const { viewportId } = annotation.data;
|
|
715
|
+
const targetViewport = renderingEngine.getViewport(viewportId);
|
|
716
|
+
const cameraOfTarget = targetViewport.getCamera();
|
|
717
|
+
return !(csUtils.isEqual(cameraOfTarget.viewPlaneNormal, viewPlaneNormal, 1e-2) && csUtils.isEqual(cameraOfTarget.position, position, 1));
|
|
718
|
+
});
|
|
719
|
+
return viewportsWithDifferentCameras;
|
|
720
|
+
};
|
|
721
|
+
this._filterViewportWithSameOrientation = (enabledElement, referenceAnnotation, annotations) => {
|
|
722
|
+
const { renderingEngine } = enabledElement;
|
|
723
|
+
const { data } = referenceAnnotation;
|
|
724
|
+
const viewport = renderingEngine.getViewport(data.viewportId);
|
|
725
|
+
const linkedViewportAnnotations = annotations.filter((annotation) => {
|
|
726
|
+
const { data } = annotation;
|
|
727
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
728
|
+
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
729
|
+
return otherViewportControllable === true;
|
|
730
|
+
});
|
|
731
|
+
if (!linkedViewportAnnotations || !linkedViewportAnnotations.length) {
|
|
732
|
+
return [];
|
|
733
|
+
}
|
|
734
|
+
const camera = viewport.getCamera();
|
|
735
|
+
const viewPlaneNormal = camera.viewPlaneNormal;
|
|
736
|
+
vtkMath.normalize(viewPlaneNormal);
|
|
737
|
+
const otherViewportsAnnotationsWithSameCameraDirection = linkedViewportAnnotations.filter((annotation) => {
|
|
738
|
+
const { viewportId } = annotation.data;
|
|
739
|
+
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
740
|
+
const otherCamera = otherViewport.getCamera();
|
|
741
|
+
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
742
|
+
vtkMath.normalize(otherViewPlaneNormal);
|
|
743
|
+
return (csUtils.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) &&
|
|
744
|
+
csUtils.isEqual(camera.viewUp, otherCamera.viewUp, 1e-2));
|
|
745
|
+
});
|
|
746
|
+
return otherViewportsAnnotationsWithSameCameraDirection;
|
|
747
|
+
};
|
|
748
|
+
this._filterAnnotationsByUniqueViewportOrientations = (enabledElement, annotations) => {
|
|
749
|
+
const { renderingEngine, viewport } = enabledElement;
|
|
750
|
+
const camera = viewport.getCamera();
|
|
751
|
+
const viewPlaneNormal = camera.viewPlaneNormal;
|
|
752
|
+
vtkMath.normalize(viewPlaneNormal);
|
|
753
|
+
const otherLinkedViewportAnnotationsFromSameScene = annotations.filter((annotation) => {
|
|
754
|
+
const { data } = annotation;
|
|
755
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
756
|
+
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
757
|
+
return (viewport !== otherViewport &&
|
|
758
|
+
otherViewportControllable === true);
|
|
759
|
+
});
|
|
760
|
+
const otherViewportsAnnotationsWithUniqueCameras = [];
|
|
761
|
+
for (let i = 0; i < otherLinkedViewportAnnotationsFromSameScene.length; ++i) {
|
|
762
|
+
const annotation = otherLinkedViewportAnnotationsFromSameScene[i];
|
|
763
|
+
const { viewportId } = annotation.data;
|
|
764
|
+
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
765
|
+
const otherCamera = otherViewport.getCamera();
|
|
766
|
+
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
767
|
+
vtkMath.normalize(otherViewPlaneNormal);
|
|
768
|
+
if (csUtils.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
769
|
+
csUtils.isOpposite(viewPlaneNormal, otherViewPlaneNormal, 1e-2)) {
|
|
770
|
+
continue;
|
|
771
|
+
}
|
|
772
|
+
let cameraFound = false;
|
|
773
|
+
for (let jj = 0; jj < otherViewportsAnnotationsWithUniqueCameras.length; ++jj) {
|
|
774
|
+
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
775
|
+
const { viewportId } = annotation.data;
|
|
776
|
+
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
777
|
+
const cameraOfStocked = stockedViewport.getCamera();
|
|
778
|
+
if (csUtils.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
779
|
+
csUtils.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
780
|
+
cameraFound = true;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
if (!cameraFound) {
|
|
784
|
+
otherViewportsAnnotationsWithUniqueCameras.push(annotation);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
const otherNonLinkedViewportAnnotationsFromSameScene = annotations.filter((annotation) => {
|
|
788
|
+
const { data } = annotation;
|
|
789
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
790
|
+
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
791
|
+
return (viewport !== otherViewport &&
|
|
792
|
+
otherViewportControllable !== true);
|
|
793
|
+
});
|
|
794
|
+
for (let i = 0; i < otherNonLinkedViewportAnnotationsFromSameScene.length; ++i) {
|
|
795
|
+
const annotation = otherNonLinkedViewportAnnotationsFromSameScene[i];
|
|
796
|
+
const { viewportId } = annotation.data;
|
|
797
|
+
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
798
|
+
const otherCamera = otherViewport.getCamera();
|
|
799
|
+
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
800
|
+
vtkMath.normalize(otherViewPlaneNormal);
|
|
801
|
+
if (csUtils.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
802
|
+
csUtils.isOpposite(viewPlaneNormal, otherViewPlaneNormal, 1e-2)) {
|
|
803
|
+
continue;
|
|
804
|
+
}
|
|
805
|
+
let cameraFound = false;
|
|
806
|
+
for (let jj = 0; jj < otherViewportsAnnotationsWithUniqueCameras.length; ++jj) {
|
|
807
|
+
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
808
|
+
const { viewportId } = annotation.data;
|
|
809
|
+
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
810
|
+
const cameraOfStocked = stockedViewport.getCamera();
|
|
811
|
+
if (csUtils.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
812
|
+
csUtils.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
813
|
+
cameraFound = true;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
if (!cameraFound) {
|
|
817
|
+
otherViewportsAnnotationsWithUniqueCameras.push(annotation);
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
821
|
+
for (let i = 0; i < otherViewportAnnotations.length; ++i) {
|
|
822
|
+
const annotation = otherViewportAnnotations[i];
|
|
823
|
+
if (otherViewportsAnnotationsWithUniqueCameras.some((element) => element === annotation)) {
|
|
824
|
+
continue;
|
|
825
|
+
}
|
|
826
|
+
const { viewportId } = annotation.data;
|
|
827
|
+
const otherViewport = renderingEngine.getViewport(viewportId);
|
|
828
|
+
const otherCamera = otherViewport.getCamera();
|
|
829
|
+
const otherViewPlaneNormal = otherCamera.viewPlaneNormal;
|
|
830
|
+
vtkMath.normalize(otherViewPlaneNormal);
|
|
831
|
+
if (csUtils.isEqual(viewPlaneNormal, otherViewPlaneNormal, 1e-2) ||
|
|
832
|
+
csUtils.isOpposite(viewPlaneNormal, otherViewPlaneNormal, 1e-2)) {
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
let cameraFound = false;
|
|
836
|
+
for (let jj = 0; jj < otherViewportsAnnotationsWithUniqueCameras.length; ++jj) {
|
|
837
|
+
const annotation = otherViewportsAnnotationsWithUniqueCameras[jj];
|
|
838
|
+
const { viewportId } = annotation.data;
|
|
839
|
+
const stockedViewport = renderingEngine.getViewport(viewportId);
|
|
840
|
+
const cameraOfStocked = stockedViewport.getCamera();
|
|
841
|
+
if (csUtils.isEqual(cameraOfStocked.viewPlaneNormal, otherCamera.viewPlaneNormal, 1e-2) &&
|
|
842
|
+
csUtils.isEqual(cameraOfStocked.position, otherCamera.position, 1)) {
|
|
843
|
+
cameraFound = true;
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
if (!cameraFound) {
|
|
847
|
+
otherViewportsAnnotationsWithUniqueCameras.push(annotation);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
return otherViewportsAnnotationsWithUniqueCameras;
|
|
851
|
+
};
|
|
852
|
+
this._checkIfViewportsRenderingSameScene = (viewport, otherViewport) => {
|
|
853
|
+
const volumeIds = viewport.getAllVolumeIds();
|
|
854
|
+
const otherVolumeIds = otherViewport.getAllVolumeIds();
|
|
855
|
+
return (volumeIds.length === otherVolumeIds.length &&
|
|
856
|
+
volumeIds.every((id) => otherVolumeIds.includes(id)));
|
|
857
|
+
};
|
|
858
|
+
this._jump = (enabledElement, jumpWorld) => {
|
|
859
|
+
state.isInteractingWithTool = true;
|
|
860
|
+
const { viewport, renderingEngine } = enabledElement;
|
|
861
|
+
const annotations = this._getAnnotations(enabledElement);
|
|
862
|
+
const delta = [0, 0, 0];
|
|
863
|
+
vtkMath.subtract(jumpWorld, this.toolCenter, delta);
|
|
864
|
+
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
865
|
+
const viewportsAnnotationsToUpdate = otherViewportAnnotations.filter((annotation) => {
|
|
866
|
+
const { data } = annotation;
|
|
867
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
868
|
+
const sameScene = this._checkIfViewportsRenderingSameScene(viewport, otherViewport);
|
|
869
|
+
return (this._getReferenceLineControllable(otherViewport.id) &&
|
|
870
|
+
this._getReferenceLineDraggableRotatable(otherViewport.id) &&
|
|
871
|
+
sameScene);
|
|
872
|
+
});
|
|
873
|
+
if (viewportsAnnotationsToUpdate.length === 0) {
|
|
874
|
+
state.isInteractingWithTool = false;
|
|
875
|
+
return false;
|
|
876
|
+
}
|
|
877
|
+
this._applyDeltaShiftToSelectedViewportCameras(renderingEngine, viewportsAnnotationsToUpdate, delta);
|
|
878
|
+
state.isInteractingWithTool = false;
|
|
879
|
+
return true;
|
|
880
|
+
};
|
|
881
|
+
this._activateModify = (element) => {
|
|
882
|
+
state.isInteractingWithTool = !this.configuration.mobile?.enabled;
|
|
883
|
+
element.addEventListener(Events.MOUSE_UP, this._endCallback);
|
|
884
|
+
element.addEventListener(Events.MOUSE_DRAG, this._dragCallback);
|
|
885
|
+
element.addEventListener(Events.MOUSE_CLICK, this._endCallback);
|
|
886
|
+
element.addEventListener(Events.TOUCH_END, this._endCallback);
|
|
887
|
+
element.addEventListener(Events.TOUCH_DRAG, this._dragCallback);
|
|
888
|
+
element.addEventListener(Events.TOUCH_TAP, this._endCallback);
|
|
889
|
+
};
|
|
890
|
+
this._deactivateModify = (element) => {
|
|
891
|
+
state.isInteractingWithTool = false;
|
|
892
|
+
element.removeEventListener(Events.MOUSE_UP, this._endCallback);
|
|
893
|
+
element.removeEventListener(Events.MOUSE_DRAG, this._dragCallback);
|
|
894
|
+
element.removeEventListener(Events.MOUSE_CLICK, this._endCallback);
|
|
895
|
+
element.removeEventListener(Events.TOUCH_END, this._endCallback);
|
|
896
|
+
element.removeEventListener(Events.TOUCH_DRAG, this._dragCallback);
|
|
897
|
+
element.removeEventListener(Events.TOUCH_TAP, this._endCallback);
|
|
898
|
+
};
|
|
899
|
+
this._endCallback = (evt) => {
|
|
900
|
+
const eventDetail = evt.detail;
|
|
901
|
+
const { element } = eventDetail;
|
|
902
|
+
this.editData.annotation.data.handles.activeOperation = null;
|
|
903
|
+
this.editData.annotation.data.activeViewportIds = [];
|
|
904
|
+
this._deactivateModify(element);
|
|
905
|
+
resetElementCursor(element);
|
|
906
|
+
this.editData = null;
|
|
907
|
+
const requireSameOrientation = false;
|
|
908
|
+
const viewportIdsToRender = getViewportIdsWithToolToRender(element, this.getToolName(), requireSameOrientation);
|
|
909
|
+
triggerAnnotationRenderForViewportIds(viewportIdsToRender);
|
|
910
|
+
};
|
|
911
|
+
this._dragCallback = (evt) => {
|
|
912
|
+
const eventDetail = evt.detail;
|
|
913
|
+
const delta = eventDetail.deltaPoints.world;
|
|
914
|
+
if (Math.abs(delta[0]) < 1e-3 &&
|
|
915
|
+
Math.abs(delta[1]) < 1e-3 &&
|
|
916
|
+
Math.abs(delta[2]) < 1e-3) {
|
|
917
|
+
return;
|
|
918
|
+
}
|
|
919
|
+
const { element } = eventDetail;
|
|
920
|
+
const enabledElement = getEnabledElement(element);
|
|
921
|
+
const { renderingEngine, viewport } = enabledElement;
|
|
922
|
+
const annotations = this._getAnnotations(enabledElement);
|
|
923
|
+
const filteredToolAnnotations = this.filterInteractableAnnotationsForElement(element, annotations);
|
|
924
|
+
const viewportAnnotation = filteredToolAnnotations[0];
|
|
925
|
+
if (!viewportAnnotation) {
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
const { handles } = viewportAnnotation.data;
|
|
929
|
+
const { currentPoints } = evt.detail;
|
|
930
|
+
const canvasCoords = currentPoints.canvas;
|
|
931
|
+
if (handles.activeOperation === OPERATION.DRAG) {
|
|
932
|
+
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
933
|
+
const viewportsAnnotationsToUpdate = otherViewportAnnotations.filter((annotation) => {
|
|
934
|
+
const { data } = annotation;
|
|
935
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
936
|
+
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
937
|
+
const otherViewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
938
|
+
return (otherViewportControllable === true &&
|
|
939
|
+
otherViewportDraggableRotatable === true &&
|
|
940
|
+
viewportAnnotation.data.activeViewportIds.find((id) => id === otherViewport.id));
|
|
941
|
+
});
|
|
942
|
+
this._applyDeltaShiftToSelectedViewportCameras(renderingEngine, viewportsAnnotationsToUpdate, delta);
|
|
943
|
+
}
|
|
944
|
+
else if (handles.activeOperation === OPERATION.ROTATE) {
|
|
945
|
+
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
946
|
+
const viewportsAnnotationsToUpdate = otherViewportAnnotations.filter((annotation) => {
|
|
947
|
+
const { data } = annotation;
|
|
948
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
949
|
+
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
950
|
+
const otherViewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
951
|
+
return (otherViewportControllable === true &&
|
|
952
|
+
otherViewportDraggableRotatable === true);
|
|
953
|
+
});
|
|
954
|
+
const dir1 = vec2.create();
|
|
955
|
+
const dir2 = vec2.create();
|
|
956
|
+
const center = [
|
|
957
|
+
this.toolCenter[0],
|
|
958
|
+
this.toolCenter[1],
|
|
959
|
+
this.toolCenter[2],
|
|
960
|
+
];
|
|
961
|
+
const centerCanvas = viewport.worldToCanvas(center);
|
|
962
|
+
const finalPointCanvas = eventDetail.currentPoints.canvas;
|
|
963
|
+
const originalPointCanvas = vec2.create();
|
|
964
|
+
vec2.sub(originalPointCanvas, finalPointCanvas, eventDetail.deltaPoints.canvas);
|
|
965
|
+
vec2.sub(dir1, originalPointCanvas, centerCanvas);
|
|
966
|
+
vec2.sub(dir2, finalPointCanvas, centerCanvas);
|
|
967
|
+
let angle = vec2.angle(dir1, dir2);
|
|
968
|
+
if (this._isClockWise(centerCanvas, originalPointCanvas, finalPointCanvas)) {
|
|
969
|
+
angle *= -1;
|
|
970
|
+
}
|
|
971
|
+
angle = Math.round(angle * 100) / 100;
|
|
972
|
+
const rotationAxis = viewport.getCamera().viewPlaneNormal;
|
|
973
|
+
const { matrix } = vtkMatrixBuilder
|
|
974
|
+
.buildFromRadian()
|
|
975
|
+
.translate(center[0], center[1], center[2])
|
|
976
|
+
.rotate(angle, rotationAxis)
|
|
977
|
+
.translate(-center[0], -center[1], -center[2]);
|
|
978
|
+
const otherViewportsIds = [];
|
|
979
|
+
viewportsAnnotationsToUpdate.forEach((annotation) => {
|
|
980
|
+
const { data } = annotation;
|
|
981
|
+
data.handles.toolCenter = center;
|
|
982
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
983
|
+
const camera = otherViewport.getCamera();
|
|
984
|
+
const { viewUp, position, focalPoint } = camera;
|
|
985
|
+
viewUp[0] += position[0];
|
|
986
|
+
viewUp[1] += position[1];
|
|
987
|
+
viewUp[2] += position[2];
|
|
988
|
+
vec3.transformMat4(focalPoint, focalPoint, matrix);
|
|
989
|
+
vec3.transformMat4(position, position, matrix);
|
|
990
|
+
vec3.transformMat4(viewUp, viewUp, matrix);
|
|
991
|
+
viewUp[0] -= position[0];
|
|
992
|
+
viewUp[1] -= position[1];
|
|
993
|
+
viewUp[2] -= position[2];
|
|
994
|
+
otherViewport.setCamera({
|
|
995
|
+
position,
|
|
996
|
+
viewUp,
|
|
997
|
+
focalPoint,
|
|
998
|
+
});
|
|
999
|
+
otherViewportsIds.push(otherViewport.id);
|
|
1000
|
+
});
|
|
1001
|
+
renderingEngine.renderViewports(otherViewportsIds);
|
|
1002
|
+
}
|
|
1003
|
+
else if (handles.activeOperation === OPERATION.SLAB) {
|
|
1004
|
+
const otherViewportAnnotations = this._getAnnotationsForViewportsWithDifferentCameras(enabledElement, annotations);
|
|
1005
|
+
const referenceAnnotations = otherViewportAnnotations.filter((annotation) => {
|
|
1006
|
+
const { data } = annotation;
|
|
1007
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
1008
|
+
const otherViewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
1009
|
+
const otherViewportSlabThicknessControlsOn = this._getReferenceLineSlabThicknessControlsOn(otherViewport.id);
|
|
1010
|
+
return (otherViewportControllable === true &&
|
|
1011
|
+
otherViewportSlabThicknessControlsOn === true &&
|
|
1012
|
+
viewportAnnotation.data.activeViewportIds.find((id) => id === otherViewport.id));
|
|
1013
|
+
});
|
|
1014
|
+
if (referenceAnnotations.length === 0) {
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
const viewportsAnnotationsToUpdate = this._filterViewportWithSameOrientation(enabledElement, referenceAnnotations[0], annotations);
|
|
1018
|
+
const viewportsIds = [];
|
|
1019
|
+
viewportsIds.push(viewport.id);
|
|
1020
|
+
viewportsAnnotationsToUpdate.forEach((annotation) => {
|
|
1021
|
+
const { data } = annotation;
|
|
1022
|
+
const otherViewport = renderingEngine.getViewport(data.viewportId);
|
|
1023
|
+
const camera = otherViewport.getCamera();
|
|
1024
|
+
const normal = camera.viewPlaneNormal;
|
|
1025
|
+
const dotProd = vtkMath.dot(delta, normal);
|
|
1026
|
+
const projectedDelta = [...normal];
|
|
1027
|
+
vtkMath.multiplyScalar(projectedDelta, dotProd);
|
|
1028
|
+
if (Math.abs(projectedDelta[0]) > 1e-3 ||
|
|
1029
|
+
Math.abs(projectedDelta[1]) > 1e-3 ||
|
|
1030
|
+
Math.abs(projectedDelta[2]) > 1e-3) {
|
|
1031
|
+
const mod = Math.sqrt(projectedDelta[0] * projectedDelta[0] +
|
|
1032
|
+
projectedDelta[1] * projectedDelta[1] +
|
|
1033
|
+
projectedDelta[2] * projectedDelta[2]);
|
|
1034
|
+
const currentPoint = eventDetail.lastPoints.world;
|
|
1035
|
+
const direction = [0, 0, 0];
|
|
1036
|
+
const currentCenter = [
|
|
1037
|
+
this.toolCenter[0],
|
|
1038
|
+
this.toolCenter[1],
|
|
1039
|
+
this.toolCenter[2],
|
|
1040
|
+
];
|
|
1041
|
+
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
1042
|
+
if (!viewportDraggableRotatable) {
|
|
1043
|
+
const { rotationPoints } = this.editData.annotation.data.handles;
|
|
1044
|
+
const otherViewportRotationPoints = rotationPoints.filter((point) => point[1].uid === otherViewport.id);
|
|
1045
|
+
if (otherViewportRotationPoints.length === 2) {
|
|
1046
|
+
const point1 = viewport.canvasToWorld(otherViewportRotationPoints[0][3]);
|
|
1047
|
+
const point2 = viewport.canvasToWorld(otherViewportRotationPoints[1][3]);
|
|
1048
|
+
vtkMath.add(point1, point2, currentCenter);
|
|
1049
|
+
vtkMath.multiplyScalar(currentCenter, 0.5);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
vtkMath.subtract(currentPoint, currentCenter, direction);
|
|
1053
|
+
const dotProdDirection = vtkMath.dot(direction, normal);
|
|
1054
|
+
const projectedDirection = [...normal];
|
|
1055
|
+
vtkMath.multiplyScalar(projectedDirection, dotProdDirection);
|
|
1056
|
+
const normalizedProjectedDirection = [
|
|
1057
|
+
projectedDirection[0],
|
|
1058
|
+
projectedDirection[1],
|
|
1059
|
+
projectedDirection[2],
|
|
1060
|
+
];
|
|
1061
|
+
vec3.normalize(normalizedProjectedDirection, normalizedProjectedDirection);
|
|
1062
|
+
const normalizedProjectedDelta = [
|
|
1063
|
+
projectedDelta[0],
|
|
1064
|
+
projectedDelta[1],
|
|
1065
|
+
projectedDelta[2],
|
|
1066
|
+
];
|
|
1067
|
+
vec3.normalize(normalizedProjectedDelta, normalizedProjectedDelta);
|
|
1068
|
+
let slabThicknessValue = otherViewport.getSlabThickness();
|
|
1069
|
+
if (csUtils.isOpposite(normalizedProjectedDirection, normalizedProjectedDelta, 1e-3)) {
|
|
1070
|
+
slabThicknessValue -= mod;
|
|
1071
|
+
}
|
|
1072
|
+
else {
|
|
1073
|
+
slabThicknessValue += mod;
|
|
1074
|
+
}
|
|
1075
|
+
slabThicknessValue = Math.abs(slabThicknessValue);
|
|
1076
|
+
slabThicknessValue = Math.max(RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS, slabThicknessValue);
|
|
1077
|
+
const near = this._pointNearReferenceLine(viewportAnnotation, canvasCoords, 6, otherViewport);
|
|
1078
|
+
if (near) {
|
|
1079
|
+
slabThicknessValue = RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS;
|
|
1080
|
+
}
|
|
1081
|
+
const toolGroup = getToolGroupForViewport(otherViewport.id, renderingEngine.id);
|
|
1082
|
+
const crosshairsInstance = toolGroup.getToolInstance(this.getToolName());
|
|
1083
|
+
crosshairsInstance.setSlabThickness(otherViewport, slabThicknessValue);
|
|
1084
|
+
viewportsIds.push(otherViewport.id);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1087
|
+
renderingEngine.renderViewports(viewportsIds);
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
this._pointNearReferenceLine = (annotation, canvasCoords, proximity, lineViewport) => {
|
|
1091
|
+
const { data } = annotation;
|
|
1092
|
+
const { rotationPoints } = data.handles;
|
|
1093
|
+
for (let i = 0; i < rotationPoints.length - 1; ++i) {
|
|
1094
|
+
const otherViewport = rotationPoints[i][1];
|
|
1095
|
+
if (otherViewport.id !== lineViewport.id) {
|
|
1096
|
+
continue;
|
|
1097
|
+
}
|
|
1098
|
+
const viewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
1099
|
+
if (!viewportControllable) {
|
|
1100
|
+
continue;
|
|
1101
|
+
}
|
|
1102
|
+
const lineSegment1 = {
|
|
1103
|
+
start: {
|
|
1104
|
+
x: rotationPoints[i][2][0],
|
|
1105
|
+
y: rotationPoints[i][2][1],
|
|
1106
|
+
},
|
|
1107
|
+
end: {
|
|
1108
|
+
x: rotationPoints[i][3][0],
|
|
1109
|
+
y: rotationPoints[i][3][1],
|
|
1110
|
+
},
|
|
1111
|
+
};
|
|
1112
|
+
const distanceToPoint1 = lineSegment.distanceToPoint([lineSegment1.start.x, lineSegment1.start.y], [lineSegment1.end.x, lineSegment1.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
1113
|
+
const lineSegment2 = {
|
|
1114
|
+
start: {
|
|
1115
|
+
x: rotationPoints[i + 1][2][0],
|
|
1116
|
+
y: rotationPoints[i + 1][2][1],
|
|
1117
|
+
},
|
|
1118
|
+
end: {
|
|
1119
|
+
x: rotationPoints[i + 1][3][0],
|
|
1120
|
+
y: rotationPoints[i + 1][3][1],
|
|
1121
|
+
},
|
|
1122
|
+
};
|
|
1123
|
+
const distanceToPoint2 = lineSegment.distanceToPoint([lineSegment2.start.x, lineSegment2.start.y], [lineSegment2.end.x, lineSegment2.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
1124
|
+
if (distanceToPoint1 <= proximity || distanceToPoint2 <= proximity) {
|
|
1125
|
+
return true;
|
|
1126
|
+
}
|
|
1127
|
+
i++;
|
|
1128
|
+
}
|
|
1129
|
+
return false;
|
|
1130
|
+
};
|
|
1131
|
+
this._getReferenceLineColor =
|
|
1132
|
+
toolProps.configuration?.getReferenceLineColor ||
|
|
1133
|
+
defaultReferenceLineColor;
|
|
1134
|
+
this._getReferenceLineControllable =
|
|
1135
|
+
toolProps.configuration?.getReferenceLineControllable ||
|
|
1136
|
+
defaultReferenceLineControllable;
|
|
1137
|
+
this._getReferenceLineDraggableRotatable =
|
|
1138
|
+
toolProps.configuration?.getReferenceLineDraggableRotatable ||
|
|
1139
|
+
defaultReferenceLineDraggableRotatable;
|
|
1140
|
+
this._getReferenceLineSlabThicknessControlsOn =
|
|
1141
|
+
toolProps.configuration?.getReferenceLineSlabThicknessControlsOn ||
|
|
1142
|
+
defaultReferenceLineSlabThicknessControlsOn;
|
|
1143
|
+
}
|
|
1144
|
+
onSetToolActive() {
|
|
1145
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
1146
|
+
this._unsubscribeToViewportNewVolumeSet(viewportsInfo);
|
|
1147
|
+
this._subscribeToViewportNewVolumeSet(viewportsInfo);
|
|
1148
|
+
this._computeToolCenter(viewportsInfo);
|
|
1149
|
+
}
|
|
1150
|
+
onSetToolPassive() {
|
|
1151
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
1152
|
+
this._computeToolCenter(viewportsInfo);
|
|
1153
|
+
}
|
|
1154
|
+
onSetToolEnabled() {
|
|
1155
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
1156
|
+
this._computeToolCenter(viewportsInfo);
|
|
1157
|
+
}
|
|
1158
|
+
onSetToolDisabled() {
|
|
1159
|
+
const viewportsInfo = this._getViewportsInfo();
|
|
1160
|
+
this._unsubscribeToViewportNewVolumeSet(viewportsInfo);
|
|
1161
|
+
viewportsInfo.forEach(({ renderingEngineId, viewportId }) => {
|
|
1162
|
+
const enabledElement = getEnabledElementByIds(viewportId, renderingEngineId);
|
|
1163
|
+
if (!enabledElement) {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
const annotations = this._getAnnotations(enabledElement);
|
|
1167
|
+
if (annotations?.length) {
|
|
1168
|
+
annotations.forEach((annotation) => {
|
|
1169
|
+
removeAnnotation(annotation.annotationUID);
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
getHandleNearImagePoint(element, annotation, canvasCoords, proximity) {
|
|
1175
|
+
const enabledElement = getEnabledElement(element);
|
|
1176
|
+
const { viewport } = enabledElement;
|
|
1177
|
+
let point = this._getRotationHandleNearImagePoint(viewport, annotation, canvasCoords, proximity);
|
|
1178
|
+
if (point !== null) {
|
|
1179
|
+
return point;
|
|
1180
|
+
}
|
|
1181
|
+
point = this._getSlabThicknessHandleNearImagePoint(viewport, annotation, canvasCoords, proximity);
|
|
1182
|
+
if (point !== null) {
|
|
1183
|
+
return point;
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
_unsubscribeToViewportNewVolumeSet(viewportsInfo) {
|
|
1187
|
+
viewportsInfo.forEach(({ viewportId, renderingEngineId }) => {
|
|
1188
|
+
const { viewport } = getEnabledElementByIds(viewportId, renderingEngineId);
|
|
1189
|
+
const { element } = viewport;
|
|
1190
|
+
element.removeEventListener(Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, this._onNewVolume);
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
_subscribeToViewportNewVolumeSet(viewports) {
|
|
1194
|
+
viewports.forEach(({ viewportId, renderingEngineId }) => {
|
|
1195
|
+
const { viewport } = getEnabledElementByIds(viewportId, renderingEngineId);
|
|
1196
|
+
const { element } = viewport;
|
|
1197
|
+
element.addEventListener(Enums.Events.VOLUME_VIEWPORT_NEW_VOLUME, this._onNewVolume);
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
_autoPanViewportIfNecessary(viewportId, renderingEngine) {
|
|
1201
|
+
const viewport = renderingEngine.getViewport(viewportId);
|
|
1202
|
+
const { clientWidth, clientHeight } = viewport.canvas;
|
|
1203
|
+
const toolCenterCanvas = viewport.worldToCanvas(this.toolCenter);
|
|
1204
|
+
const pan = this.configuration.autoPan.panSize;
|
|
1205
|
+
const visiblePointCanvas = [
|
|
1206
|
+
toolCenterCanvas[0],
|
|
1207
|
+
toolCenterCanvas[1],
|
|
1208
|
+
];
|
|
1209
|
+
if (toolCenterCanvas[0] < 0) {
|
|
1210
|
+
visiblePointCanvas[0] = pan;
|
|
1211
|
+
}
|
|
1212
|
+
else if (toolCenterCanvas[0] > clientWidth) {
|
|
1213
|
+
visiblePointCanvas[0] = clientWidth - pan;
|
|
1214
|
+
}
|
|
1215
|
+
if (toolCenterCanvas[1] < 0) {
|
|
1216
|
+
visiblePointCanvas[1] = pan;
|
|
1217
|
+
}
|
|
1218
|
+
else if (toolCenterCanvas[1] > clientHeight) {
|
|
1219
|
+
visiblePointCanvas[1] = clientHeight - pan;
|
|
1220
|
+
}
|
|
1221
|
+
if (visiblePointCanvas[0] === toolCenterCanvas[0] &&
|
|
1222
|
+
visiblePointCanvas[1] === toolCenterCanvas[1]) {
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
const visiblePointWorld = viewport.canvasToWorld(visiblePointCanvas);
|
|
1226
|
+
const deltaPointsWorld = [
|
|
1227
|
+
visiblePointWorld[0] - this.toolCenter[0],
|
|
1228
|
+
visiblePointWorld[1] - this.toolCenter[1],
|
|
1229
|
+
visiblePointWorld[2] - this.toolCenter[2],
|
|
1230
|
+
];
|
|
1231
|
+
const camera = viewport.getCamera();
|
|
1232
|
+
const { focalPoint, position } = camera;
|
|
1233
|
+
const updatedPosition = [
|
|
1234
|
+
position[0] - deltaPointsWorld[0],
|
|
1235
|
+
position[1] - deltaPointsWorld[1],
|
|
1236
|
+
position[2] - deltaPointsWorld[2],
|
|
1237
|
+
];
|
|
1238
|
+
const updatedFocalPoint = [
|
|
1239
|
+
focalPoint[0] - deltaPointsWorld[0],
|
|
1240
|
+
focalPoint[1] - deltaPointsWorld[1],
|
|
1241
|
+
focalPoint[2] - deltaPointsWorld[2],
|
|
1242
|
+
];
|
|
1243
|
+
viewport.setCamera({
|
|
1244
|
+
focalPoint: updatedFocalPoint,
|
|
1245
|
+
position: updatedPosition,
|
|
1246
|
+
});
|
|
1247
|
+
viewport.render();
|
|
1248
|
+
}
|
|
1249
|
+
setSlabThickness(viewport, slabThickness) {
|
|
1250
|
+
let actorUIDs;
|
|
1251
|
+
const { filterActorUIDsToSetSlabThickness } = this.configuration;
|
|
1252
|
+
if (filterActorUIDsToSetSlabThickness &&
|
|
1253
|
+
filterActorUIDsToSetSlabThickness.length > 0) {
|
|
1254
|
+
actorUIDs = filterActorUIDsToSetSlabThickness;
|
|
1255
|
+
}
|
|
1256
|
+
let blendModeToUse = this.configuration.slabThicknessBlendMode;
|
|
1257
|
+
if (slabThickness === RENDERING_DEFAULTS.MINIMUM_SLAB_THICKNESS) {
|
|
1258
|
+
blendModeToUse = Enums.BlendModes.COMPOSITE;
|
|
1259
|
+
}
|
|
1260
|
+
const immediate = false;
|
|
1261
|
+
viewport.setBlendMode(blendModeToUse, actorUIDs, immediate);
|
|
1262
|
+
viewport.setSlabThickness(slabThickness, actorUIDs);
|
|
1263
|
+
}
|
|
1264
|
+
_isClockWise(a, b, c) {
|
|
1265
|
+
return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]) > 0;
|
|
1266
|
+
}
|
|
1267
|
+
_applyDeltaShiftToSelectedViewportCameras(renderingEngine, viewportsAnnotationsToUpdate, delta) {
|
|
1268
|
+
viewportsAnnotationsToUpdate.forEach((annotation) => {
|
|
1269
|
+
this._applyDeltaShiftToViewportCamera(renderingEngine, annotation, delta);
|
|
1270
|
+
});
|
|
1271
|
+
}
|
|
1272
|
+
_applyDeltaShiftToViewportCamera(renderingEngine, annotation, delta) {
|
|
1273
|
+
const { data } = annotation;
|
|
1274
|
+
const viewport = renderingEngine.getViewport(data.viewportId);
|
|
1275
|
+
const camera = viewport.getCamera();
|
|
1276
|
+
const normal = camera.viewPlaneNormal;
|
|
1277
|
+
const dotProd = vtkMath.dot(delta, normal);
|
|
1278
|
+
const projectedDelta = [...normal];
|
|
1279
|
+
vtkMath.multiplyScalar(projectedDelta, dotProd);
|
|
1280
|
+
if (Math.abs(projectedDelta[0]) > 1e-3 ||
|
|
1281
|
+
Math.abs(projectedDelta[1]) > 1e-3 ||
|
|
1282
|
+
Math.abs(projectedDelta[2]) > 1e-3) {
|
|
1283
|
+
const newFocalPoint = [0, 0, 0];
|
|
1284
|
+
const newPosition = [0, 0, 0];
|
|
1285
|
+
vtkMath.add(camera.focalPoint, projectedDelta, newFocalPoint);
|
|
1286
|
+
vtkMath.add(camera.position, projectedDelta, newPosition);
|
|
1287
|
+
viewport.setCamera({
|
|
1288
|
+
focalPoint: newFocalPoint,
|
|
1289
|
+
position: newPosition,
|
|
1290
|
+
});
|
|
1291
|
+
viewport.render();
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
_getRotationHandleNearImagePoint(viewport, annotation, canvasCoords, proximity) {
|
|
1295
|
+
const { data } = annotation;
|
|
1296
|
+
const { rotationPoints } = data.handles;
|
|
1297
|
+
for (let i = 0; i < rotationPoints.length; i++) {
|
|
1298
|
+
const point = rotationPoints[i][0];
|
|
1299
|
+
const otherViewport = rotationPoints[i][1];
|
|
1300
|
+
const viewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
1301
|
+
if (!viewportControllable) {
|
|
1302
|
+
continue;
|
|
1303
|
+
}
|
|
1304
|
+
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
1305
|
+
if (!viewportDraggableRotatable) {
|
|
1306
|
+
continue;
|
|
1307
|
+
}
|
|
1308
|
+
const annotationCanvasCoordinate = viewport.worldToCanvas(point);
|
|
1309
|
+
if (vec2.distance(canvasCoords, annotationCanvasCoordinate) < proximity) {
|
|
1310
|
+
data.handles.activeOperation = OPERATION.ROTATE;
|
|
1311
|
+
this.editData = {
|
|
1312
|
+
annotation,
|
|
1313
|
+
};
|
|
1314
|
+
return point;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
return null;
|
|
1318
|
+
}
|
|
1319
|
+
_getSlabThicknessHandleNearImagePoint(viewport, annotation, canvasCoords, proximity) {
|
|
1320
|
+
const { data } = annotation;
|
|
1321
|
+
const { slabThicknessPoints } = data.handles;
|
|
1322
|
+
for (let i = 0; i < slabThicknessPoints.length; i++) {
|
|
1323
|
+
const point = slabThicknessPoints[i][0];
|
|
1324
|
+
const otherViewport = slabThicknessPoints[i][1];
|
|
1325
|
+
const viewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
1326
|
+
if (!viewportControllable) {
|
|
1327
|
+
continue;
|
|
1328
|
+
}
|
|
1329
|
+
const viewportSlabThicknessControlsOn = this._getReferenceLineSlabThicknessControlsOn(otherViewport.id);
|
|
1330
|
+
if (!viewportSlabThicknessControlsOn) {
|
|
1331
|
+
continue;
|
|
1332
|
+
}
|
|
1333
|
+
const annotationCanvasCoordinate = viewport.worldToCanvas(point);
|
|
1334
|
+
if (vec2.distance(canvasCoords, annotationCanvasCoordinate) < proximity) {
|
|
1335
|
+
data.handles.activeOperation = OPERATION.SLAB;
|
|
1336
|
+
data.activeViewportIds = [otherViewport.id];
|
|
1337
|
+
this.editData = {
|
|
1338
|
+
annotation,
|
|
1339
|
+
};
|
|
1340
|
+
return point;
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
return null;
|
|
1344
|
+
}
|
|
1345
|
+
_pointNearTool(element, annotation, canvasCoords, proximity) {
|
|
1346
|
+
const enabledElement = getEnabledElement(element);
|
|
1347
|
+
const { viewport } = enabledElement;
|
|
1348
|
+
const { clientWidth, clientHeight } = viewport.canvas;
|
|
1349
|
+
const canvasDiagonalLength = Math.sqrt(clientWidth * clientWidth + clientHeight * clientHeight);
|
|
1350
|
+
const { data } = annotation;
|
|
1351
|
+
const { rotationPoints } = data.handles;
|
|
1352
|
+
const { slabThicknessPoints } = data.handles;
|
|
1353
|
+
const viewportIdArray = [];
|
|
1354
|
+
for (let i = 0; i < rotationPoints.length - 1; ++i) {
|
|
1355
|
+
const otherViewport = rotationPoints[i][1];
|
|
1356
|
+
const viewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
1357
|
+
const viewportDraggableRotatable = this._getReferenceLineDraggableRotatable(otherViewport.id);
|
|
1358
|
+
if (!viewportControllable || !viewportDraggableRotatable) {
|
|
1359
|
+
continue;
|
|
1360
|
+
}
|
|
1361
|
+
const lineSegment1 = {
|
|
1362
|
+
start: {
|
|
1363
|
+
x: rotationPoints[i][2][0],
|
|
1364
|
+
y: rotationPoints[i][2][1],
|
|
1365
|
+
},
|
|
1366
|
+
end: {
|
|
1367
|
+
x: rotationPoints[i][3][0],
|
|
1368
|
+
y: rotationPoints[i][3][1],
|
|
1369
|
+
},
|
|
1370
|
+
};
|
|
1371
|
+
const distanceToPoint1 = lineSegment.distanceToPoint([lineSegment1.start.x, lineSegment1.start.y], [lineSegment1.end.x, lineSegment1.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
1372
|
+
const lineSegment2 = {
|
|
1373
|
+
start: {
|
|
1374
|
+
x: rotationPoints[i + 1][2][0],
|
|
1375
|
+
y: rotationPoints[i + 1][2][1],
|
|
1376
|
+
},
|
|
1377
|
+
end: {
|
|
1378
|
+
x: rotationPoints[i + 1][3][0],
|
|
1379
|
+
y: rotationPoints[i + 1][3][1],
|
|
1380
|
+
},
|
|
1381
|
+
};
|
|
1382
|
+
const distanceToPoint2 = lineSegment.distanceToPoint([lineSegment2.start.x, lineSegment2.start.y], [lineSegment2.end.x, lineSegment2.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
1383
|
+
if (distanceToPoint1 <= proximity || distanceToPoint2 <= proximity) {
|
|
1384
|
+
viewportIdArray.push(otherViewport.id);
|
|
1385
|
+
data.handles.activeOperation = OPERATION.DRAG;
|
|
1386
|
+
}
|
|
1387
|
+
i++;
|
|
1388
|
+
}
|
|
1389
|
+
for (let i = 0; i < slabThicknessPoints.length - 1; ++i) {
|
|
1390
|
+
const otherViewport = slabThicknessPoints[i][1];
|
|
1391
|
+
if (viewportIdArray.find((id) => id === otherViewport.id)) {
|
|
1392
|
+
continue;
|
|
1393
|
+
}
|
|
1394
|
+
const viewportControllable = this._getReferenceLineControllable(otherViewport.id);
|
|
1395
|
+
const viewportSlabThicknessControlsOn = this._getReferenceLineSlabThicknessControlsOn(otherViewport.id);
|
|
1396
|
+
if (!viewportControllable || !viewportSlabThicknessControlsOn) {
|
|
1397
|
+
continue;
|
|
1398
|
+
}
|
|
1399
|
+
const stPointLineCanvas1 = slabThicknessPoints[i][2];
|
|
1400
|
+
const stPointLineCanvas2 = slabThicknessPoints[i][3];
|
|
1401
|
+
const centerCanvas = vec2.create();
|
|
1402
|
+
vec2.add(centerCanvas, stPointLineCanvas1, stPointLineCanvas2);
|
|
1403
|
+
vec2.scale(centerCanvas, centerCanvas, 0.5);
|
|
1404
|
+
const canvasUnitVectorFromCenter = vec2.create();
|
|
1405
|
+
vec2.subtract(canvasUnitVectorFromCenter, stPointLineCanvas1, centerCanvas);
|
|
1406
|
+
vec2.normalize(canvasUnitVectorFromCenter, canvasUnitVectorFromCenter);
|
|
1407
|
+
const canvasVectorFromCenterStart = vec2.create();
|
|
1408
|
+
vec2.scale(canvasVectorFromCenterStart, canvasUnitVectorFromCenter, canvasDiagonalLength * 0.05);
|
|
1409
|
+
const stPointLineCanvas1Start = vec2.create();
|
|
1410
|
+
const stPointLineCanvas2Start = vec2.create();
|
|
1411
|
+
vec2.add(stPointLineCanvas1Start, centerCanvas, canvasVectorFromCenterStart);
|
|
1412
|
+
vec2.subtract(stPointLineCanvas2Start, centerCanvas, canvasVectorFromCenterStart);
|
|
1413
|
+
const lineSegment1 = {
|
|
1414
|
+
start: {
|
|
1415
|
+
x: stPointLineCanvas1Start[0],
|
|
1416
|
+
y: stPointLineCanvas1Start[1],
|
|
1417
|
+
},
|
|
1418
|
+
end: {
|
|
1419
|
+
x: stPointLineCanvas1[0],
|
|
1420
|
+
y: stPointLineCanvas1[1],
|
|
1421
|
+
},
|
|
1422
|
+
};
|
|
1423
|
+
const distanceToPoint1 = lineSegment.distanceToPoint([lineSegment1.start.x, lineSegment1.start.y], [lineSegment1.end.x, lineSegment1.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
1424
|
+
const lineSegment2 = {
|
|
1425
|
+
start: {
|
|
1426
|
+
x: stPointLineCanvas2Start[0],
|
|
1427
|
+
y: stPointLineCanvas2Start[1],
|
|
1428
|
+
},
|
|
1429
|
+
end: {
|
|
1430
|
+
x: stPointLineCanvas2[0],
|
|
1431
|
+
y: stPointLineCanvas2[1],
|
|
1432
|
+
},
|
|
1433
|
+
};
|
|
1434
|
+
const distanceToPoint2 = lineSegment.distanceToPoint([lineSegment2.start.x, lineSegment2.start.y], [lineSegment2.end.x, lineSegment2.end.y], [canvasCoords[0], canvasCoords[1]]);
|
|
1435
|
+
if (distanceToPoint1 <= proximity || distanceToPoint2 <= proximity) {
|
|
1436
|
+
viewportIdArray.push(otherViewport.id);
|
|
1437
|
+
data.handles.activeOperation = null;
|
|
1438
|
+
}
|
|
1439
|
+
i++;
|
|
1440
|
+
}
|
|
1441
|
+
data.activeViewportIds = [...viewportIdArray];
|
|
1442
|
+
this.editData = {
|
|
1443
|
+
annotation,
|
|
1444
|
+
};
|
|
1445
|
+
return data.handles.activeOperation === OPERATION.DRAG ? true : false;
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
CrosshairsTool.toolName = 'Crosshairs';
|
|
1449
|
+
export default CrosshairsTool;
|