@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
|
@@ -4,6 +4,7 @@ import { fillInsideSphere } from './fillSphere';
|
|
|
4
4
|
|
|
5
5
|
type OperationData = {
|
|
6
6
|
points: [Types.Point3, Types.Point3, Types.Point3, Types.Point3];
|
|
7
|
+
imageVolume: Types.IImageVolume;
|
|
7
8
|
volume: Types.IImageVolume;
|
|
8
9
|
segmentIndex: number;
|
|
9
10
|
segmentationId: string;
|
|
@@ -11,6 +12,7 @@ type OperationData = {
|
|
|
11
12
|
viewPlaneNormal: Types.Point3;
|
|
12
13
|
viewUp: Types.Point3;
|
|
13
14
|
constraintFn: () => boolean;
|
|
15
|
+
strategySpecificConfiguration: any;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
export function eraseInsideSphere(
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { getBoundingBoxAroundShape } from '../../../utilities/boundingBox';
|
|
10
10
|
import { triggerSegmentationDataModified } from '../../../stateManagement/segmentation/triggerSegmentationEvents';
|
|
11
11
|
import { pointInShapeCallback } from '../../../utilities';
|
|
12
|
+
import isWithinThreshold from './utils/isWithinThreshold';
|
|
12
13
|
|
|
13
14
|
const { transformWorldToIndex } = csUtils;
|
|
14
15
|
|
|
@@ -117,19 +118,6 @@ function fillCircle(
|
|
|
117
118
|
triggerSegmentationDataModified(segmentationId, arrayOfSlices);
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
function isWithinThreshold(
|
|
121
|
-
index: number,
|
|
122
|
-
imageVolume: Types.IImageVolume,
|
|
123
|
-
strategySpecificConfiguration: any
|
|
124
|
-
) {
|
|
125
|
-
const { THRESHOLD_INSIDE_CIRCLE } = strategySpecificConfiguration;
|
|
126
|
-
|
|
127
|
-
const voxelValue = imageVolume.getScalarData()[index];
|
|
128
|
-
const { threshold } = THRESHOLD_INSIDE_CIRCLE;
|
|
129
|
-
|
|
130
|
-
return threshold[0] <= voxelValue && voxelValue <= threshold[1];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
121
|
/**
|
|
134
122
|
* Fill inside the circular region segment inside the segmentation defined by the operationData.
|
|
135
123
|
* It fills the segmentation pixels inside the defined circle.
|
|
@@ -1,29 +1,36 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import { utilities as csUtils } from '@cornerstonejs/core';
|
|
2
3
|
|
|
3
4
|
import { triggerSegmentationDataModified } from '../../../stateManagement/segmentation/triggerSegmentationEvents';
|
|
4
5
|
import { pointInSurroundingSphereCallback } from '../../../utilities';
|
|
6
|
+
import isWithinThreshold from './utils/isWithinThreshold';
|
|
5
7
|
|
|
6
8
|
type OperationData = {
|
|
7
9
|
points: [Types.Point3, Types.Point3, Types.Point3, Types.Point3];
|
|
8
10
|
volume: Types.IImageVolume;
|
|
11
|
+
imageVolume: Types.IImageVolume;
|
|
9
12
|
segmentIndex: number;
|
|
10
13
|
segmentationId: string;
|
|
11
14
|
segmentsLocked: number[];
|
|
12
15
|
viewPlaneNormal: Types.Point3;
|
|
13
16
|
viewUp: Types.Point3;
|
|
17
|
+
strategySpecificConfiguration: any;
|
|
14
18
|
constraintFn: () => boolean;
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
function fillSphere(
|
|
18
22
|
enabledElement: Types.IEnabledElement,
|
|
19
23
|
operationData: OperationData,
|
|
20
|
-
_inside = true
|
|
24
|
+
_inside = true,
|
|
25
|
+
threshold = false
|
|
21
26
|
): void {
|
|
22
27
|
const { viewport } = enabledElement;
|
|
23
28
|
const {
|
|
24
29
|
volume: segmentation,
|
|
25
30
|
segmentsLocked,
|
|
26
31
|
segmentIndex,
|
|
32
|
+
imageVolume,
|
|
33
|
+
strategySpecificConfiguration,
|
|
27
34
|
segmentationId,
|
|
28
35
|
points,
|
|
29
36
|
} = operationData;
|
|
@@ -32,13 +39,30 @@ function fillSphere(
|
|
|
32
39
|
const scalarData = segmentation.getScalarData();
|
|
33
40
|
const scalarIndex = [];
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
let callback;
|
|
43
|
+
|
|
44
|
+
if (threshold) {
|
|
45
|
+
callback = ({ value, index, pointIJK }) => {
|
|
46
|
+
if (segmentsLocked.includes(value)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (
|
|
51
|
+
isWithinThreshold(index, imageVolume, strategySpecificConfiguration)
|
|
52
|
+
) {
|
|
53
|
+
scalarData[index] = segmentIndex;
|
|
54
|
+
scalarIndex.push(index);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
} else {
|
|
58
|
+
callback = ({ index, value }) => {
|
|
59
|
+
if (segmentsLocked.includes(value)) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
scalarData[index] = segmentIndex;
|
|
63
|
+
scalarIndex.push(index);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
42
66
|
|
|
43
67
|
pointInSurroundingSphereCallback(
|
|
44
68
|
imageData,
|
|
@@ -74,6 +98,30 @@ export function fillInsideSphere(
|
|
|
74
98
|
fillSphere(enabledElement, operationData, true);
|
|
75
99
|
}
|
|
76
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Fill inside the circular region segment inside the segmentation defined by the operationData.
|
|
103
|
+
* It fills the segmentation pixels inside the defined circle.
|
|
104
|
+
* @param enabledElement - The element for which the segment is being filled.
|
|
105
|
+
* @param operationData - EraseOperationData
|
|
106
|
+
*/
|
|
107
|
+
export function thresholdInsideSphere(
|
|
108
|
+
enabledElement: Types.IEnabledElement,
|
|
109
|
+
operationData: OperationData
|
|
110
|
+
): void {
|
|
111
|
+
const { volume, imageVolume } = operationData;
|
|
112
|
+
|
|
113
|
+
if (
|
|
114
|
+
!csUtils.isEqual(volume.dimensions, imageVolume.dimensions) ||
|
|
115
|
+
!csUtils.isEqual(volume.direction, imageVolume.direction)
|
|
116
|
+
) {
|
|
117
|
+
throw new Error(
|
|
118
|
+
'Only source data the same dimensions/size/orientation as the segmentation currently supported.'
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
fillSphere(enabledElement, operationData, true, true);
|
|
123
|
+
}
|
|
124
|
+
|
|
77
125
|
/**
|
|
78
126
|
* Fill outside a sphere with the given segment index in the given operation data. The
|
|
79
127
|
* operation data contains the sphere required points.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Types } from '@cornerstonejs/core';
|
|
2
|
+
|
|
3
|
+
function isWithinThreshold(
|
|
4
|
+
index: number,
|
|
5
|
+
imageVolume: Types.IImageVolume,
|
|
6
|
+
strategySpecificConfiguration: any
|
|
7
|
+
) {
|
|
8
|
+
const { THRESHOLD_INSIDE_CIRCLE } = strategySpecificConfiguration;
|
|
9
|
+
|
|
10
|
+
const voxelValue = imageVolume.getScalarData()[index];
|
|
11
|
+
const { threshold } = THRESHOLD_INSIDE_CIRCLE;
|
|
12
|
+
|
|
13
|
+
return threshold[0] <= voxelValue && voxelValue <= threshold[1];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default isWithinThreshold;
|
package/src/types/CINETypes.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
2
|
-
|
|
3
1
|
type PlayClipOptions = {
|
|
4
2
|
framesPerSecond?: number;
|
|
5
3
|
frameTimeVector?: number[];
|
|
@@ -7,6 +5,11 @@ type PlayClipOptions = {
|
|
|
7
5
|
loop?: boolean;
|
|
8
6
|
dynamicCineEnabled?: boolean;
|
|
9
7
|
frameTimeVectorSpeedMultiplier?: number;
|
|
8
|
+
// How many CINE frames to wait for a rendered event to occur before
|
|
9
|
+
// trying to display the image after the next one
|
|
10
|
+
// A CINE frame is attempted every 1 / fps seconds
|
|
11
|
+
// The default is 30 tries, or 1.25 seconds at 24 fps
|
|
12
|
+
waitForRendered?: number;
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
interface ToolData {
|
|
@@ -26,6 +29,9 @@ type CinePlayContext = {
|
|
|
26
29
|
get numScrollSteps(): number;
|
|
27
30
|
get currentStepIndex(): number;
|
|
28
31
|
get frameTimeVectorEnabled(): boolean;
|
|
32
|
+
// How many times has the wait for rendered been tried without showing
|
|
33
|
+
// the next image.
|
|
34
|
+
waitForRenderedCount?: number;
|
|
29
35
|
scroll(delta: number): void;
|
|
30
36
|
};
|
|
31
37
|
|
package/src/types/EventTypes.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { Annotation } from './AnnotationTypes';
|
|
|
3
3
|
import IPoints from './IPoints';
|
|
4
4
|
import ITouchPoints from './ITouchPoints';
|
|
5
5
|
import IDistance from './IDistance';
|
|
6
|
+
import { SetToolBindingsType } from './ISetToolModeOptions';
|
|
6
7
|
import { Swipe } from '../enums/Touch';
|
|
8
|
+
import { ToolModes } from '../enums';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* The normalized interaction event detail
|
|
@@ -70,6 +72,32 @@ type InteractionStartEventDetail = InteractionEventDetail;
|
|
|
70
72
|
|
|
71
73
|
type InteractionEndEventDetail = InteractionEventDetail;
|
|
72
74
|
|
|
75
|
+
/**
|
|
76
|
+
* The data that is passed to the event handler when tool mode changes
|
|
77
|
+
*/
|
|
78
|
+
type ToolModeChangedEventDetail = {
|
|
79
|
+
/** unique id of the toolGroup */
|
|
80
|
+
toolGroupId: string;
|
|
81
|
+
/** Tool name */
|
|
82
|
+
toolName: string;
|
|
83
|
+
/** Tool mode */
|
|
84
|
+
mode: ToolModes;
|
|
85
|
+
/** Tool binding options */
|
|
86
|
+
toolBindingsOptions?: SetToolBindingsType;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The data that is passed to the event handler when a tool is activated.
|
|
91
|
+
*/
|
|
92
|
+
type ToolActivatedEventDetail = {
|
|
93
|
+
/** unique id of the toolGroup */
|
|
94
|
+
toolGroupId: string;
|
|
95
|
+
/** Tool name */
|
|
96
|
+
toolName: string;
|
|
97
|
+
/** Tool binding options */
|
|
98
|
+
toolBindingsOptions: SetToolBindingsType;
|
|
99
|
+
};
|
|
100
|
+
|
|
73
101
|
/**
|
|
74
102
|
* The data that is passed to the event handler when a new annotation is added
|
|
75
103
|
* to the annotations.
|
|
@@ -411,6 +439,17 @@ type NormalizedMouseEventType = Types.CustomEventType<MouseCustomEventDetail>;
|
|
|
411
439
|
*/
|
|
412
440
|
type NormalizedTouchEventType = Types.CustomEventType<TouchCustomEventDetail>;
|
|
413
441
|
|
|
442
|
+
/**
|
|
443
|
+
* The ToolModeChanged event type
|
|
444
|
+
*/
|
|
445
|
+
type ToolModeChangedEventType =
|
|
446
|
+
Types.CustomEventType<ToolModeChangedEventDetail>;
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* The ToolActivated event type
|
|
450
|
+
*/
|
|
451
|
+
type ToolActivatedEventType = Types.CustomEventType<ToolActivatedEventDetail>;
|
|
452
|
+
|
|
414
453
|
/**
|
|
415
454
|
* The AnnotationAdded event type
|
|
416
455
|
*/
|
|
@@ -611,6 +650,10 @@ export {
|
|
|
611
650
|
NormalizedInteractionEventDetail,
|
|
612
651
|
NormalizedMouseEventType,
|
|
613
652
|
NormalizedTouchEventType,
|
|
653
|
+
ToolModeChangedEventDetail,
|
|
654
|
+
ToolModeChangedEventType,
|
|
655
|
+
ToolActivatedEventDetail,
|
|
656
|
+
ToolActivatedEventType,
|
|
614
657
|
AnnotationAddedEventDetail,
|
|
615
658
|
AnnotationAddedEventType,
|
|
616
659
|
AnnotationCompletedEventDetail,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ToolModes, MouseBindings, KeyboardBindings } from '../enums';
|
|
2
2
|
|
|
3
|
-
type ToolBindingMouseType = typeof MouseBindings[keyof typeof MouseBindings];
|
|
3
|
+
type ToolBindingMouseType = (typeof MouseBindings)[keyof typeof MouseBindings];
|
|
4
4
|
|
|
5
5
|
type ToolBindingKeyboardType =
|
|
6
|
-
typeof KeyboardBindings[keyof typeof KeyboardBindings];
|
|
6
|
+
(typeof KeyboardBindings)[keyof typeof KeyboardBindings];
|
|
7
7
|
|
|
8
8
|
type IToolBinding = {
|
|
9
9
|
/** Mouse button bindings e.g., MouseBindings.Primary/Secondary etc. */
|
package/src/types/IToolGroup.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import { SetToolBindingsType, ToolOptionsType } from './ISetToolModeOptions';
|
|
3
3
|
import { MouseBindings } from '../enums';
|
|
4
|
+
import { ToolConfiguration } from '../types';
|
|
4
5
|
/**
|
|
5
6
|
* ToolGroup interface
|
|
6
7
|
*/
|
|
@@ -19,8 +20,10 @@ export default interface IToolGroup {
|
|
|
19
20
|
getViewportsInfo: () => Array<Types.IViewportId>;
|
|
20
21
|
/** Get the toolInstance of the toolName */
|
|
21
22
|
getToolInstance: { (toolName: string): any };
|
|
22
|
-
/** Add a tool to toolGroup with its configuration */
|
|
23
|
-
addTool: {
|
|
23
|
+
/** Add a tool to toolGroup with its configuration and custom calculator if wanted */
|
|
24
|
+
addTool: {
|
|
25
|
+
(toolName: string, toolConfiguration?: ToolConfiguration): void;
|
|
26
|
+
};
|
|
24
27
|
/** Add tool instance, if you want to create more than one instance from the same tool e.g., brush/eraser tool */
|
|
25
28
|
addToolInstance: {
|
|
26
29
|
(ttoolName: string, parentClassName: string, configuration?: any): void;
|
|
@@ -62,7 +65,7 @@ export default interface IToolGroup {
|
|
|
62
65
|
setToolConfiguration: {
|
|
63
66
|
(
|
|
64
67
|
toolName: string,
|
|
65
|
-
configuration:
|
|
68
|
+
configuration: ToolConfiguration,
|
|
66
69
|
overwrite?: boolean
|
|
67
70
|
): void;
|
|
68
71
|
};
|
|
@@ -72,4 +75,11 @@ export default interface IToolGroup {
|
|
|
72
75
|
getDefaultMousePrimary: {
|
|
73
76
|
(): MouseBindings;
|
|
74
77
|
};
|
|
78
|
+
|
|
79
|
+
clone: {
|
|
80
|
+
(
|
|
81
|
+
newToolGroupId: string,
|
|
82
|
+
fnToolFilter: (toolName: string) => boolean
|
|
83
|
+
): IToolGroup;
|
|
84
|
+
};
|
|
75
85
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Annotation } from './AnnotationTypes';
|
|
2
|
+
import type { InteractionEventType } from './EventTypes';
|
|
3
|
+
import type { SetToolBindingsType } from './ISetToolModeOptions';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An action that may be defined at the tool configuration level
|
|
7
|
+
*
|
|
8
|
+
* Annotations can have actions that run a specific task (ex: showing a dropdown
|
|
9
|
+
* containing a list of all predefined zoom levels - advanced magnifier glass).
|
|
10
|
+
* Each action must have at least one binding option (mouse button + [modifier(s)])
|
|
11
|
+
* and a action runs if and only if no other tool is using that same binding options
|
|
12
|
+
* to draw an annotation because action has lower priority.
|
|
13
|
+
*
|
|
14
|
+
* Actions are defined in the following way in a annotation tool constructor:
|
|
15
|
+
*
|
|
16
|
+
* class MyAnnotationTool extends AnnotationTool {
|
|
17
|
+
* constructor(
|
|
18
|
+
* toolProps: PublicToolProps = {},
|
|
19
|
+
* defaultToolProps: ToolProps = {
|
|
20
|
+
* configuration: {
|
|
21
|
+
* actions: [
|
|
22
|
+
* {
|
|
23
|
+
* method: 'myAction',
|
|
24
|
+
* bindings: [
|
|
25
|
+
* {
|
|
26
|
+
* mouseButton: MouseBindings.Secondary,
|
|
27
|
+
* modifierKey: KeyboardBindings.Shift,
|
|
28
|
+
* }
|
|
29
|
+
* ]
|
|
30
|
+
* }
|
|
31
|
+
* ]
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ) {
|
|
35
|
+
* super(toolProps, defaultToolProps);
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* public myAction(evt: EventTypes.InteractionEventType, annotation: MyAnnotation) {
|
|
39
|
+
* // action code
|
|
40
|
+
* }
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* The "method" property may be a string or a javascript function. In case it is
|
|
44
|
+
* a string a function with same name must exists in the tool class. In both ways
|
|
45
|
+
* (string or function) the function is called in the tool's context (`this`)
|
|
46
|
+
*/
|
|
47
|
+
type ToolAction = {
|
|
48
|
+
method:
|
|
49
|
+
| string
|
|
50
|
+
| ((evt: InteractionEventType, annotation: Annotation) => void);
|
|
51
|
+
bindings: SetToolBindingsType[];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default ToolAction;
|
package/src/types/ToolProps.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import { Calculator } from '../utilities/math/basic';
|
|
2
|
+
|
|
1
3
|
type SharedToolProp = {
|
|
2
4
|
/** supported interactions for the tool */
|
|
3
5
|
supportedInteractionTypes?: Array<string>;
|
|
4
6
|
/** tool specific tool configuration */
|
|
5
|
-
configuration?:
|
|
7
|
+
configuration?: ToolConfiguration;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type ToolConfiguration = Record<string, any> & {
|
|
11
|
+
statsCalculator?: Calculator;
|
|
6
12
|
};
|
|
7
13
|
|
|
8
14
|
export type ToolProps = SharedToolProp;
|
|
@@ -78,6 +78,18 @@ export interface LengthAnnotation extends Annotation {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
export interface AdvancedMagnifyAnnotation extends Annotation {
|
|
82
|
+
data: {
|
|
83
|
+
zoomFactor: number;
|
|
84
|
+
sourceViewportId: string;
|
|
85
|
+
magnifyViewportId: string;
|
|
86
|
+
handles: {
|
|
87
|
+
points: Types.Point3[]; // [top, right, bottom, left]
|
|
88
|
+
activeHandleIndex: number | null;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
81
93
|
export interface CircleROIAnnotation extends Annotation {
|
|
82
94
|
data: {
|
|
83
95
|
handles: {
|
|
@@ -261,6 +273,7 @@ export interface ArrowAnnotation extends Annotation {
|
|
|
261
273
|
};
|
|
262
274
|
};
|
|
263
275
|
}
|
|
276
|
+
|
|
264
277
|
export interface AngleAnnotation extends Annotation {
|
|
265
278
|
data: {
|
|
266
279
|
handles: {
|
|
@@ -286,6 +299,51 @@ export interface AngleAnnotation extends Annotation {
|
|
|
286
299
|
};
|
|
287
300
|
}
|
|
288
301
|
|
|
302
|
+
export interface CobbAngleAnnotation extends Annotation {
|
|
303
|
+
data: {
|
|
304
|
+
handles: {
|
|
305
|
+
points: Types.Point3[];
|
|
306
|
+
activeHandleIndex: number | null;
|
|
307
|
+
textBox: {
|
|
308
|
+
hasMoved: boolean;
|
|
309
|
+
worldPosition: Types.Point3;
|
|
310
|
+
worldBoundingBox: {
|
|
311
|
+
topLeft: Types.Point3;
|
|
312
|
+
topRight: Types.Point3;
|
|
313
|
+
bottomLeft: Types.Point3;
|
|
314
|
+
bottomRight: Types.Point3;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
label: string;
|
|
319
|
+
cachedStats: {
|
|
320
|
+
[targetId: string]: {
|
|
321
|
+
angle: number;
|
|
322
|
+
arc1Angle: number;
|
|
323
|
+
arc2Angle: number;
|
|
324
|
+
points: {
|
|
325
|
+
world: {
|
|
326
|
+
arc1Start: Types.Point3;
|
|
327
|
+
arc1End: Types.Point3;
|
|
328
|
+
arc2Start: Types.Point3;
|
|
329
|
+
arc2End: Types.Point3;
|
|
330
|
+
arc1Angle: number;
|
|
331
|
+
arc2Angle: number;
|
|
332
|
+
};
|
|
333
|
+
canvas: {
|
|
334
|
+
arc1Start: Types.Point2;
|
|
335
|
+
arc1End: Types.Point2;
|
|
336
|
+
arc2Start: Types.Point2;
|
|
337
|
+
arc2End: Types.Point2;
|
|
338
|
+
arc1Angle: number;
|
|
339
|
+
arc2Angle: number;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
|
|
289
347
|
export interface ReferenceCursor extends Annotation {
|
|
290
348
|
data: {
|
|
291
349
|
handles: {
|
package/src/types/index.ts
CHANGED
|
@@ -21,7 +21,12 @@ import type * as AnnotationStyle from './AnnotationStyle';
|
|
|
21
21
|
import type ToolHandle from './ToolHandle';
|
|
22
22
|
import type { AnnotationHandle, TextBoxHandle } from './ToolHandle';
|
|
23
23
|
import type InteractionTypes from './InteractionTypes';
|
|
24
|
-
import type
|
|
24
|
+
import type ToolAction from './ToolAction';
|
|
25
|
+
import type {
|
|
26
|
+
ToolProps,
|
|
27
|
+
PublicToolProps,
|
|
28
|
+
ToolConfiguration,
|
|
29
|
+
} from './ToolProps';
|
|
25
30
|
import type { SVGCursorDescriptor, SVGPoint } from './CursorTypes';
|
|
26
31
|
import type JumpToSliceOptions from './JumpToSliceOptions';
|
|
27
32
|
import type ScrollOptions from './ScrollOptions';
|
|
@@ -52,6 +57,7 @@ import IToolClassReference from './IToolClassReference';
|
|
|
52
57
|
import { ContourSegmentationData } from './ContourTypes';
|
|
53
58
|
import IAnnotationManager from './IAnnotationManager';
|
|
54
59
|
import AnnotationGroupSelector from './AnnotationGroupSelector';
|
|
60
|
+
import { Statistics } from './CalculatorTypes';
|
|
55
61
|
|
|
56
62
|
export type {
|
|
57
63
|
// AnnotationState
|
|
@@ -68,6 +74,7 @@ export type {
|
|
|
68
74
|
PlanarBoundingBox,
|
|
69
75
|
ToolProps,
|
|
70
76
|
PublicToolProps,
|
|
77
|
+
ToolConfiguration,
|
|
71
78
|
// Event data
|
|
72
79
|
EventTypes,
|
|
73
80
|
IPoints,
|
|
@@ -78,6 +85,7 @@ export type {
|
|
|
78
85
|
SetToolBindingsType,
|
|
79
86
|
ToolOptionsType,
|
|
80
87
|
InteractionTypes,
|
|
88
|
+
ToolAction,
|
|
81
89
|
//
|
|
82
90
|
IToolGroup,
|
|
83
91
|
IToolClassReference,
|
|
@@ -114,4 +122,6 @@ export type {
|
|
|
114
122
|
FloodFillOptions,
|
|
115
123
|
// Contour
|
|
116
124
|
ContourSegmentationData,
|
|
125
|
+
//Statistics
|
|
126
|
+
Statistics,
|
|
117
127
|
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
VolumeViewport,
|
|
7
7
|
cache,
|
|
8
8
|
BaseVolumeViewport,
|
|
9
|
+
Enums,
|
|
9
10
|
} from '@cornerstonejs/core';
|
|
10
11
|
|
|
11
12
|
import { Types } from '@cornerstonejs/core';
|
|
@@ -14,6 +15,7 @@ import { addToolState, getToolState } from './state';
|
|
|
14
15
|
import { CINETypes } from '../../types';
|
|
15
16
|
import scroll from '../scroll';
|
|
16
17
|
|
|
18
|
+
const { ViewportStatus } = Enums;
|
|
17
19
|
const { triggerEvent } = csUtils;
|
|
18
20
|
|
|
19
21
|
const debounced = true;
|
|
@@ -193,7 +195,9 @@ function stopClip(element: HTMLDivElement): void {
|
|
|
193
195
|
|
|
194
196
|
function _stopClip(element: HTMLDivElement, stopDynamicCine: boolean): void {
|
|
195
197
|
const enabledElement = getEnabledElement(element);
|
|
196
|
-
if (!enabledElement)
|
|
198
|
+
if (!enabledElement) {
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
197
201
|
const { viewport } = enabledElement;
|
|
198
202
|
const cineToolData = getToolState(viewport.element);
|
|
199
203
|
|
|
@@ -313,7 +317,8 @@ function _getVolumeFromViewport(viewport): Types.IImageVolume {
|
|
|
313
317
|
}
|
|
314
318
|
|
|
315
319
|
function _createStackViewportCinePlayContext(
|
|
316
|
-
viewport: StackViewport
|
|
320
|
+
viewport: StackViewport,
|
|
321
|
+
waitForRendered: number
|
|
317
322
|
): CINETypes.CinePlayContext {
|
|
318
323
|
const imageIds = viewport.getImageIds();
|
|
319
324
|
|
|
@@ -328,7 +333,16 @@ function _createStackViewportCinePlayContext(
|
|
|
328
333
|
// It is always in acquired orientation
|
|
329
334
|
return true;
|
|
330
335
|
},
|
|
336
|
+
waitForRenderedCount: 0,
|
|
331
337
|
scroll(delta: number): void {
|
|
338
|
+
if (
|
|
339
|
+
this.waitForRenderedCount <= waitForRendered &&
|
|
340
|
+
viewport.viewportStatus !== ViewportStatus.RENDERED
|
|
341
|
+
) {
|
|
342
|
+
this.waitForRenderedCount++;
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
this.waitForRenderedCount = 0;
|
|
332
346
|
scroll(viewport, { delta, debounceLoading: debounced });
|
|
333
347
|
},
|
|
334
348
|
};
|
|
@@ -417,7 +431,10 @@ function _createCinePlayContext(
|
|
|
417
431
|
playClipOptions: CINETypes.PlayClipOptions
|
|
418
432
|
): CINETypes.CinePlayContext {
|
|
419
433
|
if (viewport instanceof StackViewport) {
|
|
420
|
-
return _createStackViewportCinePlayContext(
|
|
434
|
+
return _createStackViewportCinePlayContext(
|
|
435
|
+
viewport,
|
|
436
|
+
playClipOptions.waitForRendered ?? 30
|
|
437
|
+
);
|
|
421
438
|
}
|
|
422
439
|
|
|
423
440
|
if (viewport instanceof VolumeViewport) {
|
|
@@ -40,13 +40,16 @@ function getDataInTime(
|
|
|
40
40
|
|
|
41
41
|
if (options.maskVolumeId) {
|
|
42
42
|
const segmentationVolume = cache.getVolume(options.maskVolumeId);
|
|
43
|
+
const segScalarData = segmentationVolume.getScalarData();
|
|
44
|
+
const indexArray = [];
|
|
45
|
+
|
|
46
|
+
// Get the index of every non-zero voxel in mask
|
|
47
|
+
for (let i = 0, len = segScalarData.length; i < len; i++) {
|
|
48
|
+
if (segScalarData[i] !== 0) {
|
|
49
|
+
indexArray.push(i);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
43
52
|
|
|
44
|
-
// Get the index of every non-zero voxel in mask by mapping indexes to
|
|
45
|
-
// new array, then using the array to filter
|
|
46
|
-
const indexArray = segmentationVolume
|
|
47
|
-
.getScalarData()
|
|
48
|
-
.map((_, i) => i)
|
|
49
|
-
.filter((i) => segmentationVolume.getScalarData()[i] !== 0);
|
|
50
53
|
const dataInTime = _getTimePointDataMask(frames, indexArray, dynamicVolume);
|
|
51
54
|
|
|
52
55
|
return dataInTime;
|
|
@@ -23,10 +23,16 @@ const getCalibratedLengthUnits = (handles, image): string => {
|
|
|
23
23
|
const { calibration, hasPixelSpacing } = image;
|
|
24
24
|
// Anachronistic - moving to using calibration consistently, but not completed yet
|
|
25
25
|
const units = hasPixelSpacing ? 'mm' : PIXEL_UNITS;
|
|
26
|
-
if (!calibration || !calibration.type)
|
|
27
|
-
|
|
26
|
+
if (!calibration || !calibration.type) {
|
|
27
|
+
return units;
|
|
28
|
+
}
|
|
29
|
+
if (calibration.type === CalibrationTypes.UNCALIBRATED) {
|
|
30
|
+
return PIXEL_UNITS;
|
|
31
|
+
}
|
|
28
32
|
// TODO - handle US regions properly
|
|
29
|
-
if (calibration.SequenceOfUltrasoundRegions)
|
|
33
|
+
if (calibration.SequenceOfUltrasoundRegions) {
|
|
34
|
+
return 'US Region';
|
|
35
|
+
}
|
|
30
36
|
return `${units} ${calibration.type}`;
|
|
31
37
|
};
|
|
32
38
|
|
|
@@ -37,8 +43,12 @@ const SQUARE = '\xb2';
|
|
|
37
43
|
const getCalibratedAreaUnits = (handles, image): string => {
|
|
38
44
|
const { calibration, hasPixelSpacing } = image;
|
|
39
45
|
const units = (hasPixelSpacing ? 'mm' : PIXEL_UNITS) + SQUARE;
|
|
40
|
-
if (!calibration || !calibration.type)
|
|
41
|
-
|
|
46
|
+
if (!calibration || !calibration.type) {
|
|
47
|
+
return units;
|
|
48
|
+
}
|
|
49
|
+
if (calibration.SequenceOfUltrasoundRegions) {
|
|
50
|
+
return 'US Region';
|
|
51
|
+
}
|
|
42
52
|
return `${units} ${calibration.type}`;
|
|
43
53
|
};
|
|
44
54
|
|
|
@@ -28,8 +28,14 @@ function _handlePTModality(imageId: string, options: ModalityUnitOptions) {
|
|
|
28
28
|
return 'SUV';
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const generalSeriesModule = metaData.get('generalSeriesModule', imageId);
|
|
32
|
+
|
|
33
|
+
// it might be possible that the referenceImageId is not the one
|
|
34
|
+
// that is being displayed. So we need to get the modality from imageId again
|
|
35
|
+
if (generalSeriesModule?.modality === 'PT') {
|
|
36
|
+
const petSeriesModule = metaData.get('petSeriesModule', imageId);
|
|
37
|
+
return petSeriesModule?.units || 'unitless';
|
|
38
|
+
}
|
|
33
39
|
}
|
|
34
40
|
|
|
35
41
|
export { getModalityUnit, ModalityUnitOptions };
|
package/src/utilities/index.ts
CHANGED
|
@@ -29,7 +29,7 @@ import * as cine from './cine';
|
|
|
29
29
|
import * as boundingBox from './boundingBox';
|
|
30
30
|
import * as planarFreehandROITool from './planarFreehandROITool';
|
|
31
31
|
import * as rectangleROITool from './rectangleROITool';
|
|
32
|
-
import
|
|
32
|
+
import { stackPrefetch, stackContextPrefetch } from './stackPrefetch';
|
|
33
33
|
import * as viewport from './viewport';
|
|
34
34
|
import * as touch from './touch';
|
|
35
35
|
import * as dynamicVolume from './dynamicVolume';
|
|
@@ -65,6 +65,7 @@ export {
|
|
|
65
65
|
rectangleROITool,
|
|
66
66
|
planarFreehandROITool,
|
|
67
67
|
stackPrefetch,
|
|
68
|
+
stackContextPrefetch,
|
|
68
69
|
scroll,
|
|
69
70
|
roundNumber,
|
|
70
71
|
};
|