@cornerstonejs/tools 2.0.0-beta.1 → 2.0.0-beta.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/drawingSvg/drawCircle.js +9 -5
- package/dist/cjs/drawingSvg/drawCircle.js.map +1 -1
- package/dist/cjs/drawingSvg/drawEllipse.js +4 -4
- package/dist/cjs/drawingSvg/drawEllipse.js.map +1 -1
- package/dist/cjs/drawingSvg/drawHandles.js +4 -4
- package/dist/cjs/drawingSvg/drawHandles.js.map +1 -1
- package/dist/cjs/drawingSvg/drawLine.js +4 -4
- package/dist/cjs/drawingSvg/drawLine.js.map +1 -1
- package/dist/cjs/drawingSvg/drawPolyline.js +4 -4
- package/dist/cjs/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/cjs/drawingSvg/drawRect.js +4 -4
- package/dist/cjs/drawingSvg/drawRect.js.map +1 -1
- package/dist/cjs/drawingSvg/drawTextBox.js +4 -4
- package/dist/cjs/drawingSvg/drawTextBox.js.map +1 -1
- package/dist/cjs/drawingSvg/getSvgDrawingHelper.js +1 -1
- package/dist/cjs/drawingSvg/getSvgDrawingHelper.js.map +1 -1
- package/dist/cjs/drawingSvg/index.d.ts +3 -1
- package/dist/cjs/drawingSvg/index.js +5 -1
- package/dist/cjs/drawingSvg/index.js.map +1 -1
- package/dist/cjs/drawingSvg/setAttributesIfNecessary.d.ts +2 -0
- package/dist/cjs/drawingSvg/{_setAttributesIfNecessary.js → setAttributesIfNecessary.js} +5 -5
- package/dist/cjs/drawingSvg/setAttributesIfNecessary.js.map +1 -0
- package/dist/cjs/drawingSvg/setNewAttributesIfValid.d.ts +2 -0
- package/dist/cjs/drawingSvg/{_setNewAttributesIfValid.js → setNewAttributesIfValid.js} +5 -5
- package/dist/cjs/drawingSvg/setNewAttributesIfValid.js.map +1 -0
- package/dist/cjs/enums/Events.d.ts +2 -0
- package/dist/cjs/enums/Events.js +2 -0
- package/dist/cjs/enums/Events.js.map +1 -1
- package/dist/cjs/eventDispatchers/mouseEventHandlers/mouseDown.js +6 -1
- package/dist/cjs/eventDispatchers/mouseEventHandlers/mouseDown.js.map +1 -1
- package/dist/cjs/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.d.ts +2 -0
- package/dist/cjs/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.js +41 -0
- package/dist/cjs/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.js.map +1 -0
- package/dist/cjs/eventDispatchers/shared/getMouseModifier.js +10 -5
- package/dist/cjs/eventDispatchers/shared/getMouseModifier.js.map +1 -1
- package/dist/cjs/eventDispatchers/shared/getToolsWithActionsForMouseEvent.d.ts +3 -0
- package/dist/cjs/eventDispatchers/shared/getToolsWithActionsForMouseEvent.js +39 -0
- package/dist/cjs/eventDispatchers/shared/getToolsWithActionsForMouseEvent.js.map +1 -0
- package/dist/cjs/eventListeners/keyboard/keyDownListener.js +8 -0
- package/dist/cjs/eventListeners/keyboard/keyDownListener.js.map +1 -1
- package/dist/cjs/eventListeners/mouse/mouseDownListener.js +7 -2
- package/dist/cjs/eventListeners/mouse/mouseDownListener.js.map +1 -1
- package/dist/cjs/eventListeners/mouse/mouseMoveListener.js +5 -1
- package/dist/cjs/eventListeners/mouse/mouseMoveListener.js.map +1 -1
- package/dist/cjs/eventListeners/touch/touchStartListener.js +10 -5
- package/dist/cjs/eventListeners/touch/touchStartListener.js.map +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/config/ToolStyle.js +1 -0
- package/dist/cjs/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/config/getState.js +6 -3
- package/dist/cjs/stateManagement/annotation/config/getState.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/config/helpers.js +4 -2
- package/dist/cjs/stateManagement/annotation/config/helpers.js.map +1 -1
- package/dist/cjs/store/SynchronizerManager/Synchronizer.js +10 -2
- package/dist/cjs/store/SynchronizerManager/Synchronizer.js.map +1 -1
- package/dist/cjs/store/ToolGroupManager/ToolGroup.d.ts +5 -3
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js +44 -2
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/cjs/store/ToolGroupManager/getToolGroupsWithToolName.js +2 -1
- package/dist/cjs/store/ToolGroupManager/getToolGroupsWithToolName.js.map +1 -1
- package/dist/cjs/synchronizers/callbacks/stackImageSyncCallback.js +25 -22
- package/dist/cjs/synchronizers/callbacks/stackImageSyncCallback.js.map +1 -1
- package/dist/cjs/synchronizers/callbacks/voiSyncCallback.js +1 -1
- package/dist/cjs/synchronizers/callbacks/voiSyncCallback.js.map +1 -1
- package/dist/cjs/tools/AdvancedMagnifyTool.d.ts +36 -0
- package/dist/cjs/tools/AdvancedMagnifyTool.js +448 -0
- package/dist/cjs/tools/AdvancedMagnifyTool.js.map +1 -0
- package/dist/cjs/tools/AdvancedMagnifyViewport.d.ts +76 -0
- package/dist/cjs/tools/AdvancedMagnifyViewport.js +352 -0
- package/dist/cjs/tools/AdvancedMagnifyViewport.js.map +1 -0
- package/dist/cjs/tools/AdvancedMagnifyViewportManager.d.ts +36 -0
- package/dist/cjs/tools/AdvancedMagnifyViewportManager.js +133 -0
- package/dist/cjs/tools/AdvancedMagnifyViewportManager.js.map +1 -0
- package/dist/cjs/tools/MIPJumpToClickTool.js +4 -2
- package/dist/cjs/tools/MIPJumpToClickTool.js.map +1 -1
- package/dist/cjs/tools/MagnifyTool.js +2 -2
- package/dist/cjs/tools/MagnifyTool.js.map +1 -1
- package/dist/cjs/tools/OrientationMarkerTool.d.ts +88 -0
- package/dist/cjs/tools/OrientationMarkerTool.js +193 -0
- package/dist/cjs/tools/OrientationMarkerTool.js.map +1 -0
- package/dist/cjs/tools/OverlayGridTool.d.ts +31 -0
- package/dist/cjs/tools/OverlayGridTool.js +170 -0
- package/dist/cjs/tools/OverlayGridTool.js.map +1 -0
- package/dist/cjs/tools/PlanarRotateTool.js +2 -1
- package/dist/cjs/tools/PlanarRotateTool.js.map +1 -1
- package/dist/cjs/tools/ReferenceCursors.js +58 -29
- package/dist/cjs/tools/ReferenceCursors.js.map +1 -1
- package/dist/cjs/tools/ReferenceLinesTool.d.ts +3 -0
- package/dist/cjs/tools/ReferenceLinesTool.js +71 -2
- package/dist/cjs/tools/ReferenceLinesTool.js.map +1 -1
- package/dist/cjs/tools/ScaleOverlayTool.js +2 -1
- package/dist/cjs/tools/ScaleOverlayTool.js.map +1 -1
- package/dist/cjs/tools/annotation/AngleTool.d.ts +0 -1
- package/dist/cjs/tools/annotation/AngleTool.js +33 -15
- package/dist/cjs/tools/annotation/AngleTool.js.map +1 -1
- package/dist/cjs/tools/annotation/ArrowAnnotateTool.js +15 -1
- package/dist/cjs/tools/annotation/ArrowAnnotateTool.js.map +1 -1
- package/dist/cjs/tools/annotation/BidirectionalTool.d.ts +0 -1
- package/dist/cjs/tools/annotation/BidirectionalTool.js +30 -15
- package/dist/cjs/tools/annotation/BidirectionalTool.js.map +1 -1
- package/dist/cjs/tools/annotation/CircleROITool.d.ts +1 -3
- package/dist/cjs/tools/annotation/CircleROITool.js +63 -60
- package/dist/cjs/tools/annotation/CircleROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/CobbAngleTool.d.ts +31 -6
- package/dist/cjs/tools/annotation/CobbAngleTool.js +294 -82
- package/dist/cjs/tools/annotation/CobbAngleTool.js.map +1 -1
- package/dist/cjs/tools/annotation/DragProbeTool.js +17 -4
- package/dist/cjs/tools/annotation/DragProbeTool.js.map +1 -1
- package/dist/cjs/tools/annotation/EllipticalROITool.d.ts +2 -4
- package/dist/cjs/tools/annotation/EllipticalROITool.js +67 -61
- package/dist/cjs/tools/annotation/EllipticalROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/LengthTool.d.ts +0 -1
- package/dist/cjs/tools/annotation/LengthTool.js +27 -12
- package/dist/cjs/tools/annotation/LengthTool.js.map +1 -1
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.d.ts +1 -3
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js +72 -60
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/ProbeTool.d.ts +1 -3
- package/dist/cjs/tools/annotation/ProbeTool.js +28 -22
- package/dist/cjs/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/cjs/tools/annotation/RectangleROITool.d.ts +1 -2
- package/dist/cjs/tools/annotation/RectangleROITool.js +55 -57
- package/dist/cjs/tools/annotation/RectangleROITool.js.map +1 -1
- package/dist/cjs/tools/base/AnnotationDisplayTool.js +4 -0
- package/dist/cjs/tools/base/AnnotationDisplayTool.js.map +1 -1
- package/dist/cjs/tools/base/AnnotationTool.d.ts +3 -2
- package/dist/cjs/tools/base/AnnotationTool.js +27 -16
- package/dist/cjs/tools/base/AnnotationTool.js.map +1 -1
- package/dist/cjs/tools/base/index.d.ts +2 -1
- package/dist/cjs/tools/base/index.js +3 -1
- package/dist/cjs/tools/base/index.js.map +1 -1
- package/dist/cjs/tools/displayTools/Contour/contourDisplay.js +3 -0
- package/dist/cjs/tools/displayTools/Contour/contourDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/removeLabelmapFromElement.js +3 -0
- package/dist/cjs/tools/displayTools/Labelmap/removeLabelmapFromElement.js.map +1 -1
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js +5 -6
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/cjs/tools/index.d.ts +5 -2
- package/dist/cjs/tools/index.js +8 -1
- package/dist/cjs/tools/index.js.map +1 -1
- package/dist/cjs/tools/segmentation/BrushTool.js +24 -17
- package/dist/cjs/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/PaintFillTool.js +4 -2
- package/dist/cjs/tools/segmentation/PaintFillTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/eraseSphere.d.ts +2 -0
- package/dist/cjs/tools/segmentation/strategies/eraseSphere.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/fillCircle.js +5 -7
- package/dist/cjs/tools/segmentation/strategies/fillCircle.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/fillSphere.d.ts +3 -0
- package/dist/cjs/tools/segmentation/strategies/fillSphere.js +38 -10
- package/dist/cjs/tools/segmentation/strategies/fillSphere.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/utils/isWithinThreshold.d.ts +3 -0
- package/dist/cjs/tools/segmentation/strategies/utils/isWithinThreshold.js +10 -0
- package/dist/cjs/tools/segmentation/strategies/utils/isWithinThreshold.js.map +1 -0
- package/dist/cjs/types/CINETypes.d.ts +2 -0
- package/dist/cjs/types/CalculatorTypes.d.ts +6 -0
- package/dist/cjs/types/CalculatorTypes.js +3 -0
- package/dist/cjs/types/CalculatorTypes.js.map +1 -0
- package/dist/cjs/types/EventTypes.d.ts +16 -1
- package/dist/cjs/types/ISetToolModeOptions.d.ts +2 -2
- package/dist/cjs/types/IToolGroup.d.ts +6 -2
- package/dist/cjs/types/ToolAction.d.ts +8 -0
- package/dist/cjs/types/ToolAction.js +3 -0
- package/dist/cjs/types/ToolAction.js.map +1 -0
- package/dist/cjs/types/ToolProps.d.ts +5 -1
- package/dist/cjs/types/ToolSpecificAnnotationTypes.d.ts +55 -0
- package/dist/cjs/types/index.d.ts +4 -2
- package/dist/cjs/utilities/cine/playClip.js +13 -3
- package/dist/cjs/utilities/cine/playClip.js.map +1 -1
- package/dist/cjs/utilities/dynamicVolume/getDataInTime.js +7 -4
- package/dist/cjs/utilities/dynamicVolume/getDataInTime.js.map +1 -1
- package/dist/cjs/utilities/getCalibratedUnits.js +10 -5
- package/dist/cjs/utilities/getCalibratedUnits.js.map +1 -1
- package/dist/cjs/utilities/getModalityUnit.js +5 -2
- package/dist/cjs/utilities/getModalityUnit.js.map +1 -1
- package/dist/cjs/utilities/index.d.ts +2 -2
- package/dist/cjs/utilities/index.js +4 -3
- package/dist/cjs/utilities/index.js.map +1 -1
- package/dist/cjs/utilities/math/angle/angleBetweenLines.d.ts +3 -1
- package/dist/cjs/utilities/math/angle/angleBetweenLines.js +18 -1
- package/dist/cjs/utilities/math/angle/angleBetweenLines.js.map +1 -1
- package/dist/cjs/utilities/math/basic/BasicStatsCalculator.d.ts +14 -0
- package/dist/cjs/utilities/math/basic/BasicStatsCalculator.js +44 -0
- package/dist/cjs/utilities/math/basic/BasicStatsCalculator.js.map +1 -0
- package/dist/cjs/utilities/math/basic/Calculator.d.ts +8 -0
- package/dist/cjs/utilities/math/basic/Calculator.js +6 -0
- package/dist/cjs/utilities/math/basic/Calculator.js.map +1 -0
- package/dist/cjs/utilities/math/basic/index.d.ts +3 -0
- package/dist/cjs/utilities/math/basic/index.js +11 -0
- package/dist/cjs/utilities/math/basic/index.js.map +1 -0
- package/dist/cjs/utilities/math/index.d.ts +2 -1
- package/dist/cjs/utilities/math/index.js +3 -1
- package/dist/cjs/utilities/math/index.js.map +1 -1
- package/dist/cjs/utilities/math/midPoint.js +2 -1
- package/dist/cjs/utilities/math/midPoint.js.map +1 -1
- package/dist/cjs/utilities/math/polyline/pointInPolyline.js +2 -1
- package/dist/cjs/utilities/math/polyline/pointInPolyline.js.map +1 -1
- package/dist/cjs/utilities/math/vec2/liangBarksyClip.d.ts +1 -1
- package/dist/cjs/utilities/math/vec2/liangBarksyClip.js +10 -5
- package/dist/cjs/utilities/math/vec2/liangBarksyClip.js.map +1 -1
- package/dist/cjs/utilities/pointInShapeCallback.d.ts +7 -1
- package/dist/cjs/utilities/pointInShapeCallback.js +6 -1
- package/dist/cjs/utilities/pointInShapeCallback.js.map +1 -1
- package/dist/cjs/utilities/roundNumber.js +4 -2
- package/dist/cjs/utilities/roundNumber.js.map +1 -1
- package/dist/cjs/utilities/segmentation/brushSizeForToolGroup.d.ts +2 -2
- package/dist/cjs/utilities/segmentation/brushSizeForToolGroup.js +4 -4
- package/dist/cjs/utilities/segmentation/brushSizeForToolGroup.js.map +1 -1
- package/dist/cjs/utilities/segmentation/thresholdVolumeByRange.js +2 -1
- package/dist/cjs/utilities/segmentation/thresholdVolumeByRange.js.map +1 -1
- package/dist/cjs/utilities/segmentation/utilities.d.ts +1 -2
- package/dist/cjs/utilities/segmentation/utilities.js +4 -1
- package/dist/cjs/utilities/segmentation/utilities.js.map +1 -1
- package/dist/cjs/utilities/stackPrefetch/index.d.ts +3 -2
- package/dist/cjs/utilities/stackPrefetch/index.js +8 -6
- package/dist/cjs/utilities/stackPrefetch/index.js.map +1 -1
- package/dist/cjs/utilities/stackPrefetch/stackContextPrefetch.d.ts +16 -0
- package/dist/cjs/utilities/stackPrefetch/stackContextPrefetch.js +227 -0
- package/dist/cjs/utilities/stackPrefetch/stackContextPrefetch.js.map +1 -0
- package/dist/cjs/utilities/stackPrefetch/stackPrefetch.d.ts +7 -1
- package/dist/cjs/utilities/stackPrefetch/stackPrefetch.js +25 -95
- package/dist/cjs/utilities/stackPrefetch/stackPrefetch.js.map +1 -1
- package/dist/cjs/utilities/stackPrefetch/stackPrefetchUtils.d.ts +14 -0
- package/dist/cjs/utilities/stackPrefetch/stackPrefetchUtils.js +85 -0
- package/dist/cjs/utilities/stackPrefetch/stackPrefetchUtils.js.map +1 -0
- package/dist/esm/drawingSvg/drawCircle.js +9 -5
- package/dist/esm/drawingSvg/drawCircle.js.map +1 -1
- package/dist/esm/drawingSvg/drawEllipse.js +4 -4
- package/dist/esm/drawingSvg/drawEllipse.js.map +1 -1
- package/dist/esm/drawingSvg/drawHandles.js +4 -4
- package/dist/esm/drawingSvg/drawHandles.js.map +1 -1
- package/dist/esm/drawingSvg/drawLine.js +4 -4
- package/dist/esm/drawingSvg/drawLine.js.map +1 -1
- package/dist/esm/drawingSvg/drawPolyline.js +4 -4
- package/dist/esm/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/esm/drawingSvg/drawRect.js +4 -4
- package/dist/esm/drawingSvg/drawRect.js.map +1 -1
- package/dist/esm/drawingSvg/drawTextBox.js +4 -4
- package/dist/esm/drawingSvg/drawTextBox.js.map +1 -1
- package/dist/esm/drawingSvg/getSvgDrawingHelper.js +1 -1
- package/dist/esm/drawingSvg/getSvgDrawingHelper.js.map +1 -1
- package/dist/esm/drawingSvg/index.d.ts +3 -1
- package/dist/esm/drawingSvg/index.js +3 -1
- package/dist/esm/drawingSvg/index.js.map +1 -1
- package/dist/esm/drawingSvg/setAttributesIfNecessary.d.ts +2 -0
- package/dist/esm/drawingSvg/{_setAttributesIfNecessary.js → setAttributesIfNecessary.js} +3 -3
- package/dist/esm/drawingSvg/setAttributesIfNecessary.js.map +1 -0
- package/dist/esm/drawingSvg/setNewAttributesIfValid.d.ts +2 -0
- package/dist/esm/drawingSvg/{_setNewAttributesIfValid.js → setNewAttributesIfValid.js} +3 -3
- package/dist/esm/drawingSvg/setNewAttributesIfValid.js.map +1 -0
- package/dist/esm/enums/Events.d.ts +2 -0
- package/dist/esm/enums/Events.js +2 -0
- package/dist/esm/enums/Events.js.map +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.js +6 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.js.map +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.d.ts +2 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.js +35 -0
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.js.map +1 -0
- package/dist/esm/eventDispatchers/shared/getMouseModifier.js +10 -5
- package/dist/esm/eventDispatchers/shared/getMouseModifier.js.map +1 -1
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.d.ts +3 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.js +32 -0
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.js.map +1 -0
- package/dist/esm/eventListeners/keyboard/keyDownListener.js +8 -0
- package/dist/esm/eventListeners/keyboard/keyDownListener.js.map +1 -1
- package/dist/esm/eventListeners/mouse/mouseDownListener.js +7 -2
- package/dist/esm/eventListeners/mouse/mouseDownListener.js.map +1 -1
- package/dist/esm/eventListeners/mouse/mouseMoveListener.js +5 -1
- package/dist/esm/eventListeners/mouse/mouseMoveListener.js.map +1 -1
- package/dist/esm/eventListeners/touch/touchStartListener.js +10 -5
- package/dist/esm/eventListeners/touch/touchStartListener.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js +1 -0
- package/dist/esm/stateManagement/annotation/config/ToolStyle.js.map +1 -1
- package/dist/esm/stateManagement/annotation/config/getState.js +6 -3
- package/dist/esm/stateManagement/annotation/config/getState.js.map +1 -1
- package/dist/esm/stateManagement/annotation/config/helpers.js +4 -2
- package/dist/esm/stateManagement/annotation/config/helpers.js.map +1 -1
- package/dist/esm/store/SynchronizerManager/Synchronizer.js +10 -2
- package/dist/esm/store/SynchronizerManager/Synchronizer.js.map +1 -1
- package/dist/esm/store/ToolGroupManager/ToolGroup.d.ts +5 -3
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +45 -4
- package/dist/esm/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.js +2 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.js.map +1 -1
- package/dist/esm/synchronizers/callbacks/stackImageSyncCallback.js +26 -23
- package/dist/esm/synchronizers/callbacks/stackImageSyncCallback.js.map +1 -1
- package/dist/esm/synchronizers/callbacks/voiSyncCallback.js +1 -1
- package/dist/esm/synchronizers/callbacks/voiSyncCallback.js.map +1 -1
- package/dist/esm/tools/AdvancedMagnifyTool.d.ts +36 -0
- package/dist/esm/tools/AdvancedMagnifyTool.js +440 -0
- package/dist/esm/tools/AdvancedMagnifyTool.js.map +1 -0
- package/dist/esm/tools/AdvancedMagnifyViewport.d.ts +76 -0
- package/dist/esm/tools/AdvancedMagnifyViewport.js +346 -0
- package/dist/esm/tools/AdvancedMagnifyViewport.js.map +1 -0
- package/dist/esm/tools/AdvancedMagnifyViewportManager.d.ts +36 -0
- package/dist/esm/tools/AdvancedMagnifyViewportManager.js +128 -0
- package/dist/esm/tools/AdvancedMagnifyViewportManager.js.map +1 -0
- package/dist/esm/tools/MIPJumpToClickTool.js +4 -2
- package/dist/esm/tools/MIPJumpToClickTool.js.map +1 -1
- package/dist/esm/tools/MagnifyTool.js +2 -2
- package/dist/esm/tools/MagnifyTool.js.map +1 -1
- package/dist/esm/tools/OrientationMarkerTool.d.ts +88 -0
- package/dist/esm/tools/OrientationMarkerTool.js +185 -0
- package/dist/esm/tools/OrientationMarkerTool.js.map +1 -0
- package/dist/esm/tools/OverlayGridTool.d.ts +31 -0
- package/dist/esm/tools/OverlayGridTool.js +165 -0
- package/dist/esm/tools/OverlayGridTool.js.map +1 -0
- package/dist/esm/tools/PlanarRotateTool.js +2 -1
- package/dist/esm/tools/PlanarRotateTool.js.map +1 -1
- package/dist/esm/tools/ReferenceCursors.js +58 -29
- package/dist/esm/tools/ReferenceCursors.js.map +1 -1
- package/dist/esm/tools/ReferenceLinesTool.d.ts +3 -0
- package/dist/esm/tools/ReferenceLinesTool.js +71 -2
- package/dist/esm/tools/ReferenceLinesTool.js.map +1 -1
- package/dist/esm/tools/ScaleOverlayTool.js +2 -1
- package/dist/esm/tools/ScaleOverlayTool.js.map +1 -1
- package/dist/esm/tools/annotation/AngleTool.d.ts +0 -1
- package/dist/esm/tools/annotation/AngleTool.js +33 -15
- package/dist/esm/tools/annotation/AngleTool.js.map +1 -1
- package/dist/esm/tools/annotation/ArrowAnnotateTool.js +15 -1
- package/dist/esm/tools/annotation/ArrowAnnotateTool.js.map +1 -1
- package/dist/esm/tools/annotation/BidirectionalTool.d.ts +0 -1
- package/dist/esm/tools/annotation/BidirectionalTool.js +30 -15
- package/dist/esm/tools/annotation/BidirectionalTool.js.map +1 -1
- package/dist/esm/tools/annotation/CircleROITool.d.ts +1 -3
- package/dist/esm/tools/annotation/CircleROITool.js +62 -60
- package/dist/esm/tools/annotation/CircleROITool.js.map +1 -1
- package/dist/esm/tools/annotation/CobbAngleTool.d.ts +31 -6
- package/dist/esm/tools/annotation/CobbAngleTool.js +301 -83
- package/dist/esm/tools/annotation/CobbAngleTool.js.map +1 -1
- package/dist/esm/tools/annotation/DragProbeTool.js +17 -4
- package/dist/esm/tools/annotation/DragProbeTool.js.map +1 -1
- package/dist/esm/tools/annotation/EllipticalROITool.d.ts +2 -4
- package/dist/esm/tools/annotation/EllipticalROITool.js +66 -61
- package/dist/esm/tools/annotation/EllipticalROITool.js.map +1 -1
- package/dist/esm/tools/annotation/LengthTool.d.ts +0 -1
- package/dist/esm/tools/annotation/LengthTool.js +27 -12
- package/dist/esm/tools/annotation/LengthTool.js.map +1 -1
- package/dist/esm/tools/annotation/PlanarFreehandROITool.d.ts +1 -3
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +71 -60
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/esm/tools/annotation/ProbeTool.d.ts +1 -3
- package/dist/esm/tools/annotation/ProbeTool.js +28 -22
- package/dist/esm/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/esm/tools/annotation/RectangleROITool.d.ts +1 -2
- package/dist/esm/tools/annotation/RectangleROITool.js +54 -57
- package/dist/esm/tools/annotation/RectangleROITool.js.map +1 -1
- package/dist/esm/tools/base/AnnotationDisplayTool.js +3 -0
- package/dist/esm/tools/base/AnnotationDisplayTool.js.map +1 -1
- package/dist/esm/tools/base/AnnotationTool.d.ts +3 -2
- package/dist/esm/tools/base/AnnotationTool.js +26 -16
- package/dist/esm/tools/base/AnnotationTool.js.map +1 -1
- package/dist/esm/tools/base/index.d.ts +2 -1
- package/dist/esm/tools/base/index.js +2 -1
- package/dist/esm/tools/base/index.js.map +1 -1
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js +4 -1
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/removeLabelmapFromElement.js +4 -1
- package/dist/esm/tools/displayTools/Labelmap/removeLabelmapFromElement.js.map +1 -1
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js +5 -6
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/esm/tools/index.d.ts +5 -2
- package/dist/esm/tools/index.js +5 -2
- package/dist/esm/tools/index.js.map +1 -1
- package/dist/esm/tools/segmentation/BrushTool.js +25 -18
- package/dist/esm/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/esm/tools/segmentation/PaintFillTool.js +4 -2
- package/dist/esm/tools/segmentation/PaintFillTool.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/eraseSphere.d.ts +2 -0
- package/dist/esm/tools/segmentation/strategies/eraseSphere.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/fillCircle.js +1 -6
- package/dist/esm/tools/segmentation/strategies/fillCircle.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/fillSphere.d.ts +3 -0
- package/dist/esm/tools/segmentation/strategies/fillSphere.js +33 -9
- package/dist/esm/tools/segmentation/strategies/fillSphere.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.d.ts +3 -0
- package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.js +8 -0
- package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.js.map +1 -0
- package/dist/esm/types/CINETypes.d.ts +2 -0
- package/dist/esm/types/CalculatorTypes.d.ts +6 -0
- package/dist/esm/types/CalculatorTypes.js +2 -0
- package/dist/esm/types/CalculatorTypes.js.map +1 -0
- package/dist/esm/types/EventTypes.d.ts +16 -1
- package/dist/esm/types/ISetToolModeOptions.d.ts +2 -2
- package/dist/esm/types/IToolGroup.d.ts +6 -2
- package/dist/esm/types/ToolAction.d.ts +8 -0
- package/dist/esm/types/ToolAction.js +2 -0
- package/dist/esm/types/ToolAction.js.map +1 -0
- package/dist/esm/types/ToolProps.d.ts +5 -1
- package/dist/esm/types/ToolSpecificAnnotationTypes.d.ts +55 -0
- package/dist/esm/types/index.d.ts +4 -2
- package/dist/esm/utilities/cine/playClip.js +13 -4
- package/dist/esm/utilities/cine/playClip.js.map +1 -1
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js +7 -4
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js.map +1 -1
- package/dist/esm/utilities/getCalibratedUnits.js +10 -5
- package/dist/esm/utilities/getCalibratedUnits.js.map +1 -1
- package/dist/esm/utilities/getModalityUnit.js +5 -2
- package/dist/esm/utilities/getModalityUnit.js.map +1 -1
- package/dist/esm/utilities/index.d.ts +2 -2
- package/dist/esm/utilities/index.js +2 -2
- package/dist/esm/utilities/index.js.map +1 -1
- package/dist/esm/utilities/math/angle/angleBetweenLines.d.ts +3 -1
- package/dist/esm/utilities/math/angle/angleBetweenLines.js +19 -2
- package/dist/esm/utilities/math/angle/angleBetweenLines.js.map +1 -1
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.d.ts +14 -0
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.js +36 -0
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.js.map +1 -0
- package/dist/esm/utilities/math/basic/Calculator.d.ts +8 -0
- package/dist/esm/utilities/math/basic/Calculator.js +4 -0
- package/dist/esm/utilities/math/basic/Calculator.js.map +1 -0
- package/dist/esm/utilities/math/basic/index.d.ts +3 -0
- package/dist/esm/utilities/math/basic/index.js +4 -0
- package/dist/esm/utilities/math/basic/index.js.map +1 -0
- package/dist/esm/utilities/math/index.d.ts +2 -1
- package/dist/esm/utilities/math/index.js +2 -1
- package/dist/esm/utilities/math/index.js.map +1 -1
- package/dist/esm/utilities/math/midPoint.js +2 -1
- package/dist/esm/utilities/math/midPoint.js.map +1 -1
- package/dist/esm/utilities/math/polyline/pointInPolyline.js +2 -1
- package/dist/esm/utilities/math/polyline/pointInPolyline.js.map +1 -1
- package/dist/esm/utilities/math/vec2/liangBarksyClip.d.ts +1 -1
- package/dist/esm/utilities/math/vec2/liangBarksyClip.js +10 -5
- package/dist/esm/utilities/math/vec2/liangBarksyClip.js.map +1 -1
- package/dist/esm/utilities/pointInShapeCallback.d.ts +7 -1
- package/dist/esm/utilities/pointInShapeCallback.js +6 -1
- package/dist/esm/utilities/pointInShapeCallback.js.map +1 -1
- package/dist/esm/utilities/roundNumber.js +4 -2
- package/dist/esm/utilities/roundNumber.js.map +1 -1
- package/dist/esm/utilities/segmentation/brushSizeForToolGroup.d.ts +2 -2
- package/dist/esm/utilities/segmentation/brushSizeForToolGroup.js +4 -4
- package/dist/esm/utilities/segmentation/brushSizeForToolGroup.js.map +1 -1
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js +2 -1
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js.map +1 -1
- package/dist/esm/utilities/segmentation/utilities.d.ts +1 -2
- package/dist/esm/utilities/segmentation/utilities.js +4 -1
- package/dist/esm/utilities/segmentation/utilities.js.map +1 -1
- package/dist/esm/utilities/stackPrefetch/index.d.ts +3 -2
- package/dist/esm/utilities/stackPrefetch/index.js +3 -2
- package/dist/esm/utilities/stackPrefetch/index.js.map +1 -1
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.d.ts +16 -0
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.js +220 -0
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.js.map +1 -0
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.d.ts +7 -1
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.js +14 -81
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.js.map +1 -1
- package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.d.ts +14 -0
- package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.js +77 -0
- package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.js.map +1 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/drawingSvg/drawCircle.ts +17 -5
- package/src/drawingSvg/drawEllipse.ts +4 -4
- package/src/drawingSvg/drawHandles.ts +4 -4
- package/src/drawingSvg/drawLine.ts +4 -4
- package/src/drawingSvg/drawPolyline.ts +4 -4
- package/src/drawingSvg/drawRect.ts +4 -4
- package/src/drawingSvg/drawTextBox.ts +4 -4
- package/src/drawingSvg/getSvgDrawingHelper.ts +4 -1
- package/src/drawingSvg/index.ts +4 -0
- package/src/drawingSvg/{_setAttributesIfNecessary.ts → setAttributesIfNecessary.ts} +2 -2
- package/src/drawingSvg/{_setNewAttributesIfValid.ts → setNewAttributesIfValid.ts} +2 -2
- package/src/enums/Events.ts +22 -0
- package/src/eventDispatchers/mouseEventHandlers/mouseDown.ts +11 -2
- package/src/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.ts +72 -0
- package/src/eventDispatchers/shared/getMouseModifier.ts +15 -5
- package/src/eventDispatchers/shared/getToolsWithActionsForMouseEvent.ts +66 -0
- package/src/eventListeners/keyboard/keyDownListener.ts +13 -0
- package/src/eventListeners/mouse/mouseDownListener.ts +10 -2
- package/src/eventListeners/mouse/mouseMoveListener.ts +7 -1
- package/src/eventListeners/touch/touchStartListener.ts +15 -5
- package/src/index.ts +8 -0
- package/src/stateManagement/annotation/config/ToolStyle.ts +1 -0
- package/src/stateManagement/annotation/config/getState.ts +7 -3
- package/src/stateManagement/annotation/config/helpers.ts +6 -2
- package/src/store/SynchronizerManager/Synchronizer.ts +16 -8
- package/src/store/ToolGroupManager/ToolGroup.ts +99 -6
- package/src/store/ToolGroupManager/getToolGroupsWithToolName.ts +3 -1
- package/src/synchronizers/callbacks/stackImageSyncCallback.ts +63 -68
- package/src/synchronizers/callbacks/voiSyncCallback.ts +1 -1
- package/src/tools/AdvancedMagnifyTool.ts +725 -0
- package/src/tools/AdvancedMagnifyViewport.ts +624 -0
- package/src/tools/AdvancedMagnifyViewportManager.ts +291 -0
- package/src/tools/MIPJumpToClickTool.ts +6 -2
- package/src/tools/MagnifyTool.ts +2 -2
- package/src/tools/OrientationMarkerTool.ts +235 -0
- package/src/tools/OverlayGridTool.ts +357 -0
- package/src/tools/PlanarRotateTool.ts +3 -1
- package/src/tools/ReferenceCursors.ts +85 -29
- package/src/tools/ReferenceLinesTool.ts +131 -3
- package/src/tools/ScaleOverlayTool.ts +3 -1
- package/src/tools/annotation/AngleTool.ts +42 -20
- package/src/tools/annotation/ArrowAnnotateTool.ts +16 -1
- package/src/tools/annotation/BidirectionalTool.ts +38 -24
- package/src/tools/annotation/CircleROITool.ts +94 -107
- package/src/tools/annotation/CobbAngleTool.ts +452 -114
- package/src/tools/annotation/DragProbeTool.ts +25 -14
- package/src/tools/annotation/EllipticalROITool.ts +88 -97
- package/src/tools/annotation/LengthTool.ts +33 -18
- package/src/tools/annotation/PlanarFreehandROITool.ts +90 -78
- package/src/tools/annotation/ProbeTool.ts +43 -49
- package/src/tools/annotation/RectangleROITool.ts +80 -92
- package/src/tools/base/AnnotationDisplayTool.ts +4 -0
- package/src/tools/base/AnnotationTool.ts +41 -18
- package/src/tools/base/index.ts +2 -1
- package/src/tools/displayTools/Contour/contourDisplay.ts +8 -0
- package/src/tools/displayTools/Labelmap/labelmapDisplay.ts +4 -1
- package/src/tools/displayTools/Labelmap/removeLabelmapFromElement.ts +6 -1
- package/src/tools/displayTools/SegmentationDisplayTool.ts +12 -18
- package/src/tools/index.ts +8 -1
- package/src/tools/segmentation/BrushTool.ts +42 -19
- package/src/tools/segmentation/PaintFillTool.ts +10 -3
- package/src/tools/segmentation/strategies/eraseSphere.ts +2 -0
- package/src/tools/segmentation/strategies/fillCircle.ts +1 -13
- package/src/tools/segmentation/strategies/fillSphere.ts +56 -8
- package/src/tools/segmentation/strategies/utils/isWithinThreshold.ts +16 -0
- package/src/types/CINETypes.ts +8 -2
- package/src/types/CalculatorTypes.ts +7 -0
- package/src/types/EventTypes.ts +43 -0
- package/src/types/ISetToolModeOptions.ts +2 -2
- package/src/types/IToolGroup.ts +13 -3
- package/src/types/ToolAction.ts +54 -0
- package/src/types/ToolProps.ts +7 -1
- package/src/types/ToolSpecificAnnotationTypes.ts +58 -0
- package/src/types/index.ts +11 -1
- package/src/utilities/cine/playClip.ts +20 -3
- package/src/utilities/dynamicVolume/getDataInTime.ts +9 -6
- package/src/utilities/getCalibratedUnits.ts +15 -5
- package/src/utilities/getModalityUnit.ts +8 -2
- package/src/utilities/index.ts +2 -1
- package/src/utilities/math/angle/angleBetweenLines.ts +39 -9
- package/src/utilities/math/basic/BasicStatsCalculator.ts +60 -0
- package/src/utilities/math/basic/Calculator.ts +8 -0
- package/src/utilities/math/basic/index.ts +4 -0
- package/src/utilities/math/index.ts +10 -1
- package/src/utilities/math/midPoint.ts +3 -1
- package/src/utilities/math/polyline/pointInPolyline.ts +3 -1
- package/src/utilities/math/vec2/liangBarksyClip.ts +15 -5
- package/src/utilities/pointInShapeCallback.ts +15 -3
- package/src/utilities/roundNumber.ts +6 -2
- package/src/utilities/segmentation/brushSizeForToolGroup.ts +22 -4
- package/src/utilities/segmentation/thresholdVolumeByRange.ts +3 -1
- package/src/utilities/segmentation/utilities.ts +8 -1
- package/src/utilities/stackPrefetch/index.ts +3 -7
- package/src/utilities/stackPrefetch/stackContextPrefetch.ts +380 -0
- package/src/utilities/stackPrefetch/stackPrefetch.ts +37 -153
- package/src/utilities/stackPrefetch/stackPrefetchUtils.ts +114 -0
- package/dist/cjs/drawingSvg/_setAttributesIfNecessary.d.ts +0 -2
- package/dist/cjs/drawingSvg/_setAttributesIfNecessary.js.map +0 -1
- package/dist/cjs/drawingSvg/_setNewAttributesIfValid.d.ts +0 -2
- package/dist/cjs/drawingSvg/_setNewAttributesIfValid.js.map +0 -1
- package/dist/esm/drawingSvg/_setAttributesIfNecessary.d.ts +0 -2
- package/dist/esm/drawingSvg/_setAttributesIfNecessary.js.map +0 -1
- package/dist/esm/drawingSvg/_setNewAttributesIfValid.d.ts +0 -2
- package/dist/esm/drawingSvg/_setNewAttributesIfValid.js.map +0 -1
|
@@ -168,7 +168,9 @@ function touchStartListener(evt: TouchEvent) {
|
|
|
168
168
|
state.renderingEngineId = renderingEngineId;
|
|
169
169
|
state.viewportId = viewportId;
|
|
170
170
|
// this prevents multiple start firing
|
|
171
|
-
if (state.isTouchStart)
|
|
171
|
+
if (state.isTouchStart) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
172
174
|
// this will clear on touchstart and touchend
|
|
173
175
|
clearTimeout(state.pressTimeout);
|
|
174
176
|
state.pressTimeout = setTimeout(() => _onTouchPress(evt), state.pressDelay);
|
|
@@ -187,7 +189,9 @@ function touchStartListener(evt: TouchEvent) {
|
|
|
187
189
|
*/
|
|
188
190
|
function _onTouchPress(evt: TouchEvent) {
|
|
189
191
|
const totalDistance = state.accumulatedDistance.canvas;
|
|
190
|
-
if (totalDistance > state.pressMaxDistance)
|
|
192
|
+
if (totalDistance > state.pressMaxDistance) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
191
195
|
const eventDetail: EventTypes.TouchPressEventDetail = {
|
|
192
196
|
event: evt, // touchstart native event
|
|
193
197
|
eventName: TOUCH_PRESS,
|
|
@@ -384,7 +388,9 @@ function _onTouchEnd(evt: TouchEvent): void {
|
|
|
384
388
|
function _checkTouchTap(evt: TouchEvent): void {
|
|
385
389
|
const currentTime = new Date().getTime();
|
|
386
390
|
const startTime = state.startTime.getTime();
|
|
387
|
-
if (currentTime - startTime > tapState.tapToleranceMs)
|
|
391
|
+
if (currentTime - startTime > tapState.tapToleranceMs) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
388
394
|
|
|
389
395
|
// first tap, initialize the state
|
|
390
396
|
if (tapState.taps === 0) {
|
|
@@ -422,7 +428,9 @@ function _checkTouchTap(evt: TouchEvent): void {
|
|
|
422
428
|
// region where the user has the option to perform unlimited multitaps as long
|
|
423
429
|
// as they are < the tapToleranceMs value. So a tap somewhere else on the screen
|
|
424
430
|
// that is > the tapMaxDistance will start a separate and new "TapChain".
|
|
425
|
-
if (distanceFromStart > tapState.tapMaxDistance)
|
|
431
|
+
if (distanceFromStart > tapState.tapMaxDistance) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
426
434
|
|
|
427
435
|
clearTimeout(tapState.tapTimeout);
|
|
428
436
|
tapState.taps += 1;
|
|
@@ -447,7 +455,9 @@ function _checkTouchTap(evt: TouchEvent): void {
|
|
|
447
455
|
function _checkTouchSwipe(evt: TouchEvent, deltaPoints: IPoints) {
|
|
448
456
|
const currentTime = new Date().getTime();
|
|
449
457
|
const startTime = state.startTime.getTime();
|
|
450
|
-
if (state.swiped || currentTime - startTime > state.swipeToleranceMs)
|
|
458
|
+
if (state.swiped || currentTime - startTime > state.swipeToleranceMs) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
451
461
|
const [x, y] = deltaPoints.canvas;
|
|
452
462
|
const eventDetail: EventTypes.TouchSwipeEventDetail = {
|
|
453
463
|
event: evt,
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ import * as segmentation from './stateManagement/segmentation';
|
|
|
23
23
|
import {
|
|
24
24
|
BaseTool,
|
|
25
25
|
AnnotationTool,
|
|
26
|
+
AnnotationDisplayTool,
|
|
26
27
|
PanTool,
|
|
27
28
|
TrackballRotateTool,
|
|
28
29
|
DragProbeTool,
|
|
@@ -53,10 +54,13 @@ import {
|
|
|
53
54
|
AngleTool,
|
|
54
55
|
CobbAngleTool,
|
|
55
56
|
MagnifyTool,
|
|
57
|
+
AdvancedMagnifyTool,
|
|
56
58
|
ReferenceCursors,
|
|
57
59
|
ReferenceLines,
|
|
58
60
|
PaintFillTool,
|
|
59
61
|
ScaleOverlayTool,
|
|
62
|
+
OrientationMarkerTool,
|
|
63
|
+
OverlayGridTool,
|
|
60
64
|
} from './tools';
|
|
61
65
|
|
|
62
66
|
import * as Enums from './enums';
|
|
@@ -71,6 +75,7 @@ export {
|
|
|
71
75
|
// Base Tools
|
|
72
76
|
BaseTool,
|
|
73
77
|
AnnotationTool,
|
|
78
|
+
AnnotationDisplayTool,
|
|
74
79
|
// Manipulation Tools
|
|
75
80
|
PanTool,
|
|
76
81
|
TrackballRotateTool,
|
|
@@ -86,6 +91,7 @@ export {
|
|
|
86
91
|
LengthTool,
|
|
87
92
|
CrosshairsTool,
|
|
88
93
|
ReferenceLinesTool,
|
|
94
|
+
OverlayGridTool,
|
|
89
95
|
ProbeTool,
|
|
90
96
|
RectangleROITool,
|
|
91
97
|
EllipticalROITool,
|
|
@@ -96,6 +102,7 @@ export {
|
|
|
96
102
|
AngleTool,
|
|
97
103
|
CobbAngleTool,
|
|
98
104
|
MagnifyTool,
|
|
105
|
+
AdvancedMagnifyTool,
|
|
99
106
|
ReferenceCursors,
|
|
100
107
|
ReferenceLines,
|
|
101
108
|
ScaleOverlayTool,
|
|
@@ -108,6 +115,7 @@ export {
|
|
|
108
115
|
RectangleROIThresholdTool,
|
|
109
116
|
RectangleROIStartEndThresholdTool,
|
|
110
117
|
BrushTool,
|
|
118
|
+
OrientationMarkerTool,
|
|
111
119
|
// Synchronizers
|
|
112
120
|
synchronizers,
|
|
113
121
|
Synchronizer,
|
|
@@ -11,13 +11,17 @@ import { AnnotationStyleStates } from '../../../enums';
|
|
|
11
11
|
*/
|
|
12
12
|
function getState(annotation?: Annotation): AnnotationStyleStates {
|
|
13
13
|
if (annotation) {
|
|
14
|
-
if (annotation.data && annotation.highlighted)
|
|
14
|
+
if (annotation.data && annotation.highlighted) {
|
|
15
15
|
return AnnotationStyleStates.Highlighted;
|
|
16
|
-
|
|
16
|
+
}
|
|
17
|
+
if (isAnnotationSelected(annotation.annotationUID)) {
|
|
17
18
|
return AnnotationStyleStates.Selected;
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
// Todo: make annotation lock api not to rely on the annotation itself
|
|
20
|
-
if (isAnnotationLocked(annotation))
|
|
22
|
+
if (isAnnotationLocked(annotation)) {
|
|
23
|
+
return AnnotationStyleStates.Locked;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
return AnnotationStyleStates.Default;
|
|
@@ -15,8 +15,12 @@ function getHierarchalPropertyStyles(
|
|
|
15
15
|
mode?: ToolModes
|
|
16
16
|
): string[] {
|
|
17
17
|
const list = [`${property}`];
|
|
18
|
-
if (state)
|
|
19
|
-
|
|
18
|
+
if (state) {
|
|
19
|
+
list.push(`${list[0]}${state}`);
|
|
20
|
+
}
|
|
21
|
+
if (mode) {
|
|
22
|
+
list.push(`${list[list.length - 1]}${mode}`);
|
|
23
|
+
}
|
|
20
24
|
return list;
|
|
21
25
|
}
|
|
22
26
|
|
|
@@ -205,6 +205,7 @@ class Synchronizer {
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
this._ignoreFiredEvents = true;
|
|
208
|
+
const promises = [];
|
|
208
209
|
try {
|
|
209
210
|
for (let i = 0; i < this._targetViewports.length; i++) {
|
|
210
211
|
const targetViewport = this._targetViewports[i];
|
|
@@ -214,19 +215,26 @@ class Synchronizer {
|
|
|
214
215
|
if (targetIsSource) {
|
|
215
216
|
continue;
|
|
216
217
|
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
218
|
+
promises.push(
|
|
219
|
+
this._eventHandler(
|
|
220
|
+
this,
|
|
221
|
+
sourceViewport,
|
|
222
|
+
targetViewport,
|
|
223
|
+
sourceEvent,
|
|
224
|
+
this._options
|
|
225
|
+
)
|
|
224
226
|
);
|
|
225
227
|
}
|
|
226
228
|
} catch (ex) {
|
|
227
229
|
console.warn(`Synchronizer, for: ${this._eventName}`, ex);
|
|
228
230
|
} finally {
|
|
229
|
-
|
|
231
|
+
if (promises.length) {
|
|
232
|
+
Promise.allSettled(promises).then(() => {
|
|
233
|
+
this._ignoreFiredEvents = false;
|
|
234
|
+
});
|
|
235
|
+
} else {
|
|
236
|
+
this._ignoreFiredEvents = false;
|
|
237
|
+
}
|
|
230
238
|
}
|
|
231
239
|
}
|
|
232
240
|
|
|
@@ -2,6 +2,8 @@ import { MouseBindings, ToolModes } from '../../enums';
|
|
|
2
2
|
import cloneDeep from 'lodash.clonedeep';
|
|
3
3
|
import get from 'lodash.get';
|
|
4
4
|
import {
|
|
5
|
+
triggerEvent,
|
|
6
|
+
eventTarget,
|
|
5
7
|
getRenderingEngine,
|
|
6
8
|
getRenderingEngines,
|
|
7
9
|
getEnabledElementByIds,
|
|
@@ -9,13 +11,19 @@ import {
|
|
|
9
11
|
utilities as csUtils,
|
|
10
12
|
} from '@cornerstonejs/core';
|
|
11
13
|
import type { Types } from '@cornerstonejs/core';
|
|
12
|
-
import {
|
|
14
|
+
import { Events } from '../../enums';
|
|
15
|
+
import {
|
|
16
|
+
ToolActivatedEventDetail,
|
|
17
|
+
ToolModeChangedEventDetail,
|
|
18
|
+
} from '../../types/EventTypes';
|
|
19
|
+
import { ToolGroupManager, state } from '../index';
|
|
13
20
|
import {
|
|
14
21
|
IToolBinding,
|
|
15
22
|
IToolClassReference,
|
|
16
23
|
IToolGroup,
|
|
17
24
|
SetToolBindingsType,
|
|
18
25
|
ToolOptionsType,
|
|
26
|
+
ToolConfiguration,
|
|
19
27
|
} from '../../types';
|
|
20
28
|
|
|
21
29
|
import { MouseCursor, SVGMouseCursor } from '../../cursors';
|
|
@@ -69,7 +77,7 @@ export default class ToolGroup implements IToolGroup {
|
|
|
69
77
|
const toolInstance = this._toolInstances[toolInstanceName];
|
|
70
78
|
if (!toolInstance) {
|
|
71
79
|
console.warn(
|
|
72
|
-
`'${toolInstanceName}' is not registered with this toolGroup.`
|
|
80
|
+
`'${toolInstanceName}' is not registered with this toolGroup (${this.id}).`
|
|
73
81
|
);
|
|
74
82
|
return;
|
|
75
83
|
}
|
|
@@ -83,9 +91,9 @@ export default class ToolGroup implements IToolGroup {
|
|
|
83
91
|
* to set the tool to be active or passive or in other states.
|
|
84
92
|
*
|
|
85
93
|
* @param toolName - string
|
|
86
|
-
* @param configuration - Tool configuration objects
|
|
94
|
+
* @param configuration - Tool configuration objects and a custom statistics calculator if needed
|
|
87
95
|
*/
|
|
88
|
-
addTool(toolName: string, configuration = {}): void {
|
|
96
|
+
addTool(toolName: string, configuration: ToolConfiguration = {}): void {
|
|
89
97
|
const toolDefinition = state.tools[toolName];
|
|
90
98
|
const hasToolName = typeof toolName !== 'undefined' && toolName !== '';
|
|
91
99
|
const localToolInstance = this.toolOptions[toolName];
|
|
@@ -372,6 +380,15 @@ export default class ToolGroup implements IToolGroup {
|
|
|
372
380
|
toolInstance.onSetToolActive();
|
|
373
381
|
}
|
|
374
382
|
this._renderViewports();
|
|
383
|
+
|
|
384
|
+
const eventDetail: ToolActivatedEventDetail = {
|
|
385
|
+
toolGroupId: this.id,
|
|
386
|
+
toolName,
|
|
387
|
+
toolBindingsOptions,
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
triggerEvent(eventTarget, Events.TOOL_ACTIVATED, eventDetail);
|
|
391
|
+
this._triggerToolModeChangedEvent(toolName, Active, toolBindingsOptions);
|
|
375
392
|
}
|
|
376
393
|
|
|
377
394
|
/**
|
|
@@ -427,6 +444,13 @@ export default class ToolGroup implements IToolGroup {
|
|
|
427
444
|
toolInstance.onSetToolPassive();
|
|
428
445
|
}
|
|
429
446
|
this._renderViewports();
|
|
447
|
+
|
|
448
|
+
// It would make sense to use `toolInstance.mode` as mode when setting a tool
|
|
449
|
+
// as passive because it can still be actived in the end but `Passive` must
|
|
450
|
+
// be used when synchronizing ToolGroups so that other ToolGroups can take the
|
|
451
|
+
// same action (update tool bindings). Should the event have two different modes
|
|
452
|
+
// to handle this special case?
|
|
453
|
+
this._triggerToolModeChangedEvent(toolName, Passive);
|
|
430
454
|
}
|
|
431
455
|
|
|
432
456
|
/**
|
|
@@ -460,6 +484,7 @@ export default class ToolGroup implements IToolGroup {
|
|
|
460
484
|
}
|
|
461
485
|
|
|
462
486
|
this._renderViewports();
|
|
487
|
+
this._triggerToolModeChangedEvent(toolName, Enabled);
|
|
463
488
|
}
|
|
464
489
|
|
|
465
490
|
/**
|
|
@@ -492,6 +517,7 @@ export default class ToolGroup implements IToolGroup {
|
|
|
492
517
|
toolInstance.onSetToolDisabled();
|
|
493
518
|
}
|
|
494
519
|
this._renderViewports();
|
|
520
|
+
this._triggerToolModeChangedEvent(toolName, Disabled);
|
|
495
521
|
}
|
|
496
522
|
|
|
497
523
|
/**
|
|
@@ -593,7 +619,7 @@ export default class ToolGroup implements IToolGroup {
|
|
|
593
619
|
*/
|
|
594
620
|
public setToolConfiguration(
|
|
595
621
|
toolName: string,
|
|
596
|
-
configuration:
|
|
622
|
+
configuration: ToolConfiguration,
|
|
597
623
|
overwrite?: boolean
|
|
598
624
|
): boolean {
|
|
599
625
|
if (this._toolInstances[toolName] === undefined) {
|
|
@@ -608,7 +634,10 @@ export default class ToolGroup implements IToolGroup {
|
|
|
608
634
|
if (overwrite) {
|
|
609
635
|
_configuration = configuration;
|
|
610
636
|
} else {
|
|
611
|
-
|
|
637
|
+
// We should not deep copy here, it is the job of the application to
|
|
638
|
+
// deep copy the configuration before passing it to the toolGroup, otherwise
|
|
639
|
+
// some strange appending behaviour happens for the arrays
|
|
640
|
+
_configuration = Object.assign(
|
|
612
641
|
this._toolInstances[toolName].configuration,
|
|
613
642
|
configuration
|
|
614
643
|
);
|
|
@@ -653,6 +682,49 @@ export default class ToolGroup implements IToolGroup {
|
|
|
653
682
|
return cloneDeep(_configuration);
|
|
654
683
|
}
|
|
655
684
|
|
|
685
|
+
/**
|
|
686
|
+
*
|
|
687
|
+
* @param newToolGroupId - Id of the new (clone) tool group
|
|
688
|
+
* @param fnToolFilter - Function to filter which tools from this tool group
|
|
689
|
+
* should be added to the new (clone) one. Example: only annotations tools
|
|
690
|
+
* can be filtered and added to the new tool group.
|
|
691
|
+
* @returns A new tool group that is a clone of this one
|
|
692
|
+
*/
|
|
693
|
+
public clone(
|
|
694
|
+
newToolGroupId,
|
|
695
|
+
fnToolFilter: (toolName: string) => void = null
|
|
696
|
+
): IToolGroup {
|
|
697
|
+
let toolGroup = ToolGroupManager.getToolGroup(newToolGroupId);
|
|
698
|
+
|
|
699
|
+
if (toolGroup) {
|
|
700
|
+
console.warn(`ToolGroup ${newToolGroupId} already exists`);
|
|
701
|
+
return toolGroup;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
toolGroup = ToolGroupManager.createToolGroup(newToolGroupId);
|
|
705
|
+
fnToolFilter = fnToolFilter ?? (() => true);
|
|
706
|
+
|
|
707
|
+
Object.keys(this._toolInstances)
|
|
708
|
+
.filter(fnToolFilter)
|
|
709
|
+
.forEach((toolName) => {
|
|
710
|
+
const sourceToolInstance = this._toolInstances[toolName];
|
|
711
|
+
const sourceToolOptions = this.toolOptions[toolName];
|
|
712
|
+
const sourceToolMode = sourceToolInstance.mode;
|
|
713
|
+
|
|
714
|
+
toolGroup.addTool(toolName);
|
|
715
|
+
|
|
716
|
+
(toolGroup as unknown as ToolGroup).setToolMode(
|
|
717
|
+
toolName,
|
|
718
|
+
sourceToolMode,
|
|
719
|
+
{
|
|
720
|
+
bindings: sourceToolOptions.bindings ?? [],
|
|
721
|
+
}
|
|
722
|
+
);
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
return toolGroup;
|
|
726
|
+
}
|
|
727
|
+
|
|
656
728
|
/**
|
|
657
729
|
* Check if the tool binding is set to be primary mouse button.
|
|
658
730
|
* @param toolOptions - The options for the tool mode.
|
|
@@ -676,6 +748,27 @@ export default class ToolGroup implements IToolGroup {
|
|
|
676
748
|
getRenderingEngine(renderingEngineId).renderViewport(viewportId);
|
|
677
749
|
});
|
|
678
750
|
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Trigger ToolModeChangedEvent when changing the tool mode
|
|
754
|
+
* @param toolName - Tool name
|
|
755
|
+
* @param mode - Tool mode
|
|
756
|
+
* @param toolBindingsOptions - Binding options used when a tool is activated
|
|
757
|
+
*/
|
|
758
|
+
private _triggerToolModeChangedEvent(
|
|
759
|
+
toolName: string,
|
|
760
|
+
mode: ToolModes,
|
|
761
|
+
toolBindingsOptions?: SetToolBindingsType
|
|
762
|
+
): void {
|
|
763
|
+
const eventDetail: ToolModeChangedEventDetail = {
|
|
764
|
+
toolGroupId: this.id,
|
|
765
|
+
toolName,
|
|
766
|
+
mode,
|
|
767
|
+
toolBindingsOptions,
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
triggerEvent(eventTarget, Events.TOOL_MODE_CHANGED, eventDetail);
|
|
771
|
+
}
|
|
679
772
|
}
|
|
680
773
|
|
|
681
774
|
function hasSameBinding(
|
|
@@ -15,7 +15,9 @@ function getToolGroupsWithToolName(toolName: string): IToolGroup[] | [] {
|
|
|
15
15
|
const toolGroupToolNames = Object.keys(toolOptions);
|
|
16
16
|
|
|
17
17
|
for (let i = 0; i < toolGroupToolNames.length; i++) {
|
|
18
|
-
if (toolName !== toolGroupToolNames[i])
|
|
18
|
+
if (toolName !== toolGroupToolNames[i]) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
/* filter out tools that don't have options */
|
|
21
23
|
if (!toolOptions[toolName]) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { vec3 } from 'gl-matrix';
|
|
1
|
+
import { vec3, mat4 } from 'gl-matrix';
|
|
2
2
|
import {
|
|
3
3
|
getRenderingEngine,
|
|
4
4
|
Types,
|
|
@@ -8,28 +8,27 @@ import {
|
|
|
8
8
|
import { Synchronizer } from '../../store';
|
|
9
9
|
import { jumpToSlice } from '../../utilities';
|
|
10
10
|
import areViewportsCoplanar from './areViewportsCoplanar ';
|
|
11
|
+
|
|
12
|
+
const getSpatialRegistration = (targetId, sourceId) =>
|
|
13
|
+
utilities.spatialRegistrationMetadataProvider.get(
|
|
14
|
+
'spatialRegistrationModule',
|
|
15
|
+
[targetId, sourceId]
|
|
16
|
+
);
|
|
17
|
+
|
|
11
18
|
/**
|
|
12
19
|
* Synchronizer callback to synchronize the source viewport image to the
|
|
13
|
-
* target viewports closest image in its stack.
|
|
20
|
+
* target viewports closest image in its stack.
|
|
14
21
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
22
|
+
* This synchronizer does a setup (which can already be predefined as required)
|
|
23
|
+
* to register the target and soruce viewports. The registration will default
|
|
24
|
+
* to the identity registration if the same FOR is present in both viewports,
|
|
25
|
+
* unless the option `useInitialPosition` is set in the target viewport.
|
|
19
26
|
*
|
|
20
|
-
*
|
|
21
|
-
* registrationMetadataProvider to
|
|
22
|
-
* for mapping between the source and target viewport if so it is used to
|
|
23
|
-
* and is applied to the imagePositionPatient of the source viewport's to
|
|
24
|
-
* get the imagePositionPatient of the target viewport's closest image in
|
|
25
|
-
* its stack.
|
|
26
|
-
* Note for 2) The consuming apps using Cornerstone3D (OHIF, etc) are responsible
|
|
27
|
-
* to provide such data in the registrationMetadataProvider. This can be done
|
|
27
|
+
* The consuming apps using Cornerstone3D (OHIF, etc) MAY provide such data in
|
|
28
|
+
* the registrationMetadataProvider to override the data here. This can be done
|
|
28
29
|
* by various methods 1) Using spatialRegistrationModule inside dicom 2) assuming
|
|
29
30
|
* the user has actually manually scrolled the target viewport to the correct
|
|
30
31
|
* slice before initiating the synchronization 3) using some other method
|
|
31
|
-
* But overall, the consuming app is responsible for providing the data.
|
|
32
|
-
*
|
|
33
32
|
*
|
|
34
33
|
* @param synchronizerInstance - The Instance of the Synchronizer
|
|
35
34
|
* @param sourceViewport - The list of IDs defining the source viewport.
|
|
@@ -53,13 +52,16 @@ export default async function stackImageSyncCallback(
|
|
|
53
52
|
sourceViewport.viewportId
|
|
54
53
|
) as Types.IStackViewport;
|
|
55
54
|
|
|
55
|
+
const options = synchronizerInstance.getOptions(targetViewport.viewportId);
|
|
56
|
+
|
|
57
|
+
if (options?.disabled) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
56
61
|
const tViewport = renderingEngine.getViewport(
|
|
57
62
|
targetViewport.viewportId
|
|
58
63
|
) as Types.IStackViewport;
|
|
59
64
|
|
|
60
|
-
const frameOfReferenceUID1 = sViewport.getFrameOfReferenceUID();
|
|
61
|
-
const frameOfReferenceUID2 = tViewport.getFrameOfReferenceUID();
|
|
62
|
-
|
|
63
65
|
const imageId1 = sViewport.getCurrentImageId();
|
|
64
66
|
const imagePlaneModule1 = metaData.get('imagePlaneModule', imageId1);
|
|
65
67
|
const sourceImagePositionPatient = imagePlaneModule1.imagePositionPatient;
|
|
@@ -70,69 +72,62 @@ export default async function stackImageSyncCallback(
|
|
|
70
72
|
return;
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
if
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
// if the frame of reference is different we need to use the registrationMetadataProvider
|
|
76
|
+
// and add that to the imagePositionPatient of the source viewport to get the
|
|
77
|
+
// imagePositionPatient of the target viewport's closest image in its stack
|
|
78
|
+
let registrationMatrixMat4 = getSpatialRegistration(
|
|
79
|
+
targetViewport.viewportId,
|
|
80
|
+
sourceViewport.viewportId
|
|
81
|
+
);
|
|
80
82
|
|
|
83
|
+
if (!registrationMatrixMat4) {
|
|
84
|
+
const frameOfReferenceUID1 = sViewport.getFrameOfReferenceUID();
|
|
85
|
+
const frameOfReferenceUID2 = tViewport.getFrameOfReferenceUID();
|
|
81
86
|
if (
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
frameOfReferenceUID1 === frameOfReferenceUID2 &&
|
|
88
|
+
options?.useInitialPosition !== false
|
|
84
89
|
) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
// if the frame of reference is different we need to use the registrationMetadataProvider
|
|
94
|
-
// and add that to the imagePositionPatient of the source viewport to get the
|
|
95
|
-
// imagePositionPatient of the target viewport's closest image in its stack
|
|
96
|
-
const registrationMatrixMat4 =
|
|
97
|
-
utilities.spatialRegistrationMetadataProvider.get(
|
|
98
|
-
'spatialRegistrationModule',
|
|
99
|
-
[targetViewport.viewportId, sourceViewport.viewportId]
|
|
90
|
+
registrationMatrixMat4 = mat4.identity(mat4.create());
|
|
91
|
+
} else {
|
|
92
|
+
utilities.calculateViewportsSpatialRegistration(sViewport, tViewport);
|
|
93
|
+
registrationMatrixMat4 = getSpatialRegistration(
|
|
94
|
+
targetViewport.viewportId,
|
|
95
|
+
sourceViewport.viewportId
|
|
100
96
|
);
|
|
101
|
-
|
|
97
|
+
}
|
|
102
98
|
if (!registrationMatrixMat4) {
|
|
103
|
-
|
|
104
|
-
`No registration matrix found for sourceViewport: ${sourceViewport.viewportId} and targetViewport: ${targetViewport.viewportId}, viewports with different frameOfReferenceUIDs must have a registration matrix in the registrationMetadataProvider. Use calculateViewportsRegistrationMatrix to calculate the matrix.`
|
|
105
|
-
);
|
|
99
|
+
return;
|
|
106
100
|
}
|
|
101
|
+
}
|
|
107
102
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
// apply the registration matrix to the source viewport's imagePositionPatient
|
|
104
|
+
// to get the target viewport's imagePositionPatient
|
|
105
|
+
const targetImagePositionPatientWithRegistrationMatrix = vec3.transformMat4(
|
|
106
|
+
vec3.create(),
|
|
107
|
+
sourceImagePositionPatient,
|
|
108
|
+
registrationMatrixMat4
|
|
109
|
+
);
|
|
115
110
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
// find the closest image in the target viewport's stack to the
|
|
112
|
+
// targetImagePositionPatientWithRegistrationMatrix
|
|
113
|
+
const closestImageIdIndex2 = _getClosestImageIdIndex(
|
|
114
|
+
targetImagePositionPatientWithRegistrationMatrix,
|
|
115
|
+
targetImageIds
|
|
116
|
+
);
|
|
122
117
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
118
|
+
if (
|
|
119
|
+
closestImageIdIndex2.index !== -1 &&
|
|
120
|
+
tViewport.getCurrentImageIdIndex() !== closestImageIdIndex2.index
|
|
121
|
+
) {
|
|
122
|
+
await jumpToSlice(tViewport.element, {
|
|
123
|
+
imageIndex: closestImageIdIndex2.index,
|
|
124
|
+
});
|
|
131
125
|
}
|
|
132
126
|
}
|
|
133
127
|
|
|
134
128
|
function _getClosestImageIdIndex(targetPoint, imageIds) {
|
|
135
129
|
// todo: this does not assume orientation yet, but that can be added later
|
|
130
|
+
// todo: handle multiframe images
|
|
136
131
|
return imageIds.reduce(
|
|
137
132
|
(closestImageIdIndex, imageId, index) => {
|
|
138
133
|
const { imagePositionPatient } = metaData.get(
|