@cornerstonejs/tools 0.56.1 → 0.56.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/dist/cjs/tools/CrosshairsTool.d.ts +1 -0
- package/dist/cjs/tools/CrosshairsTool.js +4 -1
- package/dist/cjs/tools/CrosshairsTool.js.map +1 -1
- package/dist/esm/tools/CrosshairsTool.d.ts +1 -0
- package/dist/esm/tools/CrosshairsTool.js +4 -1
- package/dist/esm/tools/CrosshairsTool.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +5 -4
- package/src/constants/COLOR_LUT.ts +262 -0
- package/src/constants/index.ts +3 -0
- package/src/cursors/ImageMouseCursor.ts +39 -0
- package/src/cursors/MouseCursor.ts +114 -0
- package/src/cursors/SVGCursorDescriptor.ts +462 -0
- package/src/cursors/SVGMouseCursor.ts +145 -0
- package/src/cursors/elementCursor.ts +69 -0
- package/src/cursors/index.ts +24 -0
- package/src/cursors/setCursorForElement.ts +33 -0
- package/src/drawingSvg/_getHash.ts +9 -0
- package/src/drawingSvg/_setAttributesIfNecessary.ts +13 -0
- package/src/drawingSvg/_setNewAttributesIfValid.ts +10 -0
- package/src/drawingSvg/clearByToolType.ts +26 -0
- package/src/drawingSvg/draw.ts +16 -0
- package/src/drawingSvg/drawArrow.ts +82 -0
- package/src/drawingSvg/drawCircle.ts +62 -0
- package/src/drawingSvg/drawEllipse.ts +71 -0
- package/src/drawingSvg/drawHandles.ts +87 -0
- package/src/drawingSvg/drawLine.ts +70 -0
- package/src/drawingSvg/drawLink.ts +76 -0
- package/src/drawingSvg/drawLinkedTextBox.ts +64 -0
- package/src/drawingSvg/drawPolyline.ts +80 -0
- package/src/drawingSvg/drawRect.ts +70 -0
- package/src/drawingSvg/drawTextBox.ts +213 -0
- package/src/drawingSvg/getSvgDrawingHelper.ts +98 -0
- package/src/drawingSvg/index.ts +23 -0
- package/src/enums/AnnotationStyleStates.ts +22 -0
- package/src/enums/Events.ts +242 -0
- package/src/enums/SegmentationRepresentations.ts +12 -0
- package/src/enums/ToolBindings.ts +37 -0
- package/src/enums/ToolModes.ts +31 -0
- package/src/enums/Touch.ts +8 -0
- package/src/enums/index.js +16 -0
- package/src/eventDispatchers/annotationModifiedEventDispatcher.ts +41 -0
- package/src/eventDispatchers/cameraModifiedEventDispatcher.ts +41 -0
- package/src/eventDispatchers/imageRenderedEventDispatcher.ts +37 -0
- package/src/eventDispatchers/imageSpacingCalibratedEventDispatcher.ts +50 -0
- package/src/eventDispatchers/index.js +15 -0
- package/src/eventDispatchers/keyboardEventHandlers/index.js +4 -0
- package/src/eventDispatchers/keyboardEventHandlers/keyDown.ts +29 -0
- package/src/eventDispatchers/keyboardEventHandlers/keyUp.ts +33 -0
- package/src/eventDispatchers/keyboardToolEventDispatcher.ts +28 -0
- package/src/eventDispatchers/mouseEventHandlers/index.js +19 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseClick.ts +13 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseDoubleClick.ts +13 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseDown.ts +196 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseDownActivate.ts +35 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseDrag.ts +25 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseMove.ts +70 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseUp.ts +9 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseWheel.ts +13 -0
- package/src/eventDispatchers/mouseToolEventDispatcher.ts +64 -0
- package/src/eventDispatchers/shared/customCallbackHandler.ts +73 -0
- package/src/eventDispatchers/shared/getActiveToolForKeyboardEvent.ts +58 -0
- package/src/eventDispatchers/shared/getActiveToolForMouseEvent.ts +61 -0
- package/src/eventDispatchers/shared/getActiveToolForTouchEvent.ts +64 -0
- package/src/eventDispatchers/shared/getMouseModifier.ts +30 -0
- package/src/eventDispatchers/shared/getToolsWithModesForMouseEvent.ts +56 -0
- package/src/eventDispatchers/shared/getToolsWithModesForTouchEvent.ts +54 -0
- package/src/eventDispatchers/touchEventHandlers/index.js +15 -0
- package/src/eventDispatchers/touchEventHandlers/touchDrag.ts +23 -0
- package/src/eventDispatchers/touchEventHandlers/touchEnd.ts +9 -0
- package/src/eventDispatchers/touchEventHandlers/touchPress.ts +13 -0
- package/src/eventDispatchers/touchEventHandlers/touchStart.ts +174 -0
- package/src/eventDispatchers/touchEventHandlers/touchStartActivate.ts +36 -0
- package/src/eventDispatchers/touchEventHandlers/touchTap.ts +9 -0
- package/src/eventDispatchers/touchToolEventDispatcher.ts +51 -0
- package/src/eventListeners/annotations/annotationModifiedListener.ts +22 -0
- package/src/eventListeners/annotations/annotationSelectionListener.ts +29 -0
- package/src/eventListeners/annotations/index.ts +4 -0
- package/src/eventListeners/index.ts +28 -0
- package/src/eventListeners/keyboard/index.ts +16 -0
- package/src/eventListeners/keyboard/keyDownListener.ts +99 -0
- package/src/eventListeners/mouse/getMouseEventPoints.ts +66 -0
- package/src/eventListeners/mouse/index.ts +55 -0
- package/src/eventListeners/mouse/mouseDoubleClickListener.ts +55 -0
- package/src/eventListeners/mouse/mouseDownListener.ts +519 -0
- package/src/eventListeners/mouse/mouseMoveListener.ts +33 -0
- package/src/eventListeners/segmentation/index.ts +11 -0
- package/src/eventListeners/segmentation/segmentationDataModifiedEventListener.ts +61 -0
- package/src/eventListeners/segmentation/segmentationModifiedEventListener.ts +32 -0
- package/src/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.ts +15 -0
- package/src/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.ts +16 -0
- package/src/eventListeners/touch/getTouchEventPoints.ts +75 -0
- package/src/eventListeners/touch/index.ts +37 -0
- package/src/eventListeners/touch/preventGhostClick.js +72 -0
- package/src/eventListeners/touch/touchStartListener.ts +499 -0
- package/src/eventListeners/wheel/index.ts +27 -0
- package/src/eventListeners/wheel/normalizeWheel.ts +69 -0
- package/src/eventListeners/wheel/wheelListener.ts +51 -0
- package/src/index.ts +133 -0
- package/src/init.ts +187 -0
- package/src/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.ts +399 -0
- package/src/stateManagement/annotation/annotationLocking.ts +178 -0
- package/src/stateManagement/annotation/annotationSelection.ts +163 -0
- package/src/stateManagement/annotation/annotationState.ts +180 -0
- package/src/stateManagement/annotation/annotationVisibility.ts +156 -0
- package/src/stateManagement/annotation/config/ToolStyle.ts +265 -0
- package/src/stateManagement/annotation/config/getFont.ts +36 -0
- package/src/stateManagement/annotation/config/getState.ts +26 -0
- package/src/stateManagement/annotation/config/helpers.ts +55 -0
- package/src/stateManagement/annotation/config/index.ts +5 -0
- package/src/stateManagement/annotation/helpers/state.ts +83 -0
- package/src/stateManagement/annotation/index.ts +15 -0
- package/src/stateManagement/index.js +40 -0
- package/src/stateManagement/segmentation/SegmentationStateManager.ts +491 -0
- package/src/stateManagement/segmentation/activeSegmentation.ts +60 -0
- package/src/stateManagement/segmentation/addSegmentationRepresentations.ts +77 -0
- package/src/stateManagement/segmentation/addSegmentations.ts +27 -0
- package/src/stateManagement/segmentation/config/index.ts +29 -0
- package/src/stateManagement/segmentation/config/segmentationColor.ts +132 -0
- package/src/stateManagement/segmentation/config/segmentationConfig.ts +195 -0
- package/src/stateManagement/segmentation/config/segmentationVisibility.ts +171 -0
- package/src/stateManagement/segmentation/helpers/index.ts +3 -0
- package/src/stateManagement/segmentation/helpers/normalizeSegmentationInput.ts +35 -0
- package/src/stateManagement/segmentation/helpers/validateSegmentationInput.ts +41 -0
- package/src/stateManagement/segmentation/index.ts +22 -0
- package/src/stateManagement/segmentation/removeSegmentationsFromToolGroup.ts +85 -0
- package/src/stateManagement/segmentation/segmentIndex.ts +38 -0
- package/src/stateManagement/segmentation/segmentLocking.ts +72 -0
- package/src/stateManagement/segmentation/segmentationState.ts +429 -0
- package/src/stateManagement/segmentation/triggerSegmentationEvents.ts +157 -0
- package/src/store/SynchronizerManager/Synchronizer.ts +344 -0
- package/src/store/SynchronizerManager/createSynchronizer.ts +41 -0
- package/src/store/SynchronizerManager/destroy.ts +14 -0
- package/src/store/SynchronizerManager/destroySynchronizer.ts +25 -0
- package/src/store/SynchronizerManager/getAllSynchronizers.ts +12 -0
- package/src/store/SynchronizerManager/getSynchronizer.ts +13 -0
- package/src/store/SynchronizerManager/getSynchronizersForViewport.ts +44 -0
- package/src/store/SynchronizerManager/index.js +15 -0
- package/src/store/ToolGroupManager/ToolGroup.ts +679 -0
- package/src/store/ToolGroupManager/createToolGroup.ts +33 -0
- package/src/store/ToolGroupManager/destroy.ts +24 -0
- package/src/store/ToolGroupManager/destroyToolGroup.ts +26 -0
- package/src/store/ToolGroupManager/getAllToolGroups.ts +12 -0
- package/src/store/ToolGroupManager/getToolGroup.ts +14 -0
- package/src/store/ToolGroupManager/getToolGroupForViewport.ts +44 -0
- package/src/store/ToolGroupManager/getToolGroupsWithToolName.ts +33 -0
- package/src/store/ToolGroupManager/index.ts +17 -0
- package/src/store/addEnabledElement.ts +137 -0
- package/src/store/addTool.ts +56 -0
- package/src/store/cancelActiveManipulations.ts +30 -0
- package/src/store/filterMoveableAnnotationTools.ts +61 -0
- package/src/store/filterToolsWithAnnotationsForElement.ts +51 -0
- package/src/store/filterToolsWithMoveableHandles.ts +51 -0
- package/src/store/index.ts +29 -0
- package/src/store/removeEnabledElement.ts +132 -0
- package/src/store/state.ts +57 -0
- package/src/store/svgNodeCache.ts +7 -0
- package/src/synchronizers/callbacks/areViewportsCoplanar .ts +12 -0
- package/src/synchronizers/callbacks/cameraSyncCallback.ts +33 -0
- package/src/synchronizers/callbacks/stackImageSyncCallback.ts +157 -0
- package/src/synchronizers/callbacks/voiSyncCallback.ts +51 -0
- package/src/synchronizers/callbacks/zoomPanSyncCallback.ts +43 -0
- package/src/synchronizers/index.ts +11 -0
- package/src/synchronizers/synchronizers/createCameraPositionSynchronizer.ts +25 -0
- package/src/synchronizers/synchronizers/createStackImageSynchronizer.ts +25 -0
- package/src/synchronizers/synchronizers/createVOISynchronizer.ts +24 -0
- package/src/synchronizers/synchronizers/createZoomPanSynchronizer.ts +25 -0
- package/src/synchronizers/synchronizers/index.ts +11 -0
- package/src/tools/CrosshairsTool.ts +2693 -0
- package/src/tools/MIPJumpToClickTool.ts +99 -0
- package/src/tools/MagnifyTool.ts +319 -0
- package/src/tools/PanTool.ts +58 -0
- package/src/tools/PlanarRotateTool.ts +77 -0
- package/src/tools/ReferenceCursors.ts +466 -0
- package/src/tools/ReferenceLinesTool.ts +279 -0
- package/src/tools/ScaleOverlayTool.ts +685 -0
- package/src/tools/StackScrollTool.ts +97 -0
- package/src/tools/StackScrollToolMouseWheelTool.ts +58 -0
- package/src/tools/TrackballRotateTool.ts +141 -0
- package/src/tools/VolumeRotateMouseWheelTool.ts +86 -0
- package/src/tools/WindowLevelTool.ts +260 -0
- package/src/tools/ZoomTool.ts +293 -0
- package/src/tools/annotation/AngleTool.ts +835 -0
- package/src/tools/annotation/ArrowAnnotateTool.ts +820 -0
- package/src/tools/annotation/BidirectionalTool.ts +1350 -0
- package/src/tools/annotation/CircleROITool.ts +1070 -0
- package/src/tools/annotation/CobbAngleTool.ts +815 -0
- package/src/tools/annotation/DragProbeTool.ts +213 -0
- package/src/tools/annotation/EllipticalROITool.ts +1223 -0
- package/src/tools/annotation/LengthTool.ts +861 -0
- package/src/tools/annotation/PlanarFreehandROITool.ts +636 -0
- package/src/tools/annotation/ProbeTool.ts +681 -0
- package/src/tools/annotation/RectangleROITool.ts +1028 -0
- package/src/tools/annotation/planarFreehandROITool/closedContourEditLoop.ts +488 -0
- package/src/tools/annotation/planarFreehandROITool/drawLoop.ts +462 -0
- package/src/tools/annotation/planarFreehandROITool/editLoopCommon.ts +331 -0
- package/src/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.ts +74 -0
- package/src/tools/annotation/planarFreehandROITool/openContourEditLoop.ts +612 -0
- package/src/tools/annotation/planarFreehandROITool/openContourEndEditLoop.ts +74 -0
- package/src/tools/annotation/planarFreehandROITool/renderMethods.ts +407 -0
- package/src/tools/base/AnnotationDisplayTool.ts +228 -0
- package/src/tools/base/AnnotationTool.ts +307 -0
- package/src/tools/base/BaseTool.ts +215 -0
- package/src/tools/base/index.ts +4 -0
- package/src/tools/displayTools/Contour/addContourToElement.ts +135 -0
- package/src/tools/displayTools/Contour/contourDisplay.ts +252 -0
- package/src/tools/displayTools/Contour/index.ts +3 -0
- package/src/tools/displayTools/Contour/removeContourFromElement.ts +35 -0
- package/src/tools/displayTools/Labelmap/addLabelmapToElement.ts +57 -0
- package/src/tools/displayTools/Labelmap/index.ts +4 -0
- package/src/tools/displayTools/Labelmap/labelmapConfig.ts +37 -0
- package/src/tools/displayTools/Labelmap/labelmapDisplay.ts +461 -0
- package/src/tools/displayTools/Labelmap/removeLabelmapFromElement.ts +27 -0
- package/src/tools/displayTools/Labelmap/validateRepresentationData.ts +30 -0
- package/src/tools/displayTools/SegmentationDisplayTool.ts +198 -0
- package/src/tools/index.ts +84 -0
- package/src/tools/segmentation/BrushTool.ts +474 -0
- package/src/tools/segmentation/CircleScissorsTool.ts +365 -0
- package/src/tools/segmentation/PaintFillTool.ts +370 -0
- package/src/tools/segmentation/RectangleROIStartEndThresholdTool.ts +471 -0
- package/src/tools/segmentation/RectangleROIThresholdTool.ts +281 -0
- package/src/tools/segmentation/RectangleScissorsTool.ts +382 -0
- package/src/tools/segmentation/SphereScissorsTool.ts +368 -0
- package/src/tools/segmentation/strategies/eraseCircle.ts +30 -0
- package/src/tools/segmentation/strategies/eraseRectangle.ts +81 -0
- package/src/tools/segmentation/strategies/eraseSphere.ts +27 -0
- package/src/tools/segmentation/strategies/fillCircle.ts +185 -0
- package/src/tools/segmentation/strategies/fillRectangle.ts +110 -0
- package/src/tools/segmentation/strategies/fillSphere.ts +88 -0
- package/src/tools/segmentation/strategies/index.ts +9 -0
- package/src/types/AnnotationGroupSelector.ts +7 -0
- package/src/types/AnnotationStyle.ts +42 -0
- package/src/types/AnnotationTypes.ts +109 -0
- package/src/types/BoundsIJK.ts +5 -0
- package/src/types/CINETypes.ts +32 -0
- package/src/types/ContourTypes.ts +26 -0
- package/src/types/CursorTypes.ts +12 -0
- package/src/types/EventTypes.ts +657 -0
- package/src/types/FloodFillTypes.ts +19 -0
- package/src/types/IAnnotationManager.ts +89 -0
- package/src/types/IDistance.ts +16 -0
- package/src/types/IPoints.ts +18 -0
- package/src/types/ISetToolModeOptions.ts +29 -0
- package/src/types/ISynchronizerEventHandler.ts +11 -0
- package/src/types/IToolClassReference.ts +5 -0
- package/src/types/IToolGroup.ts +72 -0
- package/src/types/ITouchPoints.ts +14 -0
- package/src/types/InteractionTypes.ts +6 -0
- package/src/types/InternalToolTypes.ts +19 -0
- package/src/types/JumpToSliceOptions.ts +7 -0
- package/src/types/LabelmapTypes.ts +41 -0
- package/src/types/PlanarBoundingBox.ts +8 -0
- package/src/types/SVGDrawingHelper.ts +10 -0
- package/src/types/ScrollOptions.ts +9 -0
- package/src/types/SegmentationStateTypes.ts +248 -0
- package/src/types/ToolHandle.ts +26 -0
- package/src/types/ToolProps.ts +16 -0
- package/src/types/ToolSpecificAnnotationTypes.ts +311 -0
- package/src/types/index.ts +115 -0
- package/src/utilities/boundingBox/extend2DBoundingBoxInViewAxis.ts +29 -0
- package/src/utilities/boundingBox/getBoundingBoxAroundShape.ts +57 -0
- package/src/utilities/boundingBox/index.ts +4 -0
- package/src/utilities/calibrateImageSpacing.ts +46 -0
- package/src/utilities/cine/events.ts +9 -0
- package/src/utilities/cine/index.ts +5 -0
- package/src/utilities/cine/playClip.ts +435 -0
- package/src/utilities/cine/state.ts +18 -0
- package/src/utilities/clip.js +30 -0
- package/src/utilities/debounce.js +217 -0
- package/src/utilities/drawing/getTextBoxCoordsCanvas.ts +45 -0
- package/src/utilities/drawing/index.ts +3 -0
- package/src/utilities/dynamicVolume/getDataInTime.ts +110 -0
- package/src/utilities/dynamicVolume/index.ts +2 -0
- package/src/utilities/getAnnotationNearPoint.ts +130 -0
- package/src/utilities/getModalityUnit.ts +11 -0
- package/src/utilities/getToolsWithModesForElement.ts +52 -0
- package/src/utilities/index.ts +68 -0
- package/src/utilities/isObject.js +29 -0
- package/src/utilities/math/angle/angleBetweenLines.ts +29 -0
- package/src/utilities/math/circle/_types.ts +6 -0
- package/src/utilities/math/circle/getCanvasCircleCorners.ts +23 -0
- package/src/utilities/math/circle/getCanvasCircleRadius.ts +16 -0
- package/src/utilities/math/circle/index.ts +4 -0
- package/src/utilities/math/ellipse/getCanvasEllipseCorners.ts +26 -0
- package/src/utilities/math/ellipse/index.ts +4 -0
- package/src/utilities/math/ellipse/pointInEllipse.ts +38 -0
- package/src/utilities/math/ellipse/pointInEllipsoidWithConstraint.ts +35 -0
- package/src/utilities/math/index.ts +8 -0
- package/src/utilities/math/line/distanceToPoint.ts +24 -0
- package/src/utilities/math/line/distanceToPointSquared.ts +44 -0
- package/src/utilities/math/line/index.ts +5 -0
- package/src/utilities/math/line/intersectLine.ts +92 -0
- package/src/utilities/math/midPoint.ts +24 -0
- package/src/utilities/math/point/distanceToPoint.ts +22 -0
- package/src/utilities/math/point/index.ts +3 -0
- package/src/utilities/math/polyline/addCanvasPointsToArray.ts +62 -0
- package/src/utilities/math/polyline/calculateAreaOfPoints.ts +23 -0
- package/src/utilities/math/polyline/getIntersectionWithPolyline.ts +182 -0
- package/src/utilities/math/polyline/getSubPixelSpacingAndXYDirections.ts +99 -0
- package/src/utilities/math/polyline/index.ts +19 -0
- package/src/utilities/math/polyline/planarFreehandROIInternalTypes.ts +36 -0
- package/src/utilities/math/polyline/pointCanProjectOnLine.ts +57 -0
- package/src/utilities/math/polyline/pointsAreWithinCloseContourProximity.ts +15 -0
- package/src/utilities/math/rectangle/distanceToPoint.ts +82 -0
- package/src/utilities/math/rectangle/index.ts +3 -0
- package/src/utilities/math/sphere/index.ts +3 -0
- package/src/utilities/math/sphere/pointInSphere.ts +31 -0
- package/src/utilities/math/vec2/findClosestPoint.ts +40 -0
- package/src/utilities/math/vec2/index.ts +4 -0
- package/src/utilities/math/vec2/liangBarksyClip.ts +84 -0
- package/src/utilities/orientation/getOrientationStringLPS.ts +52 -0
- package/src/utilities/orientation/index.ts +4 -0
- package/src/utilities/orientation/invertOrientationStringLPS.ts +21 -0
- package/src/utilities/planar/filterAnnotationsForDisplay.ts +68 -0
- package/src/utilities/planar/filterAnnotationsWithinSlice.ts +85 -0
- package/src/utilities/planar/getPointInLineOfSightWithCriteria.ts +104 -0
- package/src/utilities/planar/getWorldWidthAndHeightFromCorners.ts +51 -0
- package/src/utilities/planar/getWorldWidthAndHeightFromTwoPoints.ts +51 -0
- package/src/utilities/planar/index.ts +18 -0
- package/src/utilities/planarFreehandROITool/index.ts +7 -0
- package/src/utilities/planarFreehandROITool/interpolateAnnotation.ts +87 -0
- package/src/utilities/planarFreehandROITool/interpolatePoints.ts +214 -0
- package/src/utilities/planarFreehandROITool/interpolation/algorithms/bspline.ts +55 -0
- package/src/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.ts +90 -0
- package/src/utilities/pointInShapeCallback.ts +138 -0
- package/src/utilities/pointInSurroundingSphereCallback.ts +188 -0
- package/src/utilities/rectangleROITool/getBoundsIJKFromRectangleAnnotations.ts +76 -0
- package/src/utilities/rectangleROITool/index.ts +3 -0
- package/src/utilities/scroll.ts +62 -0
- package/src/utilities/segmentation/brushSizeForToolGroup.ts +72 -0
- package/src/utilities/segmentation/brushThresholdForToolGroup.ts +65 -0
- package/src/utilities/segmentation/createLabelmapVolumeForViewport.ts +74 -0
- package/src/utilities/segmentation/createMergedLabelmapForIndex.ts +65 -0
- package/src/utilities/segmentation/floodFill.ts +194 -0
- package/src/utilities/segmentation/getDefaultRepresentationConfig.ts +20 -0
- package/src/utilities/segmentation/index.ts +33 -0
- package/src/utilities/segmentation/isValidRepresentationConfig.ts +22 -0
- package/src/utilities/segmentation/rectangleROIThresholdVolumeByRange.ts +91 -0
- package/src/utilities/segmentation/thresholdSegmentationByRange.ts +129 -0
- package/src/utilities/segmentation/thresholdVolumeByRange.ts +150 -0
- package/src/utilities/segmentation/triggerSegmentationRender.ts +206 -0
- package/src/utilities/segmentation/utilities.ts +116 -0
- package/src/utilities/stackPrefetch/index.ts +8 -0
- package/src/utilities/stackPrefetch/stackPrefetch.ts +405 -0
- package/src/utilities/stackPrefetch/state.ts +17 -0
- package/src/utilities/throttle.js +69 -0
- package/src/utilities/touch/index.ts +246 -0
- package/src/utilities/triggerAnnotationRender.ts +237 -0
- package/src/utilities/triggerAnnotationRenderForViewportIds.ts +18 -0
- package/src/utilities/viewport/index.ts +5 -0
- package/src/utilities/viewport/isViewportPreScaled.ts +24 -0
- package/src/utilities/viewport/jumpToSlice.ts +73 -0
- package/src/utilities/viewport/jumpToWorld.ts +58 -0
- package/src/utilities/viewportFilters/filterViewportsWithFrameOfReferenceUID.ts +28 -0
- package/src/utilities/viewportFilters/filterViewportsWithParallelNormals.ts +26 -0
- package/src/utilities/viewportFilters/filterViewportsWithSameOrientation.ts +15 -0
- package/src/utilities/viewportFilters/filterViewportsWithToolEnabled.ts +72 -0
- package/src/utilities/viewportFilters/getViewportIdsWithToolToRender.ts +45 -0
- package/src/utilities/viewportFilters/index.ts +11 -0
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { Annotation } from './AnnotationTypes';
|
|
3
|
+
import IPoints from './IPoints';
|
|
4
|
+
import ITouchPoints from './ITouchPoints';
|
|
5
|
+
import IDistance from './IDistance';
|
|
6
|
+
import { Swipe } from '../enums/Touch';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The normalized interaction event detail
|
|
10
|
+
*/
|
|
11
|
+
type NormalizedInteractionEventDetail = {
|
|
12
|
+
/** The normalized event name. */
|
|
13
|
+
eventName: string;
|
|
14
|
+
/** The unique identifier of the rendering engine. */
|
|
15
|
+
renderingEngineId: string;
|
|
16
|
+
/** The unique identifier of the viewport that the event was fired in. */
|
|
17
|
+
viewportId: string;
|
|
18
|
+
/** The camera at the time of the event. */
|
|
19
|
+
camera: Record<string, unknown>;
|
|
20
|
+
/** The element that the event was fired on. */
|
|
21
|
+
element: HTMLDivElement;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type MouseCustomEventDetail = NormalizedInteractionEventDetail & {
|
|
25
|
+
/** The original event object. */
|
|
26
|
+
event: Record<string, unknown> | MouseEvent;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
type TouchCustomEventDetail = NormalizedInteractionEventDetail & {
|
|
30
|
+
/** The original event object. */
|
|
31
|
+
event: Record<string, unknown> | TouchEvent;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type MousePointsDetail = {
|
|
35
|
+
/** The starting points of the mouse event. */
|
|
36
|
+
startPoints: IPoints;
|
|
37
|
+
/** The last points of the mouse. */
|
|
38
|
+
lastPoints: IPoints;
|
|
39
|
+
/** The current mouse position. */
|
|
40
|
+
currentPoints: IPoints;
|
|
41
|
+
/** The difference between the current and last points. */
|
|
42
|
+
deltaPoints: IPoints;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type TouchPointsDetail = {
|
|
46
|
+
/** The starting points of the touch event. */
|
|
47
|
+
startPoints: ITouchPoints;
|
|
48
|
+
/** The last points of the touch. */
|
|
49
|
+
lastPoints: ITouchPoints;
|
|
50
|
+
/** The current touch position. */
|
|
51
|
+
currentPoints: ITouchPoints;
|
|
52
|
+
|
|
53
|
+
startPointsList: ITouchPoints[];
|
|
54
|
+
/** The last points of the touch. */
|
|
55
|
+
lastPointsList: ITouchPoints[];
|
|
56
|
+
/** The current touch position. */
|
|
57
|
+
currentPointsList: ITouchPoints[];
|
|
58
|
+
|
|
59
|
+
/** The difference between the current and last points. */
|
|
60
|
+
deltaPoints: IPoints;
|
|
61
|
+
/** The difference between distances between the current and last points. */
|
|
62
|
+
deltaDistance: IDistance;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
type InteractionEventDetail = NormalizedInteractionEventDetail &
|
|
66
|
+
(MouseCustomEventDetail | TouchCustomEventDetail) &
|
|
67
|
+
(MousePointsDetail | TouchPointsDetail);
|
|
68
|
+
|
|
69
|
+
type InteractionStartEventDetail = InteractionEventDetail;
|
|
70
|
+
|
|
71
|
+
type InteractionEndEventDetail = InteractionEventDetail;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The data that is passed to the event handler when a new annotation is added
|
|
75
|
+
* to the annotations.
|
|
76
|
+
*/
|
|
77
|
+
type AnnotationAddedEventDetail = {
|
|
78
|
+
/** unique id of the viewport */
|
|
79
|
+
viewportId: string;
|
|
80
|
+
/** unique id of the rendering engine */
|
|
81
|
+
renderingEngineId: string;
|
|
82
|
+
/** The annotation that is being added to the annotations manager. */
|
|
83
|
+
annotation: Annotation;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The data that is passed to the event handler when a new annotation is completed
|
|
88
|
+
* drawing on the viewport.
|
|
89
|
+
*/
|
|
90
|
+
type AnnotationCompletedEventDetail = {
|
|
91
|
+
/** The annotation that is being added to the annotations manager. */
|
|
92
|
+
annotation: Annotation;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The data that is passed to the event handler when an annotation is modified.
|
|
97
|
+
*/
|
|
98
|
+
type AnnotationModifiedEventDetail = {
|
|
99
|
+
/** unique id of the viewport */
|
|
100
|
+
viewportId: string;
|
|
101
|
+
/** unique id of the rendering engine */
|
|
102
|
+
renderingEngineId: string;
|
|
103
|
+
/** The annotation that is being added to the annotations manager. */
|
|
104
|
+
annotation: Annotation;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The data that is passed to the event handler when an annotation is completed drawing.
|
|
109
|
+
*/
|
|
110
|
+
type AnnotationRemovedEventDetail = {
|
|
111
|
+
/** The annotation that is being added to the annotations manager. */
|
|
112
|
+
annotation: Annotation;
|
|
113
|
+
/** annotationManagerUID */
|
|
114
|
+
annotationManagerUID: string;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The data that is passed to the event handler when an annotation selection status changes.
|
|
119
|
+
*/
|
|
120
|
+
type AnnotationSelectionChangeEventDetail = {
|
|
121
|
+
/** AnnotationUID added to the selection */
|
|
122
|
+
added: Array<string>;
|
|
123
|
+
/** AnnotationUID removed from the selection */
|
|
124
|
+
removed: Array<string>;
|
|
125
|
+
/** Updated selection */
|
|
126
|
+
selection: Array<string>;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The data that is passed to the event handler when an annotation lock status changes.
|
|
131
|
+
*/
|
|
132
|
+
type AnnotationLockChangeEventDetail = {
|
|
133
|
+
// List of instances changed to locked state by the last operation.
|
|
134
|
+
added: Array<Annotation>;
|
|
135
|
+
// List of instances removed from locked state by the last operation.
|
|
136
|
+
removed: Array<Annotation>;
|
|
137
|
+
// Updated list of currently locked instances
|
|
138
|
+
locked: Array<Annotation>;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
type AnnotationVisibilityChangeEventDetail = {
|
|
142
|
+
// List of instances uids changed to NOT visible (hidden) state by the last operation.
|
|
143
|
+
lastHidden: Array<string>;
|
|
144
|
+
// List of instances uids removed from Hidden state by the last operation.
|
|
145
|
+
lastVisible: Array<string>;
|
|
146
|
+
// Updated list of currently hidden instances uids
|
|
147
|
+
hidden: Array<string>;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* The data that is passed to the event handler when an annotation selection status changes.
|
|
152
|
+
*/
|
|
153
|
+
type AnnotationRenderedEventDetail = {
|
|
154
|
+
/** The HTML element that the annotation was rendered on. */
|
|
155
|
+
element: HTMLDivElement;
|
|
156
|
+
/** unique id of the viewport */
|
|
157
|
+
viewportId: string;
|
|
158
|
+
/** unique id of the rendering engine */
|
|
159
|
+
renderingEngineId: string;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* EventDetail for when a Segmentation Data is modified by a tool
|
|
164
|
+
*/
|
|
165
|
+
type SegmentationDataModifiedEventDetail = {
|
|
166
|
+
/** unique id of the segmentationData */
|
|
167
|
+
segmentationId: string;
|
|
168
|
+
/** array of slice indices in a labelmap which have been modified */
|
|
169
|
+
// TODO: This is labelmap-specific and needs to be a labelmap-specific event
|
|
170
|
+
modifiedSlicesToUse?: number[];
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* EventDetail for when a Segmentation is rendered by segmentation rendering engine
|
|
175
|
+
*/
|
|
176
|
+
type SegmentationRenderedEventDetail = {
|
|
177
|
+
/** unique id of the viewport */
|
|
178
|
+
viewportId: string;
|
|
179
|
+
/** unique id of the toolGroup segmentation belongs to */
|
|
180
|
+
toolGroupId: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* EventDetail for when a Segmentation Representation for a toolGroup is modified
|
|
185
|
+
*/
|
|
186
|
+
type SegmentationRepresentationModifiedEventDetail = {
|
|
187
|
+
/** unique id of the toolGroup */
|
|
188
|
+
toolGroupId: string;
|
|
189
|
+
/** segmentation representationUID */
|
|
190
|
+
segmentationRepresentationUID: string;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* EventDetail for when a Segmentation is removed
|
|
195
|
+
*/
|
|
196
|
+
type SegmentationRemovedEventDetail = {
|
|
197
|
+
/** the id of the removed segmentation */
|
|
198
|
+
segmentationId: string;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* EventDetail for when a Segmentation Representation is removed
|
|
203
|
+
*/
|
|
204
|
+
type SegmentationRepresentationRemovedEventDetail = {
|
|
205
|
+
/** unique id of the toolGroup */
|
|
206
|
+
toolGroupId: string;
|
|
207
|
+
/** segmentation representationUID */
|
|
208
|
+
segmentationRepresentationUID: string;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* EventDetail for when a Segmentation Global State is modified
|
|
213
|
+
*/
|
|
214
|
+
type SegmentationModifiedEventDetail = {
|
|
215
|
+
/** unique id of segmentation (not segmentationData), for volumes (labelMaps) it is volumeId */
|
|
216
|
+
segmentationId: string;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* EventDetail for keyDown event
|
|
221
|
+
*/
|
|
222
|
+
type KeyDownEventDetail = {
|
|
223
|
+
/** html element */
|
|
224
|
+
element: HTMLDivElement;
|
|
225
|
+
/** unique id of the viewport */
|
|
226
|
+
viewportId: string;
|
|
227
|
+
/** unique id of the rendering engine */
|
|
228
|
+
renderingEngineId: string;
|
|
229
|
+
/** The key that was pressed */
|
|
230
|
+
key: string;
|
|
231
|
+
/** key code */
|
|
232
|
+
keyCode: number;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/** EventDetail for keyDown event */
|
|
236
|
+
type KeyUpEventDetail = KeyDownEventDetail;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* EventDetail for mouseDown event
|
|
240
|
+
*/
|
|
241
|
+
type MouseDownEventDetail = NormalizedInteractionEventDetail &
|
|
242
|
+
MouseCustomEventDetail &
|
|
243
|
+
MousePointsDetail & {
|
|
244
|
+
/** The mouse button that was pressed. */
|
|
245
|
+
mouseButton: number;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* EventDetail for touchstart event
|
|
250
|
+
*/
|
|
251
|
+
type TouchStartEventDetail = NormalizedInteractionEventDetail &
|
|
252
|
+
TouchCustomEventDetail &
|
|
253
|
+
TouchPointsDetail;
|
|
254
|
+
/**
|
|
255
|
+
* EventDetail for mouseDrag event
|
|
256
|
+
*/
|
|
257
|
+
type MouseDragEventDetail = NormalizedInteractionEventDetail &
|
|
258
|
+
MouseCustomEventDetail &
|
|
259
|
+
MousePointsDetail & {
|
|
260
|
+
/** The mouse button that was pressed. */
|
|
261
|
+
mouseButton: number;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* EventDetail for touch drag event
|
|
266
|
+
*/
|
|
267
|
+
type TouchDragEventDetail = NormalizedInteractionEventDetail &
|
|
268
|
+
TouchCustomEventDetail &
|
|
269
|
+
TouchPointsDetail;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* EventDetail mouseMove event
|
|
273
|
+
*/
|
|
274
|
+
type MouseMoveEventDetail = NormalizedInteractionEventDetail &
|
|
275
|
+
MouseCustomEventDetail & {
|
|
276
|
+
/** The current mouse position. */
|
|
277
|
+
currentPoints: IPoints;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* EventDetail for mouseUp event
|
|
282
|
+
*/
|
|
283
|
+
type MouseUpEventDetail = NormalizedInteractionEventDetail &
|
|
284
|
+
MouseCustomEventDetail &
|
|
285
|
+
MousePointsDetail & {
|
|
286
|
+
/** The mouse button that was pressed. */
|
|
287
|
+
mouseButton: number;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* EventDetail for touch end event
|
|
292
|
+
*/
|
|
293
|
+
type TouchEndEventDetail = NormalizedInteractionEventDetail &
|
|
294
|
+
TouchPointsDetail &
|
|
295
|
+
TouchCustomEventDetail;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* EventDetail for mouseDown Activate, it is triggered when mouseDown event is fired
|
|
299
|
+
* but stopPropagation is not called, used for creating new annotation
|
|
300
|
+
*/
|
|
301
|
+
type MouseDownActivateEventDetail = NormalizedInteractionEventDetail &
|
|
302
|
+
MousePointsDetail &
|
|
303
|
+
MouseCustomEventDetail & {
|
|
304
|
+
/** The mouse button that was pressed. */
|
|
305
|
+
mouseButton: number;
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* EventDetail for touchStart Activate, it is triggered when touchStart event is fired
|
|
310
|
+
* but stopPropagation is not called, used for creating new annotation
|
|
311
|
+
*/
|
|
312
|
+
type TouchStartActivateEventDetail = NormalizedInteractionEventDetail &
|
|
313
|
+
TouchCustomEventDetail &
|
|
314
|
+
TouchPointsDetail;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* EventDetail mouseClick (a mouse down which is followed by a mouse up)
|
|
318
|
+
*/
|
|
319
|
+
type MouseClickEventDetail = NormalizedInteractionEventDetail &
|
|
320
|
+
MouseCustomEventDetail &
|
|
321
|
+
MousePointsDetail & {
|
|
322
|
+
/** The mouse button that was pressed. */
|
|
323
|
+
mouseButton: number;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* EventDetail mouseClick (a mouse down which is followed by a mouse up)
|
|
328
|
+
*/
|
|
329
|
+
type MouseDoubleClickEventDetail = NormalizedInteractionEventDetail &
|
|
330
|
+
MouseCustomEventDetail &
|
|
331
|
+
MousePointsDetail;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* EventDetail touchTap (successive taps which do not trigger touchstart)
|
|
335
|
+
*/
|
|
336
|
+
type TouchTapEventDetail = NormalizedInteractionEventDetail &
|
|
337
|
+
TouchCustomEventDetail & {
|
|
338
|
+
currentPointsList: ITouchPoints[];
|
|
339
|
+
currentPoints: ITouchPoints;
|
|
340
|
+
taps: number;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
type TouchSwipeEventDetail = NormalizedInteractionEventDetail &
|
|
344
|
+
TouchCustomEventDetail & {
|
|
345
|
+
/** Swipe direction */
|
|
346
|
+
swipe: Swipe;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* EventDetail touchPress (a longer press in the same spot)
|
|
351
|
+
*/
|
|
352
|
+
type TouchPressEventDetail = NormalizedInteractionEventDetail &
|
|
353
|
+
TouchCustomEventDetail & {
|
|
354
|
+
/** The starting points of the touch event. */
|
|
355
|
+
startPointsList: ITouchPoints[];
|
|
356
|
+
/** The last points of the touch. */
|
|
357
|
+
lastPointsList: ITouchPoints[];
|
|
358
|
+
/** The starting points of the touch event. */
|
|
359
|
+
startPoints: ITouchPoints;
|
|
360
|
+
/** The last points of the touch. */
|
|
361
|
+
lastPoints: ITouchPoints;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Mouse Wheel event detail
|
|
366
|
+
*/
|
|
367
|
+
type MouseWheelEventDetail = NormalizedInteractionEventDetail &
|
|
368
|
+
MouseCustomEventDetail & {
|
|
369
|
+
/** wheel detail */
|
|
370
|
+
detail: Record<string, any>;
|
|
371
|
+
/** wheel information */
|
|
372
|
+
wheel: {
|
|
373
|
+
spinX: number;
|
|
374
|
+
spinY: number;
|
|
375
|
+
pixelX: number;
|
|
376
|
+
pixelY: number;
|
|
377
|
+
direction: number;
|
|
378
|
+
};
|
|
379
|
+
/** Mouse Points */
|
|
380
|
+
points: IPoints;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
/////////////////////////////
|
|
384
|
+
//
|
|
385
|
+
//
|
|
386
|
+
// Event Types
|
|
387
|
+
//
|
|
388
|
+
//
|
|
389
|
+
/////////////////////////////
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* The Normalized mouse event type
|
|
393
|
+
*/
|
|
394
|
+
type NormalizedMouseEventType = Types.CustomEventType<MouseCustomEventDetail>;
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* The Normalized mouse event type
|
|
398
|
+
*/
|
|
399
|
+
type NormalizedTouchEventType = Types.CustomEventType<TouchCustomEventDetail>;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* The AnnotationAdded event type
|
|
403
|
+
*/
|
|
404
|
+
type AnnotationAddedEventType =
|
|
405
|
+
Types.CustomEventType<AnnotationAddedEventDetail>;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* The AnnotationCompleted event type
|
|
409
|
+
*/
|
|
410
|
+
type AnnotationCompletedEventType =
|
|
411
|
+
Types.CustomEventType<AnnotationCompletedEventDetail>;
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* The AnnotationModified event type
|
|
415
|
+
*/
|
|
416
|
+
type AnnotationModifiedEventType =
|
|
417
|
+
Types.CustomEventType<AnnotationModifiedEventDetail>;
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* The AnnotationRemoved event type
|
|
421
|
+
*/
|
|
422
|
+
type AnnotationRemovedEventType =
|
|
423
|
+
Types.CustomEventType<AnnotationRemovedEventDetail>;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* The AnnotationSelectionChange event type
|
|
427
|
+
*/
|
|
428
|
+
type AnnotationSelectionChangeEventType =
|
|
429
|
+
Types.CustomEventType<AnnotationSelectionChangeEventDetail>;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* The AnnotationRendered event type
|
|
433
|
+
*/
|
|
434
|
+
type AnnotationRenderedEventType =
|
|
435
|
+
Types.CustomEventType<AnnotationRenderedEventDetail>;
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The AnnotationLockChange event type
|
|
439
|
+
*/
|
|
440
|
+
type AnnotationLockChangeEventType =
|
|
441
|
+
Types.CustomEventType<AnnotationLockChangeEventDetail>;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* The AnnotationVisibilityChange event type
|
|
445
|
+
*/
|
|
446
|
+
type AnnotationVisibilityChangeEventType =
|
|
447
|
+
Types.CustomEventType<AnnotationVisibilityChangeEventDetail>;
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Event for when SegmentationData is modified
|
|
451
|
+
*/
|
|
452
|
+
type SegmentationDataModifiedEventType =
|
|
453
|
+
Types.CustomEventType<SegmentationDataModifiedEventDetail>;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Event for when Segmentation Representation is modified
|
|
457
|
+
*/
|
|
458
|
+
type SegmentationRepresentationModifiedEventType =
|
|
459
|
+
Types.CustomEventType<SegmentationRepresentationModifiedEventDetail>;
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* Event for when Segmentation is removed
|
|
463
|
+
*/
|
|
464
|
+
type SegmentationRemovedEventType =
|
|
465
|
+
Types.CustomEventType<SegmentationRemovedEventDetail>;
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Event for when Segmentation Representation is modified
|
|
469
|
+
*/
|
|
470
|
+
type SegmentationRepresentationRemovedEventType =
|
|
471
|
+
Types.CustomEventType<SegmentationRepresentationRemovedEventDetail>;
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Event for when Segmentation is rendered
|
|
475
|
+
*/
|
|
476
|
+
type SegmentationRenderedEventType =
|
|
477
|
+
Types.CustomEventType<SegmentationRenderedEventDetail>;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Event for when Segmentation Global State is modified
|
|
481
|
+
*/
|
|
482
|
+
type SegmentationModifiedEventType =
|
|
483
|
+
Types.CustomEventType<SegmentationModifiedEventDetail>;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Event for when a key is pressed
|
|
487
|
+
*/
|
|
488
|
+
type KeyDownEventType = Types.CustomEventType<KeyDownEventDetail>;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Event for when a key is released
|
|
492
|
+
*/
|
|
493
|
+
type KeyUpEventType = Types.CustomEventType<KeyUpEventDetail>;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Event for when a mouse button is pressed
|
|
497
|
+
*/
|
|
498
|
+
type MouseDownEventType = Types.CustomEventType<MouseDownEventDetail>;
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Event for when a touch is tapped
|
|
502
|
+
*/
|
|
503
|
+
type TouchTapEventType = Types.CustomEventType<TouchTapEventDetail>;
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Event for when a touch is swiped
|
|
507
|
+
*/
|
|
508
|
+
type TouchSwipeEventType = Types.CustomEventType<TouchSwipeEventDetail>;
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Event for when a touch is long pressed
|
|
512
|
+
*/
|
|
513
|
+
type TouchPressEventType = Types.CustomEventType<TouchPressEventDetail>;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Event for when a touch starts
|
|
517
|
+
*/
|
|
518
|
+
type TouchStartEventType = Types.CustomEventType<TouchStartEventDetail>;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Event for interaction
|
|
522
|
+
*/
|
|
523
|
+
type InteractionEventType = Types.CustomEventType<InteractionEventDetail>;
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Event for interaction start
|
|
527
|
+
*/
|
|
528
|
+
type InteractionStartType = Types.CustomEventType<InteractionStartEventDetail>;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Event for interaction end
|
|
532
|
+
*/
|
|
533
|
+
type InteractionEndType = Types.CustomEventType<InteractionEndEventDetail>;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Event for mouse down event
|
|
537
|
+
*/
|
|
538
|
+
type MouseDownActivateEventType =
|
|
539
|
+
Types.CustomEventType<MouseDownActivateEventDetail>;
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
* Event for touch start event
|
|
543
|
+
*/
|
|
544
|
+
type TouchStartActivateEventType =
|
|
545
|
+
Types.CustomEventType<TouchStartActivateEventDetail>;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Event for mouse drag
|
|
549
|
+
*/
|
|
550
|
+
type MouseDragEventType = Types.CustomEventType<MouseDragEventDetail>;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Event for touch drag
|
|
554
|
+
*/
|
|
555
|
+
type TouchDragEventType = Types.CustomEventType<TouchDragEventDetail>;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Event for mouse up
|
|
559
|
+
*/
|
|
560
|
+
type MouseUpEventType = Types.CustomEventType<MouseUpEventDetail>;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Event for touch end
|
|
564
|
+
*/
|
|
565
|
+
type TouchEndEventType = Types.CustomEventType<TouchEndEventDetail>;
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Event for mouse click
|
|
569
|
+
*/
|
|
570
|
+
type MouseClickEventType = Types.CustomEventType<MouseClickEventDetail>;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Event for mouse move
|
|
574
|
+
*/
|
|
575
|
+
type MouseMoveEventType = Types.CustomEventType<MouseMoveEventDetail>;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Event for mouse double click
|
|
579
|
+
*/
|
|
580
|
+
type MouseDoubleClickEventType =
|
|
581
|
+
Types.CustomEventType<MouseDoubleClickEventDetail>;
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Event for mouse wheel
|
|
585
|
+
*/
|
|
586
|
+
type MouseWheelEventType = Types.CustomEventType<MouseWheelEventDetail>;
|
|
587
|
+
|
|
588
|
+
export {
|
|
589
|
+
InteractionStartType,
|
|
590
|
+
InteractionEndType,
|
|
591
|
+
InteractionEventType,
|
|
592
|
+
NormalizedInteractionEventDetail,
|
|
593
|
+
NormalizedMouseEventType,
|
|
594
|
+
NormalizedTouchEventType,
|
|
595
|
+
AnnotationAddedEventDetail,
|
|
596
|
+
AnnotationAddedEventType,
|
|
597
|
+
AnnotationCompletedEventDetail,
|
|
598
|
+
AnnotationCompletedEventType,
|
|
599
|
+
AnnotationModifiedEventDetail,
|
|
600
|
+
AnnotationModifiedEventType,
|
|
601
|
+
AnnotationRemovedEventDetail,
|
|
602
|
+
AnnotationRemovedEventType,
|
|
603
|
+
AnnotationSelectionChangeEventDetail,
|
|
604
|
+
AnnotationSelectionChangeEventType,
|
|
605
|
+
AnnotationRenderedEventDetail,
|
|
606
|
+
AnnotationRenderedEventType,
|
|
607
|
+
AnnotationLockChangeEventDetail,
|
|
608
|
+
AnnotationVisibilityChangeEventDetail,
|
|
609
|
+
AnnotationLockChangeEventType,
|
|
610
|
+
AnnotationVisibilityChangeEventType,
|
|
611
|
+
SegmentationDataModifiedEventType,
|
|
612
|
+
SegmentationRepresentationModifiedEventDetail,
|
|
613
|
+
SegmentationRepresentationModifiedEventType,
|
|
614
|
+
SegmentationRepresentationRemovedEventDetail,
|
|
615
|
+
SegmentationRepresentationRemovedEventType,
|
|
616
|
+
SegmentationRemovedEventType,
|
|
617
|
+
SegmentationRemovedEventDetail,
|
|
618
|
+
SegmentationDataModifiedEventDetail,
|
|
619
|
+
SegmentationRenderedEventType,
|
|
620
|
+
SegmentationRenderedEventDetail,
|
|
621
|
+
SegmentationModifiedEventType,
|
|
622
|
+
SegmentationModifiedEventDetail,
|
|
623
|
+
KeyDownEventDetail,
|
|
624
|
+
KeyDownEventType,
|
|
625
|
+
KeyUpEventDetail,
|
|
626
|
+
KeyUpEventType,
|
|
627
|
+
MouseDownEventDetail,
|
|
628
|
+
TouchStartEventDetail,
|
|
629
|
+
MouseDownEventType,
|
|
630
|
+
TouchStartEventType,
|
|
631
|
+
MouseDownActivateEventDetail,
|
|
632
|
+
TouchStartActivateEventDetail,
|
|
633
|
+
MouseDownActivateEventType,
|
|
634
|
+
TouchStartActivateEventType,
|
|
635
|
+
MouseDragEventDetail,
|
|
636
|
+
TouchDragEventDetail,
|
|
637
|
+
MouseDragEventType,
|
|
638
|
+
TouchDragEventType,
|
|
639
|
+
MouseUpEventDetail,
|
|
640
|
+
TouchEndEventDetail,
|
|
641
|
+
MouseUpEventType,
|
|
642
|
+
TouchEndEventType,
|
|
643
|
+
MouseClickEventDetail,
|
|
644
|
+
MouseClickEventType,
|
|
645
|
+
TouchTapEventDetail,
|
|
646
|
+
TouchTapEventType,
|
|
647
|
+
TouchSwipeEventDetail,
|
|
648
|
+
TouchSwipeEventType,
|
|
649
|
+
TouchPressEventDetail,
|
|
650
|
+
TouchPressEventType,
|
|
651
|
+
MouseMoveEventDetail,
|
|
652
|
+
MouseMoveEventType,
|
|
653
|
+
MouseDoubleClickEventDetail,
|
|
654
|
+
MouseDoubleClickEventType,
|
|
655
|
+
MouseWheelEventDetail,
|
|
656
|
+
MouseWheelEventType,
|
|
657
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
type FloodFillResult = {
|
|
4
|
+
flooded: Types.Point2[] | Types.Point3[];
|
|
5
|
+
boundaries: Types.Point2[] | Types.Point3[];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type FloodFillGetter3D = (x: number, y: number, z: number) => number;
|
|
9
|
+
type FloodFillGetter2D = (x: number, y: number) => number;
|
|
10
|
+
type FloodFillGetter = FloodFillGetter2D | FloodFillGetter3D;
|
|
11
|
+
|
|
12
|
+
type FloodFillOptions = {
|
|
13
|
+
onFlood?: (x, y) => void;
|
|
14
|
+
onBoundary?: (x, y) => void;
|
|
15
|
+
equals?: (a, b) => boolean; // Equality operation for your datastructure. Defaults to a === b.
|
|
16
|
+
diagonals?: boolean; // Whether to flood fill across diagonals. Default false.
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { FloodFillResult, FloodFillGetter, FloodFillOptions };
|