@cornerstonejs/tools 2.0.0-beta.20 → 2.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/cursors/SVGCursorDescriptor.d.ts +1 -1
- package/dist/esm/cursors/SVGCursorDescriptor.js +7 -0
- package/dist/esm/cursors/SVGMouseCursor.d.ts +1 -1
- package/dist/esm/drawingSvg/draw.d.ts +2 -1
- package/dist/esm/drawingSvg/drawArrow.d.ts +1 -1
- package/dist/esm/drawingSvg/drawCircle.d.ts +1 -1
- package/dist/esm/drawingSvg/drawEllipse.d.ts +1 -1
- package/dist/esm/drawingSvg/drawEllipse.js +1 -0
- package/dist/esm/drawingSvg/drawEllipseByCoordinates.d.ts +1 -1
- package/dist/esm/drawingSvg/drawHandle.d.ts +1 -1
- package/dist/esm/drawingSvg/drawHandles.d.ts +1 -1
- package/dist/esm/drawingSvg/drawHeight.d.ts +3 -0
- package/dist/esm/drawingSvg/drawHeight.js +42 -0
- package/dist/esm/drawingSvg/drawLine.d.ts +1 -1
- package/dist/esm/drawingSvg/drawLink.d.ts +1 -1
- package/dist/esm/drawingSvg/drawLinkedTextBox.d.ts +1 -1
- package/dist/esm/drawingSvg/drawPath.d.ts +1 -1
- package/dist/esm/drawingSvg/drawPolyline.d.ts +1 -1
- package/dist/esm/drawingSvg/drawRect.d.ts +1 -1
- package/dist/esm/drawingSvg/drawRect.js +1 -0
- package/dist/esm/drawingSvg/drawRectByCoordinates.d.ts +1 -1
- package/dist/esm/drawingSvg/drawRedactionRect.d.ts +3 -1
- package/dist/esm/drawingSvg/drawTextBox.d.ts +1 -1
- package/dist/esm/drawingSvg/getSvgDrawingHelper.d.ts +1 -1
- package/dist/esm/drawingSvg/getSvgDrawingHelper.js +1 -1
- package/dist/esm/drawingSvg/index.d.ts +2 -1
- package/dist/esm/drawingSvg/index.js +2 -1
- package/dist/esm/enums/ToolBindings.d.ts +3 -1
- package/dist/esm/enums/ToolBindings.js +2 -0
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.d.ts +1 -1
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseDrag.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.d.ts +1 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.d.ts +2 -1
- package/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.js +15 -2
- package/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.d.ts +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.d.ts +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js +3 -4
- package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.d.ts +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.js +1 -1
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForKeyboardEvents.d.ts +2 -2
- package/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.d.ts +4 -3
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.d.ts +3 -3
- package/dist/esm/eventDispatchers/shared/getToolsWithModesForTouchEvent.d.ts +2 -2
- package/dist/esm/eventDispatchers/touchEventHandlers/touchDrag.d.ts +1 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStart.d.ts +1 -1
- package/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.d.ts +1 -1
- package/dist/esm/eventListeners/annotations/annotationCompletedListener.d.ts +1 -1
- package/dist/esm/eventListeners/annotations/annotationRemovedListener.d.ts +1 -1
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +3 -3
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +1 -1
- package/dist/esm/eventListeners/mouse/getMouseEventPoints.d.ts +1 -1
- package/dist/esm/eventListeners/mouse/getMouseEventPoints.js +4 -1
- package/dist/esm/eventListeners/mouse/mouseDownListener.js +9 -1
- package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js +6 -6
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +3 -3
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js +2 -2
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.js +3 -2
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedEventListener.js +5 -5
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.d.ts +1 -1
- package/dist/esm/eventListeners/segmentation/segmentationRepresentationRemovedEventListener.js +4 -2
- package/dist/esm/eventListeners/touch/getTouchEventPoints.d.ts +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.d.ts +20 -0
- package/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.js +112 -0
- package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +3 -3
- package/dist/esm/stateManagement/annotation/annotationLocking.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/annotationState.d.ts +2 -2
- package/dist/esm/stateManagement/annotation/annotationVisibility.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/config/ToolStyle.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/config/getFont.d.ts +2 -2
- package/dist/esm/stateManagement/annotation/config/getState.d.ts +1 -1
- package/dist/esm/stateManagement/annotation/config/helpers.d.ts +2 -2
- package/dist/esm/stateManagement/annotation/helpers/state.d.ts +2 -2
- package/dist/esm/stateManagement/annotation/utilities/defineProperties.d.ts +1 -1
- package/dist/esm/stateManagement/index.d.ts +3 -3
- package/dist/esm/stateManagement/index.js +2 -2
- package/dist/esm/{tools/displayTools → stateManagement/segmentation}/SegmentationRenderingEngine.d.ts +3 -3
- package/dist/esm/{tools/displayTools → stateManagement/segmentation}/SegmentationRenderingEngine.js +14 -17
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.d.ts +12 -12
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +27 -19
- package/dist/esm/stateManagement/segmentation/activeSegmentation.d.ts +5 -4
- package/dist/esm/stateManagement/segmentation/activeSegmentation.js +12 -5
- package/dist/esm/stateManagement/segmentation/addRepresentationData.d.ts +3 -3
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/{addRepresentation.js → addSegmentationRepresentation.js} +6 -6
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.d.ts +3 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentations.js +9 -0
- package/dist/esm/stateManagement/segmentation/addSegmentations.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/config/index.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/config/index.js +2 -2
- package/dist/esm/stateManagement/segmentation/config/segmentationColor.js +2 -2
- package/dist/esm/stateManagement/segmentation/config/segmentationConfig.d.ts +5 -5
- package/dist/esm/stateManagement/segmentation/config/segmentationConfig.js +5 -5
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.d.ts +5 -5
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +12 -12
- package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js +3 -7
- package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js +8 -53
- package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/helpers/getSegmentationRepresentationRenderingConfig.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/helpers/{getRepresentationRenderingConfig.js → getSegmentationRepresentationRenderingConfig.js} +2 -2
- package/dist/esm/stateManagement/segmentation/helpers/normalizeSegmentationInput.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/index.d.ts +3 -3
- package/dist/esm/stateManagement/segmentation/index.js +3 -3
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js +3 -3
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +12 -21
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +2 -6
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +8 -13
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +2 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +4 -3
- package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +1 -1
- package/dist/esm/stateManagement/segmentation/removeSegmentationRepresentations.d.ts +2 -0
- package/dist/esm/stateManagement/segmentation/{removeRepresentationsFromViewport.js → removeSegmentationRepresentations.js} +9 -6
- package/dist/esm/stateManagement/segmentation/segmentIndex.js +2 -2
- package/dist/esm/stateManagement/segmentation/segmentLocking.d.ts +2 -2
- package/dist/esm/stateManagement/segmentation/segmentLocking.js +2 -2
- package/dist/esm/stateManagement/segmentation/segmentationState.d.ts +16 -16
- package/dist/esm/stateManagement/segmentation/segmentationState.js +30 -30
- package/dist/esm/store/SynchronizerManager/Synchronizer.d.ts +7 -3
- package/dist/esm/store/SynchronizerManager/Synchronizer.js +2 -1
- package/dist/esm/store/SynchronizerManager/createSynchronizer.d.ts +3 -3
- package/dist/esm/store/SynchronizerManager/createSynchronizer.js +1 -1
- package/dist/esm/store/SynchronizerManager/getAllSynchronizers.d.ts +1 -1
- package/dist/esm/store/SynchronizerManager/getSynchronizer.d.ts +1 -1
- package/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/ToolGroup.d.ts +3 -3
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +5 -2
- package/dist/esm/store/ToolGroupManager/createToolGroup.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/destroyToolGroup.js +1 -0
- package/dist/esm/store/ToolGroupManager/getAllToolGroups.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroup.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.d.ts +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.d.ts +1 -1
- package/dist/esm/store/addEnabledElement.d.ts +1 -1
- package/dist/esm/store/addEnabledElement.js +1 -1
- package/dist/esm/store/addTool.js +0 -3
- package/dist/esm/store/filterMoveableAnnotationTools.d.ts +1 -1
- package/dist/esm/store/filterToolsWithAnnotationsForElement.d.ts +1 -1
- package/dist/esm/store/filterToolsWithMoveableHandles.d.ts +1 -1
- package/dist/esm/store/removeEnabledElement.d.ts +1 -1
- package/dist/esm/store/removeEnabledElement.js +1 -1
- package/dist/esm/store/state.d.ts +4 -3
- package/dist/esm/store/state.js +1 -1
- package/dist/esm/synchronizers/callbacks/areViewportsCoplanar .d.ts +1 -1
- package/dist/esm/synchronizers/callbacks/cameraSyncCallback.d.ts +2 -2
- package/dist/esm/synchronizers/callbacks/imageSliceSyncCallback.d.ts +2 -2
- package/dist/esm/synchronizers/callbacks/presentationViewSyncCallback.d.ts +1 -1
- package/dist/esm/synchronizers/callbacks/slabThicknessSyncCallback.d.ts +1 -1
- package/dist/esm/synchronizers/callbacks/voiSyncCallback.d.ts +5 -2
- package/dist/esm/synchronizers/callbacks/zoomPanSyncCallback.d.ts +2 -2
- package/dist/esm/synchronizers/synchronizers/createCameraPositionSynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createImageSliceSynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.d.ts +2 -2
- package/dist/esm/synchronizers/synchronizers/createPresentationViewSynchronizer.js +1 -1
- package/dist/esm/synchronizers/synchronizers/createSlabThicknessSynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createVOISynchronizer.d.ts +1 -1
- package/dist/esm/synchronizers/synchronizers/createZoomPanSynchronizer.d.ts +1 -1
- package/dist/esm/tools/AdvancedMagnifyTool.d.ts +4 -6
- package/dist/esm/tools/AdvancedMagnifyViewport.js +1 -1
- package/dist/esm/tools/AdvancedMagnifyViewportManager.d.ts +3 -2
- package/dist/esm/tools/AdvancedMagnifyViewportManager.js +1 -1
- package/dist/esm/tools/AnnotationEraserTool.d.ts +1 -1
- package/dist/esm/tools/CrosshairsTool.d.ts +5 -5
- package/dist/esm/tools/CrosshairsTool.js +4 -3
- package/dist/esm/tools/MIPJumpToClickTool.d.ts +1 -2
- package/dist/esm/tools/MIPJumpToClickTool.js +2 -3
- package/dist/esm/tools/MagnifyTool.d.ts +2 -3
- package/dist/esm/tools/OrientationMarkerTool.d.ts +41 -58
- package/dist/esm/tools/OrientationMarkerTool.js +8 -7
- package/dist/esm/tools/OverlayGridTool.d.ts +2 -4
- package/dist/esm/tools/OverlayGridTool.js +1 -1
- package/dist/esm/tools/PanTool.d.ts +1 -1
- package/dist/esm/tools/PanTool.js +5 -0
- package/dist/esm/tools/PlanarRotateTool.d.ts +3 -1
- package/dist/esm/tools/PlanarRotateTool.js +18 -4
- package/dist/esm/tools/ReferenceCursors.d.ts +2 -5
- package/dist/esm/tools/ReferenceLinesTool.d.ts +4 -6
- package/dist/esm/tools/ReferenceLinesTool.js +1 -1
- package/dist/esm/tools/ScaleOverlayTool.d.ts +7 -9
- package/dist/esm/tools/ScaleOverlayTool.js +1 -2
- package/dist/esm/tools/SculptorTool/CircleSculptCursor.d.ts +4 -4
- package/dist/esm/tools/SculptorTool.d.ts +1 -1
- package/dist/esm/tools/SegmentationIntersectionTool.d.ts +2 -2
- package/dist/esm/tools/StackScrollTool.d.ts +2 -1
- package/dist/esm/tools/StackScrollTool.js +17 -3
- package/dist/esm/tools/StackScrollToolMouseWheelTool.d.ts +1 -2
- package/dist/esm/tools/StackScrollToolMouseWheelTool.js +1 -2
- package/dist/esm/tools/TrackballRotateTool.d.ts +1 -1
- package/dist/esm/tools/TrackballRotateTool.js +4 -0
- package/dist/esm/tools/VolumeRotateMouseWheelTool.d.ts +2 -3
- package/dist/esm/tools/WindowLevelRegionTool.d.ts +3 -3
- package/dist/esm/tools/WindowLevelRegionTool.js +1 -3
- package/dist/esm/tools/WindowLevelTool.d.ts +1 -1
- package/dist/esm/tools/WindowLevelTool.js +12 -7
- package/dist/esm/tools/ZoomTool.d.ts +2 -2
- package/dist/esm/tools/ZoomTool.js +2 -2
- package/dist/esm/tools/annotation/AngleTool.d.ts +5 -7
- package/dist/esm/tools/annotation/ArrowAnnotateTool.d.ts +5 -7
- package/dist/esm/tools/annotation/BidirectionalTool.d.ts +5 -7
- package/dist/esm/tools/annotation/CircleROITool.d.ts +5 -7
- package/dist/esm/tools/annotation/CircleROITool.js +8 -5
- package/dist/esm/tools/annotation/CobbAngleTool.d.ts +5 -7
- package/dist/esm/tools/annotation/DragProbeTool.d.ts +3 -5
- package/dist/esm/tools/annotation/DragProbeTool.js +0 -5
- package/dist/esm/tools/annotation/EllipticalROITool.d.ts +5 -7
- package/dist/esm/tools/annotation/EllipticalROITool.js +8 -3
- package/dist/esm/tools/annotation/HeightTool.d.ts +36 -0
- package/dist/esm/tools/annotation/HeightTool.js +435 -0
- package/dist/esm/tools/annotation/KeyImageTool.d.ts +4 -6
- package/dist/esm/tools/annotation/LengthTool.d.ts +5 -7
- package/dist/esm/tools/annotation/LengthTool.js +7 -5
- package/dist/esm/tools/annotation/LivewireContourTool.d.ts +3 -4
- package/dist/esm/tools/annotation/LivewireContourTool.js +2 -1
- package/dist/esm/tools/annotation/PlanarFreehandROITool.d.ts +21 -4
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +155 -113
- package/dist/esm/tools/annotation/ProbeTool.d.ts +4 -6
- package/dist/esm/tools/annotation/ProbeTool.js +14 -29
- package/dist/esm/tools/annotation/RectangleROITool.d.ts +5 -5
- package/dist/esm/tools/annotation/RectangleROITool.js +7 -3
- package/dist/esm/tools/annotation/SplineContourSegmentationTool.d.ts +1 -1
- package/dist/esm/tools/annotation/SplineROITool.d.ts +1 -3
- package/dist/esm/tools/annotation/SplineROITool.js +2 -2
- package/dist/esm/tools/annotation/UltrasoundDirectionalTool.d.ts +5 -7
- package/dist/esm/tools/annotation/VideoRedactionTool.d.ts +4 -5
- package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.d.ts +1 -1
- package/dist/esm/tools/annotation/splines/CardinalSpline.d.ts +1 -1
- package/dist/esm/tools/annotation/splines/CubicSpline.d.ts +1 -1
- package/dist/esm/tools/annotation/splines/QuadraticSpline.d.ts +1 -1
- package/dist/esm/tools/annotation/splines/Spline.d.ts +1 -1
- package/dist/esm/tools/base/AnnotationDisplayTool.d.ts +3 -3
- package/dist/esm/tools/base/AnnotationDisplayTool.js +3 -9
- package/dist/esm/tools/base/AnnotationTool.d.ts +3 -14
- package/dist/esm/tools/base/BaseTool.d.ts +5 -5
- package/dist/esm/tools/base/BaseTool.js +1 -1
- package/dist/esm/tools/base/ContourBaseTool.d.ts +1 -1
- package/dist/esm/tools/base/ContourBaseTool.js +3 -3
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js +10 -10
- package/dist/esm/tools/displayTools/Contour/contourConfig.d.ts +1 -1
- package/dist/esm/tools/displayTools/Contour/contourDisplay.d.ts +2 -2
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js +2 -1
- package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.d.ts +2 -2
- package/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.js +4 -4
- package/dist/esm/tools/displayTools/Contour/contourHandler/utils.d.ts +1 -1
- package/dist/esm/tools/displayTools/Contour/removeContourFromElement.js +2 -2
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.d.ts +1 -1
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +3 -3
- package/dist/esm/tools/displayTools/Labelmap/labelmapConfig.d.ts +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.d.ts +5 -5
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +10 -8
- package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.d.ts +2 -2
- package/dist/esm/tools/displayTools/Surface/surfaceConfig.d.ts +1 -1
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.d.ts +2 -2
- package/dist/esm/tools/distancePointToContour.d.ts +1 -1
- package/dist/esm/tools/index.d.ts +2 -1
- package/dist/esm/tools/index.js +2 -1
- package/dist/esm/tools/segmentation/BrushTool.js +5 -5
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.d.ts +20 -15
- package/dist/esm/tools/segmentation/CircleROIStartEndThresholdTool.js +199 -67
- package/dist/esm/tools/segmentation/CircleScissorsTool.d.ts +3 -3
- package/dist/esm/tools/segmentation/CircleScissorsTool.js +10 -3
- package/dist/esm/tools/segmentation/PaintFillTool.d.ts +1 -1
- package/dist/esm/tools/segmentation/PaintFillTool.js +15 -14
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.d.ts +20 -10
- package/dist/esm/tools/segmentation/RectangleROIStartEndThresholdTool.js +174 -55
- package/dist/esm/tools/segmentation/RectangleROIThresholdTool.d.ts +3 -3
- package/dist/esm/tools/segmentation/RectangleScissorsTool.d.ts +4 -3
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js +8 -5
- package/dist/esm/tools/segmentation/SegmentSelectTool.d.ts +2 -2
- package/dist/esm/tools/segmentation/SegmentSelectTool.js +2 -2
- package/dist/esm/tools/segmentation/SphereScissorsTool.d.ts +3 -2
- package/dist/esm/tools/segmentation/SphereScissorsTool.js +12 -4
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.d.ts +4 -5
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +3 -1
- package/dist/esm/tools/segmentation/strategies/compositions/determineSegmentIndex.js +6 -3
- package/dist/esm/tools/segmentation/strategies/compositions/dynamicThreshold.js +1 -1
- package/dist/esm/tools/segmentation/strategies/compositions/islandRemoval.js +1 -1
- package/dist/esm/tools/segmentation/strategies/compositions/preview.js +2 -2
- package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js +6 -3
- package/dist/esm/tools/segmentation/strategies/compositions/setValue.js +1 -1
- package/dist/esm/tools/segmentation/strategies/eraseRectangle.d.ts +1 -1
- package/dist/esm/tools/segmentation/strategies/fillCircle.js +1 -1
- package/dist/esm/tools/segmentation/strategies/fillRectangle.d.ts +1 -1
- package/dist/esm/tools/segmentation/strategies/fillRectangle.js +10 -7
- package/dist/esm/tools/segmentation/strategies/fillSphere.js +1 -1
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.d.ts +1 -1
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +7 -24
- package/dist/esm/tools/segmentation/strategies/utils/isWithinThreshold.d.ts +9 -2
- package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +3 -3
- package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js +0 -3
- package/dist/esm/types/AnnotationGroupSelector.d.ts +1 -1
- package/dist/esm/types/AnnotationRenderContext.d.ts +3 -2
- package/dist/esm/types/AnnotationStyle.d.ts +2 -2
- package/dist/esm/types/AnnotationTypes.d.ts +3 -3
- package/dist/esm/types/BoundsIJK.d.ts +1 -1
- package/dist/esm/types/CINETypes.d.ts +1 -0
- package/dist/esm/types/CalculatorTypes.d.ts +1 -1
- package/dist/esm/types/CardinalSplineProps.d.ts +1 -1
- package/dist/esm/types/ClosestPoint.d.ts +1 -1
- package/dist/esm/types/ContourAnnotation.d.ts +1 -1
- package/dist/esm/types/ContourSegmentationAnnotation.d.ts +2 -2
- package/dist/esm/types/ControlPointInfo.d.ts +1 -1
- package/dist/esm/types/EventTypes.d.ts +13 -12
- package/dist/esm/types/FloodFillTypes.d.ts +2 -2
- package/dist/esm/types/IAnnotationManager.d.ts +3 -3
- package/dist/esm/types/IDistance.d.ts +1 -1
- package/dist/esm/types/IPoints.d.ts +2 -2
- package/dist/esm/types/ISetToolModeOptions.d.ts +2 -2
- package/dist/esm/types/ISpline.d.ts +1 -1
- package/dist/esm/types/ISynchronizerEventHandler.d.ts +3 -3
- package/dist/esm/types/IToolClassReference.d.ts +3 -3
- package/dist/esm/types/IToolGroup.d.ts +8 -8
- package/dist/esm/types/ITouchPoints.d.ts +2 -2
- package/dist/esm/types/InteractionTypes.d.ts +1 -1
- package/dist/esm/types/InternalToolTypes.d.ts +4 -4
- package/dist/esm/types/InterpolationTypes.d.ts +3 -3
- package/dist/esm/types/JumpToSliceOptions.d.ts +1 -1
- package/dist/esm/types/LabelmapToolOperationData.d.ts +3 -2
- package/dist/esm/types/PlanarBoundingBox.d.ts +1 -1
- package/dist/esm/types/SVGDrawingHelper.d.ts +1 -1
- package/dist/esm/types/ScrollOptions.d.ts +1 -1
- package/dist/esm/types/SegmentationStateTypes.d.ts +7 -6
- package/dist/esm/types/SplineCurveSegment.d.ts +1 -1
- package/dist/esm/types/SplineLineSegment.d.ts +1 -1
- package/dist/esm/types/ToolAction.d.ts +1 -1
- package/dist/esm/types/ToolHandle.d.ts +1 -1
- package/dist/esm/types/ToolProps.d.ts +1 -1
- package/dist/esm/types/ToolSpecificAnnotationTypes.d.ts +34 -12
- package/dist/esm/types/index.d.ts +2 -2
- package/dist/esm/utilities/annotationFrameRange.d.ts +1 -1
- package/dist/esm/utilities/annotationHydration.d.ts +3 -2
- package/dist/esm/utilities/cine/playClip.d.ts +6 -2
- package/dist/esm/utilities/cine/playClip.js +53 -6
- package/dist/esm/utilities/cine/state.d.ts +1 -1
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +1 -1
- package/dist/esm/utilities/contourSegmentation/areSameSegment.d.ts +1 -1
- package/dist/esm/utilities/contourSegmentation/isContourSegmentationAnnotation.d.ts +2 -2
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +1 -1
- package/dist/esm/utilities/contours/AnnotationToPointData.d.ts +1 -1
- package/dist/esm/utilities/contours/areCoplanarContours.d.ts +1 -1
- package/dist/esm/utilities/contours/findHandlePolylineIndex.d.ts +1 -1
- package/dist/esm/utilities/contours/interpolation/createPolylineToolData.d.ts +1 -1
- package/dist/esm/utilities/contours/interpolation/getInterpolationData.d.ts +1 -1
- package/dist/esm/utilities/contours/interpolation/interpolate.d.ts +1 -1
- package/dist/esm/utilities/contours/reverseIfAntiClockwise.d.ts +1 -1
- package/dist/esm/utilities/contours/updateContourPolyline.d.ts +1 -1
- package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.d.ts +3 -2
- package/dist/esm/utilities/dynamicVolume/generateImageFromTimeData.js +31 -23
- package/dist/esm/utilities/dynamicVolume/getDataInTime.d.ts +1 -1
- package/dist/esm/utilities/dynamicVolume/getDataInTime.js +14 -9
- package/dist/esm/utilities/getAnnotationNearPoint.d.ts +1 -1
- package/dist/esm/utilities/getCalibratedUnits.d.ts +0 -6
- package/dist/esm/utilities/getCalibratedUnits.js +13 -4
- package/dist/esm/utilities/getPixelValueUnits.d.ts +2 -1
- package/dist/esm/utilities/getPixelValueUnits.js +1 -0
- package/dist/esm/utilities/getSphereBoundsInfo.d.ts +1 -1
- package/dist/esm/utilities/getToolsWithModesForElement.d.ts +1 -1
- package/dist/esm/utilities/getVOIMultipliers.d.ts +1 -1
- package/dist/esm/utilities/index.d.ts +1 -3
- package/dist/esm/utilities/index.js +1 -3
- package/dist/esm/utilities/livewire/LiveWirePath.d.ts +1 -1
- package/dist/esm/utilities/livewire/LivewireScissors.d.ts +1 -1
- package/dist/esm/utilities/math/aabb/distanceToPoint.d.ts +1 -1
- package/dist/esm/utilities/math/aabb/distanceToPointSquared.d.ts +1 -1
- package/dist/esm/utilities/math/aabb/intersectAABB.d.ts +1 -1
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.d.ts +2 -2
- package/dist/esm/utilities/math/basic/BasicStatsCalculator.js +1 -1
- package/dist/esm/utilities/math/basic/Calculator.d.ts +1 -1
- package/dist/esm/utilities/math/circle/getCanvasCircleCorners.d.ts +1 -1
- package/dist/esm/utilities/math/circle/getCanvasCircleRadius.d.ts +1 -1
- package/dist/esm/utilities/math/line/distanceToPointSquared.d.ts +1 -1
- package/dist/esm/utilities/math/midPoint.d.ts +1 -1
- package/dist/esm/utilities/math/point/mirror.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/addCanvasPointsToArray.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/combinePolyline.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getAABB.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getLinesIntersection.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getNormal2.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/getNormal3.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/intersectPolyline.d.ts +1 -1
- package/dist/esm/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +2 -2
- package/dist/esm/utilities/math/sphere/pointInSphere.d.ts +1 -1
- package/dist/esm/utilities/orientation/getOrientationStringLPS.d.ts +1 -1
- package/dist/esm/utilities/planar/filterAnnotationsForDisplay.d.ts +1 -1
- package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.d.ts +3 -0
- package/dist/esm/utilities/planar/filterAnnotationsWithinPlane.js +26 -0
- package/dist/esm/utilities/planar/filterAnnotationsWithinSlice.d.ts +1 -1
- package/dist/esm/utilities/planar/index.d.ts +3 -1
- package/dist/esm/utilities/planar/index.js +3 -1
- package/dist/esm/utilities/planarFreehandROITool/interpolation/algorithms/bspline.d.ts +1 -1
- package/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.d.ts +1 -1
- package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.d.ts +2 -2
- package/dist/esm/utilities/planarFreehandROITool/smoothPoints.d.ts +11 -3
- package/dist/esm/utilities/polyData/utils.d.ts +1 -1
- package/dist/esm/utilities/scroll.d.ts +4 -3
- package/dist/esm/utilities/scroll.js +3 -10
- package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.d.ts +1 -1
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.d.ts +2 -11
- package/dist/esm/utilities/segmentation/createLabelmapVolumeForViewport.js +1 -1
- package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.d.ts +1 -1
- package/dist/esm/utilities/segmentation/createMergedLabelmapForIndex.js +7 -7
- package/dist/esm/utilities/segmentation/floodFill.d.ts +1 -1
- package/dist/esm/utilities/segmentation/getDefaultRepresentationConfig.d.ts +1 -1
- package/dist/esm/utilities/segmentation/getSegmentIndexAtLabelmapBorder.js +8 -5
- package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.d.ts +1 -1
- package/dist/esm/utilities/segmentation/getSegmentIndexAtWorldPoint.js +7 -4
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +4 -5
- package/dist/esm/utilities/segmentation/index.d.ts +2 -2
- package/dist/esm/utilities/segmentation/index.js +2 -2
- package/dist/esm/utilities/segmentation/isValidRepresentationConfig.d.ts +1 -1
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.d.ts +1 -1
- package/dist/esm/utilities/segmentation/rectangleROIThresholdVolumeByRange.js +3 -2
- package/dist/esm/utilities/segmentation/segmentContourAction.d.ts +1 -1
- package/dist/esm/utilities/segmentation/segmentContourAction.js +4 -4
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.d.ts +2 -2
- package/dist/esm/utilities/segmentation/thresholdSegmentationByRange.js +24 -17
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.d.ts +3 -3
- package/dist/esm/utilities/segmentation/thresholdVolumeByRange.js +21 -12
- package/dist/esm/utilities/segmentation/triggerSegmentationRender.d.ts +3 -3
- package/dist/esm/utilities/segmentation/triggerSegmentationRender.js +7 -5
- package/dist/esm/utilities/segmentation/utilities.d.ts +12 -2
- package/dist/esm/utilities/segmentation/utilities.js +5 -6
- package/dist/esm/utilities/stackPrefetch/stackContextPrefetch.js +30 -25
- package/dist/esm/utilities/stackPrefetch/stackPrefetch.js +3 -8
- package/dist/esm/utilities/stackPrefetch/stackPrefetchUtils.js +2 -3
- package/dist/esm/utilities/stackPrefetch/state.d.ts +20 -1
- package/dist/esm/utilities/touch/index.d.ts +1 -1
- package/dist/esm/utilities/triggerAnnotationRender.d.ts +0 -20
- package/dist/esm/utilities/triggerAnnotationRender.js +1 -112
- package/dist/esm/utilities/viewport/isViewportPreScaled.d.ts +1 -1
- package/dist/esm/utilities/viewport/isViewportPreScaled.js +2 -5
- package/dist/esm/utilities/viewport/jumpToSlice.d.ts +1 -1
- package/dist/esm/utilities/viewport/jumpToSlice.js +4 -6
- package/dist/esm/utilities/voi/colorbar/ColorbarCanvas.d.ts +2 -2
- package/dist/esm/utilities/voi/colorbar/ViewportColorbar.d.ts +1 -1
- package/dist/esm/utilities/voi/colorbar/ViewportColorbar.js +1 -1
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCanvasProps.d.ts +1 -1
- package/dist/esm/utilities/voi/colorbar/types/ColorbarCommonProps.d.ts +1 -1
- package/dist/esm/utilities/voi/colorbar/types/ColorbarProps.d.ts +3 -3
- package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.d.ts +8 -0
- package/dist/esm/utilities/voi/windowlevel/extractWindowLevelRegionToolData.js +4 -10
- package/dist/esm/widgets/types/index.d.ts +2 -2
- package/dist/esm/workers/polySegConverters.js +65 -32
- package/dist/umd/78.index.js +1 -1
- package/dist/umd/78.index.js.map +1 -1
- package/dist/umd/985.index.js +1 -1
- package/dist/umd/985.index.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +5 -7
- package/dist/esm/stateManagement/segmentation/addRepresentation.d.ts +0 -3
- package/dist/esm/stateManagement/segmentation/addRepresentations.d.ts +0 -3
- package/dist/esm/stateManagement/segmentation/addRepresentations.js +0 -9
- package/dist/esm/stateManagement/segmentation/helpers/getRepresentationRenderingConfig.d.ts +0 -2
- package/dist/esm/stateManagement/segmentation/removeRepresentationsFromViewport.d.ts +0 -2
- package/dist/esm/utilities/pointInShapeCallback.d.ts +0 -18
- package/dist/esm/utilities/pointInShapeCallback.js +0 -82
- package/dist/esm/utilities/pointInSurroundingSphereCallback.d.ts +0 -4
- package/dist/esm/utilities/pointInSurroundingSphereCallback.js +0 -63
- package/dist/esm/utilities/segmentation/triggerSegmentationRenderForViewports.d.ts +0 -3
- package/dist/esm/utilities/segmentation/triggerSegmentationRenderForViewports.js +0 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import BaseTool from './BaseTool';
|
|
3
|
-
import { Annotation, Annotations, SVGDrawingHelper } from '../../types';
|
|
4
|
-
import { StyleSpecifier } from '../../types/AnnotationStyle';
|
|
3
|
+
import type { Annotation, Annotations, SVGDrawingHelper } from '../../types';
|
|
4
|
+
import type { StyleSpecifier } from '../../types/AnnotationStyle';
|
|
5
5
|
declare abstract class AnnotationDisplayTool extends BaseTool {
|
|
6
6
|
static toolName: any;
|
|
7
7
|
abstract renderAnnotation(enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper): any;
|
|
8
8
|
filterInteractableAnnotationsForElement(element: HTMLDivElement, annotations: Annotations): Annotations | undefined;
|
|
9
9
|
onImageSpacingCalibrated: (evt: Types.EventTypes.ImageSpacingCalibratedEvent) => void;
|
|
10
|
-
protected getReferencedImageId(viewport: Types.IViewport, worldPos: Types.Point3, viewPlaneNormal: Types.Point3, viewUp
|
|
10
|
+
protected getReferencedImageId(viewport: Types.IViewport, worldPos: Types.Point3, viewPlaneNormal: Types.Point3, viewUp?: Types.Point3): string;
|
|
11
11
|
getStyle(property: string, specifications: StyleSpecifier, annotation?: Annotation): unknown;
|
|
12
12
|
}
|
|
13
13
|
export default AnnotationDisplayTool;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { utilities, getEnabledElement, StackViewport, cache, VideoViewport, } from '@cornerstonejs/core';
|
|
1
|
+
import { utilities, getEnabledElement, StackViewport, cache, VideoViewport, BaseVolumeViewport, } from '@cornerstonejs/core';
|
|
2
2
|
import BaseTool from './BaseTool';
|
|
3
3
|
import { getAnnotationManager } from '../../stateManagement/annotation/annotationState';
|
|
4
4
|
import triggerAnnotationRender from '../../utilities/triggerAnnotationRender';
|
|
@@ -43,14 +43,8 @@ class AnnotationDisplayTool extends BaseTool {
|
|
|
43
43
|
}
|
|
44
44
|
getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp) {
|
|
45
45
|
const targetId = this.getTargetId(viewport);
|
|
46
|
-
let referencedImageId;
|
|
47
|
-
if (viewport instanceof
|
|
48
|
-
referencedImageId = targetId.split('imageId:')[1];
|
|
49
|
-
}
|
|
50
|
-
else if (viewport instanceof VideoViewport) {
|
|
51
|
-
referencedImageId = targetId.split('videoId:')[1];
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
46
|
+
let referencedImageId = targetId.split(/^[a-zA-Z]+:/)[1];
|
|
47
|
+
if (viewport instanceof BaseVolumeViewport) {
|
|
54
48
|
const volumeId = utilities.getVolumeId(targetId);
|
|
55
49
|
const imageVolume = cache.getVolume(volumeId);
|
|
56
50
|
referencedImageId = utilities.getClosestImageId(imageVolume, worldPos, viewPlaneNormal);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import AnnotationDisplayTool from './AnnotationDisplayTool';
|
|
3
|
-
import { Annotation, Annotations, EventTypes, ToolHandle, InteractionTypes, ToolProps, PublicToolProps } from '../../types';
|
|
4
|
-
import { StyleSpecifier } from '../../types/AnnotationStyle';
|
|
3
|
+
import type { Annotation, Annotations, EventTypes, ToolHandle, InteractionTypes, ToolProps, PublicToolProps } from '../../types';
|
|
4
|
+
import type { AnnotationStyle, StyleSpecifier } from '../../types/AnnotationStyle';
|
|
5
5
|
declare abstract class AnnotationTool extends AnnotationDisplayTool {
|
|
6
6
|
static createAnnotation(...annotationBaseData: any[]): Annotation;
|
|
7
7
|
static createAnnotationForViewport(viewport: any, ...annotationBaseData: any[]): Annotation;
|
|
@@ -20,18 +20,7 @@ declare abstract class AnnotationTool extends AnnotationDisplayTool {
|
|
|
20
20
|
protected getAnnotationStyle(context: {
|
|
21
21
|
annotation: Annotation;
|
|
22
22
|
styleSpecifier: StyleSpecifier;
|
|
23
|
-
}):
|
|
24
|
-
visibility: boolean;
|
|
25
|
-
locked: boolean;
|
|
26
|
-
color: string;
|
|
27
|
-
lineWidth: number;
|
|
28
|
-
lineDash: string;
|
|
29
|
-
lineOpacity: number;
|
|
30
|
-
fillColor: string;
|
|
31
|
-
fillOpacity: number;
|
|
32
|
-
shadow: boolean;
|
|
33
|
-
textbox: Record<string, unknown>;
|
|
34
|
-
};
|
|
23
|
+
}): AnnotationStyle;
|
|
35
24
|
private _imagePointNearToolOrHandle;
|
|
36
25
|
}
|
|
37
26
|
export default AnnotationTool;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import ToolModes from '../../enums/ToolModes';
|
|
3
|
-
import StrategyCallbacks from '../../enums/StrategyCallbacks';
|
|
4
|
-
import { InteractionTypes, ToolProps, PublicToolProps } from '../../types';
|
|
3
|
+
import type StrategyCallbacks from '../../enums/StrategyCallbacks';
|
|
4
|
+
import type { InteractionTypes, ToolProps, PublicToolProps } from '../../types';
|
|
5
5
|
export interface IBaseTool {
|
|
6
6
|
toolGroupId: string;
|
|
7
7
|
supportedInteractionTypes: InteractionTypes[];
|
|
8
8
|
mode: ToolModes;
|
|
9
9
|
configuration: {
|
|
10
10
|
preventHandleOutsideImage?: boolean;
|
|
11
|
-
strategies?: Record<string,
|
|
11
|
+
strategies?: Record<string, unknown>;
|
|
12
12
|
defaultStrategy?: string;
|
|
13
13
|
activeStrategy?: string;
|
|
14
14
|
strategyOptions?: Record<string, unknown>;
|
|
@@ -26,7 +26,7 @@ declare abstract class BaseTool implements IBaseTool {
|
|
|
26
26
|
applyActiveStrategyCallback(enabledElement: Types.IEnabledElement, operationData: unknown, callbackType: StrategyCallbacks | string): any;
|
|
27
27
|
setConfiguration(newConfiguration: Record<string, any>): void;
|
|
28
28
|
setActiveStrategy(strategyName: string): void;
|
|
29
|
-
|
|
29
|
+
protected getTargetVolumeId(viewport: Types.IViewport): string | undefined;
|
|
30
30
|
protected getTargetIdImage(targetId: string, renderingEngine: Types.IRenderingEngine): Types.IImageData | Types.CPUIImageData | Types.IImageVolume;
|
|
31
31
|
protected getTargetId(viewport: Types.IViewport): string | undefined;
|
|
32
32
|
}
|
|
@@ -89,7 +89,7 @@ class BaseTool {
|
|
|
89
89
|
if (viewport instanceof BaseVolumeViewport) {
|
|
90
90
|
return `volumeId:${this.getTargetVolumeId(viewport)}`;
|
|
91
91
|
}
|
|
92
|
-
throw new Error('getTargetId: viewport must have a
|
|
92
|
+
throw new Error('getTargetId: viewport must have a getReferenceId method');
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
BaseTool.toolName = 'BaseTool';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import type { Annotation, ContourAnnotation, EventTypes, PublicToolProps, ToolProps, SVGDrawingHelper, AnnotationRenderContext } from '../../types';
|
|
3
3
|
import AnnotationTool from './AnnotationTool';
|
|
4
|
-
import { ContourWindingDirection } from '../../types/ContourAnnotation';
|
|
4
|
+
import type { ContourWindingDirection } from '../../types/ContourAnnotation';
|
|
5
5
|
declare abstract class ContourBaseTool extends AnnotationTool {
|
|
6
6
|
constructor(toolProps: PublicToolProps, defaultToolProps: ToolProps);
|
|
7
7
|
renderAnnotation(enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper): boolean;
|
|
@@ -138,11 +138,11 @@ class ContourBaseTool extends AnnotationTool {
|
|
|
138
138
|
const childContours = getContourHolesDataCanvas(annotation, viewport);
|
|
139
139
|
const allContours = [polylineCanvasPoints, ...childContours];
|
|
140
140
|
drawPathSvg(svgDrawingHelper, annotationUID, 'contourPolyline', allContours, {
|
|
141
|
-
color,
|
|
142
|
-
lineDash,
|
|
141
|
+
color: color,
|
|
142
|
+
lineDash: lineDash,
|
|
143
143
|
lineWidth: Math.max(0.1, lineWidth),
|
|
144
144
|
fillColor: fillColor,
|
|
145
|
-
fillOpacity,
|
|
145
|
+
fillOpacity: fillOpacity,
|
|
146
146
|
});
|
|
147
147
|
return true;
|
|
148
148
|
}
|
|
@@ -6,7 +6,7 @@ import { triggerSegmentationDataModified } from '../../stateManagement/segmentat
|
|
|
6
6
|
import { InterpolationManager } from '../../utilities/contours/interpolation';
|
|
7
7
|
import { addContourSegmentationAnnotation, removeContourSegmentationAnnotation, } from '../../utilities/contourSegmentation';
|
|
8
8
|
import { triggerAnnotationRenderForToolGroupIds } from '../../utilities';
|
|
9
|
-
import {
|
|
9
|
+
import { getActiveSegmentationRepresentation, getSegmentationRepresentationsForSegmentation, getSegmentationRepresentations, getViewportIdsWithSegmentation, } from '../../stateManagement/segmentation/segmentationState';
|
|
10
10
|
import { getToolGroupForViewport } from '../../store/ToolGroupManager';
|
|
11
11
|
class ContourSegmentationBaseTool extends ContourBaseTool {
|
|
12
12
|
constructor(toolProps, defaultToolProps) {
|
|
@@ -30,7 +30,7 @@ class ContourSegmentationBaseTool extends ContourBaseTool {
|
|
|
30
30
|
if (!this.isContourSegmentationTool()) {
|
|
31
31
|
return contourAnnotation;
|
|
32
32
|
}
|
|
33
|
-
const activeSeg = activeSegmentation.
|
|
33
|
+
const activeSeg = activeSegmentation.getActiveSegmentationRepresentation(viewport.id);
|
|
34
34
|
if (!activeSeg) {
|
|
35
35
|
throw new Error('No active segmentation detected, create one before using scissors tool');
|
|
36
36
|
}
|
|
@@ -78,7 +78,7 @@ class ContourSegmentationBaseTool extends ContourBaseTool {
|
|
|
78
78
|
if (invalidated && this.isContourSegmentationTool()) {
|
|
79
79
|
const { segmentationId } = (annotation).data.segmentation;
|
|
80
80
|
triggerSegmentationDataModified(segmentationId);
|
|
81
|
-
const viewportIds =
|
|
81
|
+
const viewportIds = getViewportIdsWithSegmentation(segmentationId);
|
|
82
82
|
const toolGroupIds = viewportIds.map((viewportId) => {
|
|
83
83
|
const toolGroup = getToolGroupForViewport(viewportId);
|
|
84
84
|
return toolGroup.id;
|
|
@@ -91,14 +91,14 @@ class ContourSegmentationBaseTool extends ContourBaseTool {
|
|
|
91
91
|
const annotation = context.annotation;
|
|
92
92
|
const { segmentationId, segmentIndex } = annotation.data.segmentation;
|
|
93
93
|
const segmentation = segmentationState.getSegmentation(segmentationId);
|
|
94
|
-
const segmentationRepresentations =
|
|
94
|
+
const segmentationRepresentations = getSegmentationRepresentationsForSegmentation(segmentationId);
|
|
95
95
|
if (!segmentationRepresentations?.length) {
|
|
96
96
|
return {};
|
|
97
97
|
}
|
|
98
98
|
const allUIDs = segmentationRepresentations.map((rep) => rep.segmentationRepresentationUID);
|
|
99
99
|
let segmentationRepresentation;
|
|
100
100
|
if (segmentationRepresentations.length > 1) {
|
|
101
|
-
const viewportReps =
|
|
101
|
+
const viewportReps = getSegmentationRepresentations(context.styleSpecifier.viewportId);
|
|
102
102
|
segmentationRepresentation = viewportReps.find((rep) => rep.segmentationId === segmentationId &&
|
|
103
103
|
allUIDs.includes(rep.segmentationRepresentationUID));
|
|
104
104
|
}
|
|
@@ -107,19 +107,19 @@ class ContourSegmentationBaseTool extends ContourBaseTool {
|
|
|
107
107
|
}
|
|
108
108
|
const { segmentationRepresentationUID } = segmentationRepresentation;
|
|
109
109
|
const { autoGenerated } = annotation;
|
|
110
|
-
const segmentsLocked = segmentLocking.
|
|
110
|
+
const segmentsLocked = segmentLocking.getLockedSegmentIndices(segmentationId);
|
|
111
111
|
const annotationLocked = segmentsLocked.includes(segmentIndex);
|
|
112
112
|
const segmentColor = segmentationConfig.color.getSegmentIndexColor(segmentationRepresentationUID, segmentIndex);
|
|
113
113
|
const viewportId = context.styleSpecifier.viewportId;
|
|
114
|
-
const segmentationVisible = segmentationConfig.visibility.
|
|
114
|
+
const segmentationVisible = segmentationConfig.visibility.getSegmentationRepresentationVisibility(viewportId, segmentationRepresentationUID);
|
|
115
115
|
const globalConfig = segmentationConfig.getGlobalConfig();
|
|
116
|
-
const
|
|
116
|
+
const getSegmentationRepresentationConfig = segmentationConfig.getSegmentationRepresentationConfig(segmentationRepresentationUID);
|
|
117
117
|
const segmentConfig = segmentationConfig.getSegmentIndexConfig(segmentationRepresentationUID, segmentIndex);
|
|
118
118
|
const segmentVisible = segmentationConfig.visibility.getSegmentIndexVisibility(viewportId, segmentationRepresentationUID, segmentIndex);
|
|
119
|
-
const activeSegRep =
|
|
119
|
+
const activeSegRep = getActiveSegmentationRepresentation(viewportId);
|
|
120
120
|
const isActive = activeSegRep.segmentationRepresentationUID ===
|
|
121
121
|
segmentationRepresentationUID;
|
|
122
|
-
const mergedConfig = Object.assign({}, globalConfig?.representations?.CONTOUR ?? {},
|
|
122
|
+
const mergedConfig = Object.assign({}, globalConfig?.representations?.CONTOUR ?? {}, getSegmentationRepresentationConfig?.CONTOUR ?? {}, segmentConfig?.CONTOUR ?? {});
|
|
123
123
|
let lineWidth = 1;
|
|
124
124
|
let lineDash = undefined;
|
|
125
125
|
let lineOpacity = 1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StackViewport, Types } from '@cornerstonejs/core';
|
|
2
|
-
import { ContourRepresentation } from '../../../types/SegmentationStateTypes';
|
|
1
|
+
import type { StackViewport, Types } from '@cornerstonejs/core';
|
|
2
|
+
import type { ContourRepresentation } from '../../../types/SegmentationStateTypes';
|
|
3
3
|
declare function removeRepresentation(viewportId: string, segmentationRepresentationUID: string, renderImmediate?: boolean): void;
|
|
4
4
|
declare function render(viewport: StackViewport | Types.IVolumeViewport, contourRepresentation: ContourRepresentation): Promise<void>;
|
|
5
5
|
declare const _default: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getEnabledElementByViewportId, } from '@cornerstonejs/core';
|
|
1
|
+
import { getEnabledElementByIds, getEnabledElementByViewportId, } from '@cornerstonejs/core';
|
|
2
2
|
import Representations from '../../../enums/SegmentationRepresentations';
|
|
3
3
|
import * as SegmentationState from '../../../stateManagement/segmentation/segmentationState';
|
|
4
|
+
import removeContourFromElement from './removeContourFromElement';
|
|
4
5
|
import { deleteConfigCache } from './contourHandler/contourConfigCache';
|
|
5
6
|
import { polySeg } from '../../../stateManagement/segmentation';
|
|
6
7
|
import { handleContourSegmentation } from './contourHandler/handleContourSegmentation';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Types, StackViewport } from '@cornerstonejs/core';
|
|
2
|
-
import { ContourRepresentation } from '../../../../types/SegmentationStateTypes';
|
|
1
|
+
import type { Types, StackViewport } from '@cornerstonejs/core';
|
|
2
|
+
import type { ContourRepresentation } from '../../../../types/SegmentationStateTypes';
|
|
3
3
|
declare function handleContourSegmentation(viewport: StackViewport | Types.IVolumeViewport, geometryIds: string[], annotationUIDsMap: Map<number, Set<string>>, contourRepresentation: ContourRepresentation): void;
|
|
4
4
|
declare function updateContourSets(viewport: Types.IVolumeViewport | StackViewport, geometryIds: string[], contourRepresentation: ContourRepresentation): void;
|
|
5
5
|
declare function addContourSetsToElement(viewport: StackViewport | Types.IVolumeViewport, geometryIds: string[], contourRepresentation: ContourRepresentation): void;
|
|
@@ -4,8 +4,8 @@ import { getClosestImageIdForStackViewport } from '../../../../utilities/annotat
|
|
|
4
4
|
import { getConfigCache, setConfigCache } from './contourConfigCache';
|
|
5
5
|
import { addContourSegmentationAnnotation } from '../../../../utilities/contourSegmentation';
|
|
6
6
|
import { validateGeometry } from './utils';
|
|
7
|
-
import { getGlobalConfig, } from '../../../../stateManagement/segmentation/segmentationState';
|
|
8
|
-
import {
|
|
7
|
+
import { getGlobalConfig, getPerSegmentConfig, } from '../../../../stateManagement/segmentation/segmentationState';
|
|
8
|
+
import { getHiddenSegmentIndices } from '../../../../stateManagement/segmentation/config/segmentationVisibility';
|
|
9
9
|
import { getSegmentIndexConfig } from '../../../../stateManagement/segmentation/config';
|
|
10
10
|
function handleContourSegmentation(viewport, geometryIds, annotationUIDsMap, contourRepresentation) {
|
|
11
11
|
const addOrUpdateFn = annotationUIDsMap.size
|
|
@@ -27,7 +27,7 @@ function updateContourSets(viewport, geometryIds, contourRepresentation) {
|
|
|
27
27
|
}
|
|
28
28
|
const segmentsToSetToInvisible = [];
|
|
29
29
|
const segmentsToSetToVisible = [];
|
|
30
|
-
const segmentsHidden =
|
|
30
|
+
const segmentsHidden = getHiddenSegmentIndices(viewport.id, segmentationRepresentationUID);
|
|
31
31
|
for (const segmentIndex of segmentsHidden) {
|
|
32
32
|
if (!cachedConfig.segmentsHidden.has(segmentIndex)) {
|
|
33
33
|
segmentsToSetToInvisible.push(segmentIndex);
|
|
@@ -116,7 +116,7 @@ function addContourSetsToElement(viewport, geometryIds, contourRepresentation) {
|
|
|
116
116
|
const globalContourConfig = getGlobalConfig().representations.CONTOUR;
|
|
117
117
|
const newContourConfig = utilities.deepMerge(globalContourConfig, baseConfig);
|
|
118
118
|
const outlineWidthActive = newContourConfig.outlineWidthActive;
|
|
119
|
-
const segmentsHidden =
|
|
119
|
+
const segmentsHidden = getHiddenSegmentIndices(viewport.id, segmentationRepresentationUID);
|
|
120
120
|
setConfigCache(segmentationRepresentationUID, Object.assign({}, getConfigCache(segmentationRepresentationUID), {
|
|
121
121
|
segmentsHidden: new Set(segmentsHidden),
|
|
122
122
|
segmentSpecificMap,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
|
|
3
3
|
export declare function validateGeometry(geometry: Types.IGeometry): void;
|
|
4
4
|
export declare function getPolyData(contourSet: Types.IContourSet): vtkPolyData;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSegmentationRepresentation, getSegmentation, } from '../../../stateManagement/segmentation/segmentationState';
|
|
2
2
|
import { removeAnnotation } from '../../../stateManagement';
|
|
3
3
|
function removeContourFromElement(element, segmentationRepresentationUID, removeFromCache = false) {
|
|
4
|
-
const segmentationRepresentation =
|
|
4
|
+
const segmentationRepresentation = getSegmentationRepresentation(segmentationRepresentationUID);
|
|
5
5
|
const { segmentationId } = segmentationRepresentation;
|
|
6
6
|
const segmentation = getSegmentation(segmentationId);
|
|
7
7
|
const { annotationUIDsMap } = segmentation.representationData.CONTOUR;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { LabelmapSegmentationData } from '../../../types/LabelmapTypes';
|
|
1
|
+
import type { LabelmapSegmentationData } from '../../../types/LabelmapTypes';
|
|
2
2
|
declare function addLabelmapToElement(element: HTMLDivElement, labelMapData: LabelmapSegmentationData, segmentationRepresentationUID: string): Promise<void>;
|
|
3
3
|
export default addLabelmapToElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getEnabledElement, addVolumesToViewports, addImageSlicesToViewports, Enums, } from '@cornerstonejs/core';
|
|
2
2
|
import { isVolumeSegmentation } from '../../segmentation/strategies/utils/stackVolumeCheck';
|
|
3
|
-
import {
|
|
3
|
+
import { getCurrentLabelmapImageIdForViewport, getSegmentationRepresentation, } from '../../../stateManagement/segmentation/segmentationState';
|
|
4
4
|
async function addLabelmapToElement(element, labelMapData, segmentationRepresentationUID) {
|
|
5
5
|
const enabledElement = getEnabledElement(element);
|
|
6
6
|
const { renderingEngine, viewport } = enabledElement;
|
|
@@ -20,8 +20,8 @@ async function addLabelmapToElement(element, labelMapData, segmentationRepresent
|
|
|
20
20
|
await addVolumesToViewports(renderingEngine, volumeInputs, [viewportId], immediateRender, suppressEvents);
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
|
-
const representation =
|
|
24
|
-
const segmentationImageId =
|
|
23
|
+
const representation = getSegmentationRepresentation(segmentationRepresentationUID);
|
|
24
|
+
const segmentationImageId = getCurrentLabelmapImageIdForViewport(viewport.id, representation.segmentationId);
|
|
25
25
|
const stackInputs = [
|
|
26
26
|
{
|
|
27
27
|
imageId: segmentationImageId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LabelmapConfig } from '../../../types/LabelmapTypes';
|
|
1
|
+
import type { LabelmapConfig } from '../../../types/LabelmapTypes';
|
|
2
2
|
declare function getDefaultLabelmapConfig(): LabelmapConfig;
|
|
3
3
|
declare function isValidLabelmapConfig(config: any): boolean;
|
|
4
4
|
export default getDefaultLabelmapConfig;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunction';
|
|
2
2
|
import vtkColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction';
|
|
3
|
-
import { Types } from '@cornerstonejs/core';
|
|
4
|
-
import { LabelmapRepresentation } from '../../../types/SegmentationStateTypes';
|
|
5
|
-
declare function
|
|
3
|
+
import type { Types } from '@cornerstonejs/core';
|
|
4
|
+
import type { LabelmapRepresentation } from '../../../types/SegmentationStateTypes';
|
|
5
|
+
declare function getSegmentationRepresentationRenderingConfig(): {
|
|
6
6
|
ofun: vtkPiecewiseFunction;
|
|
7
7
|
cfun: vtkColorTransferFunction;
|
|
8
8
|
};
|
|
9
9
|
declare function removeRepresentation(viewportId: string, segmentationRepresentationUID: string, renderImmediate?: boolean): void;
|
|
10
10
|
declare function render(viewport: Types.IStackViewport | Types.IVolumeViewport, representation: LabelmapRepresentation): Promise<void>;
|
|
11
11
|
declare const _default: {
|
|
12
|
-
|
|
12
|
+
getSegmentationRepresentationRenderingConfig: typeof getSegmentationRepresentationRenderingConfig;
|
|
13
13
|
render: typeof render;
|
|
14
14
|
removeRepresentation: typeof removeRepresentation;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
17
|
-
export {
|
|
17
|
+
export { getSegmentationRepresentationRenderingConfig, render, removeRepresentation, };
|
|
@@ -7,10 +7,10 @@ import addLabelmapToElement from './addLabelmapToElement';
|
|
|
7
7
|
import removeLabelmapFromElement from './removeLabelmapFromElement';
|
|
8
8
|
import { isVolumeSegmentation } from '../../segmentation/strategies/utils/stackVolumeCheck';
|
|
9
9
|
import { polySeg } from '../../../stateManagement/segmentation';
|
|
10
|
-
import {
|
|
10
|
+
import { getHiddenSegmentIndices } from '../../../stateManagement/segmentation/config/segmentationVisibility';
|
|
11
11
|
const MAX_NUMBER_COLORS = 255;
|
|
12
12
|
const labelMapConfigCache = new Map();
|
|
13
|
-
function
|
|
13
|
+
function getSegmentationRepresentationRenderingConfig() {
|
|
14
14
|
const cfun = vtkColorTransferFunction.newInstance();
|
|
15
15
|
const ofun = vtkPiecewiseFunction.newInstance();
|
|
16
16
|
ofun.addPoint(0, 0);
|
|
@@ -99,7 +99,7 @@ async function render(viewport, representation) {
|
|
|
99
99
|
if (viewport instanceof VolumeViewport) {
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
const labelmapImageId = SegmentationState.
|
|
102
|
+
const labelmapImageId = SegmentationState.getCurrentLabelmapImageIdForViewport(viewport.id, segmentationId);
|
|
103
103
|
if (!labelmapImageId) {
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
@@ -115,7 +115,7 @@ async function render(viewport, representation) {
|
|
|
115
115
|
}
|
|
116
116
|
function _setLabelmapColorAndOpacity(viewportId, actorEntry, segmentationRepresentation) {
|
|
117
117
|
const { rendering, config, colorLUTIndex } = segmentationRepresentation;
|
|
118
|
-
const activeSegRep = SegmentationState.
|
|
118
|
+
const activeSegRep = SegmentationState.getActiveSegmentationRepresentation(viewportId);
|
|
119
119
|
const isActiveLabelmap = activeSegRep === segmentationRepresentation;
|
|
120
120
|
const { cfun, ofun } = rendering;
|
|
121
121
|
const { allSegments, perSegment } = config;
|
|
@@ -131,7 +131,7 @@ function _setLabelmapColorAndOpacity(viewportId, actorEntry, segmentationReprese
|
|
|
131
131
|
const numColors = Math.min(256, colorLUT.length);
|
|
132
132
|
const { uid: actorUID } = actorEntry;
|
|
133
133
|
const { outlineWidth, renderOutline, outlineOpacity, activeSegmentOutlineWidthDelta, } = _getLabelmapConfig(labelmapConfig, isActiveLabelmap);
|
|
134
|
-
const segmentsHidden =
|
|
134
|
+
const segmentsHidden = getHiddenSegmentIndices(viewportId, segmentationRepresentation.segmentationRepresentationUID);
|
|
135
135
|
for (let i = 0; i < numColors; i++) {
|
|
136
136
|
const segmentIndex = i;
|
|
137
137
|
const segmentColor = colorLUT[segmentIndex];
|
|
@@ -237,7 +237,8 @@ function _needsTransferFunctionUpdate(viewportId, actorUID, segmentIndex, { fill
|
|
|
237
237
|
oldFillAlpha !== fillAlpha ||
|
|
238
238
|
oldRenderFill !== renderFill ||
|
|
239
239
|
oldRenderOutline !== renderOutline ||
|
|
240
|
-
oldOutlineWidth !== outlineWidth
|
|
240
|
+
oldOutlineWidth !== outlineWidth;
|
|
241
|
+
if (forceOpacityUpdate || forceColorUpdate) {
|
|
241
242
|
labelMapConfigCache.set(cacheUID, {
|
|
242
243
|
fillAlpha,
|
|
243
244
|
renderFill,
|
|
@@ -245,6 +246,7 @@ function _needsTransferFunctionUpdate(viewportId, actorUID, segmentIndex, { fill
|
|
|
245
246
|
outlineWidth,
|
|
246
247
|
segmentColor: segmentColor.slice(),
|
|
247
248
|
});
|
|
249
|
+
}
|
|
248
250
|
return {
|
|
249
251
|
forceOpacityUpdate,
|
|
250
252
|
forceColorUpdate,
|
|
@@ -254,8 +256,8 @@ async function _addLabelmapToViewport(viewport, labelmapData, segmentationRepres
|
|
|
254
256
|
await addLabelmapToElement(viewport.element, labelmapData, segmentationRepresentationUID);
|
|
255
257
|
}
|
|
256
258
|
export default {
|
|
257
|
-
|
|
259
|
+
getSegmentationRepresentationRenderingConfig,
|
|
258
260
|
render,
|
|
259
261
|
removeRepresentation,
|
|
260
262
|
};
|
|
261
|
-
export {
|
|
263
|
+
export { getSegmentationRepresentationRenderingConfig, render, removeRepresentation, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SegmentationPublicInput } from '../../../types/SegmentationStateTypes';
|
|
2
|
-
import { LabelmapSegmentationData } from '../../../types/LabelmapTypes';
|
|
1
|
+
import type { SegmentationPublicInput } from '../../../types/SegmentationStateTypes';
|
|
2
|
+
import type { LabelmapSegmentationData } from '../../../types/LabelmapTypes';
|
|
3
3
|
export declare function validatePublic(segmentationInput: SegmentationPublicInput): void;
|
|
4
4
|
export declare function validate(segmentationRepresentationData: LabelmapSegmentationData): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
2
|
-
import { SegmentationRepresentation } from '../../../types/SegmentationStateTypes';
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import type { SegmentationRepresentation } from '../../../types/SegmentationStateTypes';
|
|
3
3
|
declare function removeRepresentation(viewportId: string, segmentationRepresentationUID: string, renderImmediate?: boolean): void;
|
|
4
4
|
declare function render(viewport: Types.IVolumeViewport | Types.IStackViewport, representation: SegmentationRepresentation): Promise<void>;
|
|
5
5
|
declare const _default: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
|
-
import { ContourAnnotationData } from '../types';
|
|
2
|
+
import type { ContourAnnotationData } from '../types';
|
|
3
3
|
export declare const distancePointToContour: (viewport: Types.IViewport, annotation: ContourAnnotationData, coords: Types.Point2) => number;
|
|
@@ -21,6 +21,7 @@ import ScaleOverlayTool from './ScaleOverlayTool';
|
|
|
21
21
|
import SculptorTool from './SculptorTool';
|
|
22
22
|
import BidirectionalTool from './annotation/BidirectionalTool';
|
|
23
23
|
import LengthTool from './annotation/LengthTool';
|
|
24
|
+
import HeightTool from './annotation/HeightTool';
|
|
24
25
|
import ProbeTool from './annotation/ProbeTool';
|
|
25
26
|
import DragProbeTool from './annotation/DragProbeTool';
|
|
26
27
|
import RectangleROITool from './annotation/RectangleROITool';
|
|
@@ -48,4 +49,4 @@ import BrushTool from './segmentation/BrushTool';
|
|
|
48
49
|
import PaintFillTool from './segmentation/PaintFillTool';
|
|
49
50
|
import OrientationMarkerTool from './OrientationMarkerTool';
|
|
50
51
|
import SegmentSelectTool from './segmentation/SegmentSelectTool';
|
|
51
|
-
export { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, WindowLevelRegionTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, ReferenceCursors, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, SegmentationIntersectionTool, BidirectionalTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, SplineROITool, PlanarFreehandROITool, PlanarFreehandContourSegmentationTool, LivewireContourTool, LivewireContourSegmentationTool, ArrowAnnotateTool, AngleTool, CobbAngleTool, UltrasoundDirectionalTool, KeyImageTool, AnnotationEraserTool as EraserTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, CircleROIStartEndThresholdTool, SplineContourSegmentationTool, BrushTool, MagnifyTool, AdvancedMagnifyTool, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, SculptorTool, SegmentSelectTool, };
|
|
52
|
+
export { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, WindowLevelRegionTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, ReferenceCursors, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, SegmentationIntersectionTool, BidirectionalTool, LengthTool, HeightTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, SplineROITool, PlanarFreehandROITool, PlanarFreehandContourSegmentationTool, LivewireContourTool, LivewireContourSegmentationTool, ArrowAnnotateTool, AngleTool, CobbAngleTool, UltrasoundDirectionalTool, KeyImageTool, AnnotationEraserTool as EraserTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, CircleROIStartEndThresholdTool, SplineContourSegmentationTool, BrushTool, MagnifyTool, AdvancedMagnifyTool, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, SculptorTool, SegmentSelectTool, };
|
package/dist/esm/tools/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import ScaleOverlayTool from './ScaleOverlayTool';
|
|
|
21
21
|
import SculptorTool from './SculptorTool';
|
|
22
22
|
import BidirectionalTool from './annotation/BidirectionalTool';
|
|
23
23
|
import LengthTool from './annotation/LengthTool';
|
|
24
|
+
import HeightTool from './annotation/HeightTool';
|
|
24
25
|
import ProbeTool from './annotation/ProbeTool';
|
|
25
26
|
import DragProbeTool from './annotation/DragProbeTool';
|
|
26
27
|
import RectangleROITool from './annotation/RectangleROITool';
|
|
@@ -48,4 +49,4 @@ import BrushTool from './segmentation/BrushTool';
|
|
|
48
49
|
import PaintFillTool from './segmentation/PaintFillTool';
|
|
49
50
|
import OrientationMarkerTool from './OrientationMarkerTool';
|
|
50
51
|
import SegmentSelectTool from './segmentation/SegmentSelectTool';
|
|
51
|
-
export { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, WindowLevelRegionTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, ReferenceCursors, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, SegmentationIntersectionTool, BidirectionalTool, LengthTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, SplineROITool, PlanarFreehandROITool, PlanarFreehandContourSegmentationTool, LivewireContourTool, LivewireContourSegmentationTool, ArrowAnnotateTool, AngleTool, CobbAngleTool, UltrasoundDirectionalTool, KeyImageTool, AnnotationEraserTool as EraserTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, CircleROIStartEndThresholdTool, SplineContourSegmentationTool, BrushTool, MagnifyTool, AdvancedMagnifyTool, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, SculptorTool, SegmentSelectTool, };
|
|
52
|
+
export { BaseTool, AnnotationTool, AnnotationDisplayTool, PanTool, TrackballRotateTool, DragProbeTool, WindowLevelTool, WindowLevelRegionTool, StackScrollTool, PlanarRotateTool, StackScrollMouseWheelTool, ZoomTool, VolumeRotateMouseWheelTool, MIPJumpToClickTool, ReferenceCursors, CrosshairsTool, ReferenceLinesTool, OverlayGridTool, SegmentationIntersectionTool, BidirectionalTool, LengthTool, HeightTool, ProbeTool, RectangleROITool, EllipticalROITool, CircleROITool, SplineROITool, PlanarFreehandROITool, PlanarFreehandContourSegmentationTool, LivewireContourTool, LivewireContourSegmentationTool, ArrowAnnotateTool, AngleTool, CobbAngleTool, UltrasoundDirectionalTool, KeyImageTool, AnnotationEraserTool as EraserTool, RectangleScissorsTool, CircleScissorsTool, SphereScissorsTool, RectangleROIThresholdTool, RectangleROIStartEndThresholdTool, CircleROIStartEndThresholdTool, SplineContourSegmentationTool, BrushTool, MagnifyTool, AdvancedMagnifyTool, ReferenceLines, PaintFillTool, ScaleOverlayTool, OrientationMarkerTool, SculptorTool, SegmentSelectTool, };
|
|
@@ -11,7 +11,7 @@ import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCur
|
|
|
11
11
|
import triggerAnnotationRenderForViewportUIDs from '../../utilities/triggerAnnotationRenderForViewportIds';
|
|
12
12
|
import { config as segmentationConfig, segmentLocking, segmentIndex as segmentIndexController, state as segmentationState, activeSegmentation, } from '../../stateManagement/segmentation';
|
|
13
13
|
import { isVolumeSegmentation } from './strategies/utils/stackVolumeCheck';
|
|
14
|
-
import {
|
|
14
|
+
import { getCurrentLabelmapImageIdForViewport } from '../../stateManagement/segmentation/segmentationState';
|
|
15
15
|
class BrushTool extends BaseTool {
|
|
16
16
|
constructor(toolProps = {}, defaultToolProps = {
|
|
17
17
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
@@ -192,7 +192,7 @@ class BrushTool extends BaseTool {
|
|
|
192
192
|
createEditData(element) {
|
|
193
193
|
const enabledElement = getEnabledElement(element);
|
|
194
194
|
const { viewport } = enabledElement;
|
|
195
|
-
const activeRepresentation = activeSegmentation.
|
|
195
|
+
const activeRepresentation = activeSegmentation.getActiveSegmentationRepresentation(viewport.id);
|
|
196
196
|
if (!activeRepresentation) {
|
|
197
197
|
throw new Error('No active segmentation detected, create a segmentation representation before using the brush tool');
|
|
198
198
|
}
|
|
@@ -200,7 +200,7 @@ class BrushTool extends BaseTool {
|
|
|
200
200
|
if (type === SegmentationRepresentations.Contour) {
|
|
201
201
|
throw new Error('Not implemented yet');
|
|
202
202
|
}
|
|
203
|
-
const segmentsLocked = segmentLocking.
|
|
203
|
+
const segmentsLocked = segmentLocking.getLockedSegmentIndices(segmentationId);
|
|
204
204
|
const { representationData } = segmentationState.getSegmentation(segmentationId);
|
|
205
205
|
const labelmapData = representationData[SegmentationRepresentations.Labelmap];
|
|
206
206
|
if (isVolumeSegmentation(labelmapData, viewport)) {
|
|
@@ -228,7 +228,7 @@ class BrushTool extends BaseTool {
|
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
else {
|
|
231
|
-
const segmentationImageId =
|
|
231
|
+
const segmentationImageId = getCurrentLabelmapImageIdForViewport(viewport.id, segmentationId);
|
|
232
232
|
if (!segmentationImageId) {
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
@@ -272,7 +272,7 @@ class BrushTool extends BaseTool {
|
|
|
272
272
|
}
|
|
273
273
|
getActiveSegmentationData(viewport) {
|
|
274
274
|
const viewportId = viewport.id;
|
|
275
|
-
const activeRepresentation = activeSegmentation.
|
|
275
|
+
const activeRepresentation = activeSegmentation.getActiveSegmentationRepresentation(viewportId);
|
|
276
276
|
if (!activeRepresentation) {
|
|
277
277
|
console.warn('No active segmentation detected, create one before using the brush tool');
|
|
278
278
|
return;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import { vec3 } from 'gl-matrix';
|
|
3
|
-
import { PublicToolProps, ToolProps, EventTypes, SVGDrawingHelper } from '../../types';
|
|
4
|
-
import { CircleROIStartEndThresholdAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
3
|
+
import type { PublicToolProps, ToolProps, EventTypes, SVGDrawingHelper, Annotation } from '../../types';
|
|
4
|
+
import type { CircleROIStartEndThresholdAnnotation, ROICachedStats } from '../../types/ToolSpecificAnnotationTypes';
|
|
5
5
|
import CircleROITool from '../annotation/CircleROITool';
|
|
6
6
|
declare class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
7
7
|
static toolName: any;
|
|
8
|
-
|
|
9
|
-
mouseDragCallback: any;
|
|
10
|
-
_throttledCalculateCachedStats: any;
|
|
8
|
+
_throttledCalculateCachedStats: Function;
|
|
11
9
|
editData: {
|
|
12
|
-
annotation:
|
|
10
|
+
annotation: Annotation;
|
|
13
11
|
viewportIdsToRender: Array<string>;
|
|
14
12
|
handleIndex?: number;
|
|
15
13
|
newAnnotation?: boolean;
|
|
@@ -33,13 +31,18 @@ declare class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
33
31
|
};
|
|
34
32
|
data: {
|
|
35
33
|
label: string;
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
startCoordinate: number;
|
|
35
|
+
endCoordinate: number;
|
|
38
36
|
handles: {
|
|
39
37
|
textBox: {
|
|
40
38
|
hasMoved: boolean;
|
|
41
|
-
worldPosition:
|
|
42
|
-
worldBoundingBox:
|
|
39
|
+
worldPosition: Types.Point3;
|
|
40
|
+
worldBoundingBox: {
|
|
41
|
+
topLeft: Types.Point3;
|
|
42
|
+
topRight: Types.Point3;
|
|
43
|
+
bottomLeft: Types.Point3;
|
|
44
|
+
bottomRight: Types.Point3;
|
|
45
|
+
};
|
|
43
46
|
};
|
|
44
47
|
points: [Types.Point3, Types.Point3];
|
|
45
48
|
activeHandleIndex: any;
|
|
@@ -47,6 +50,7 @@ declare class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
47
50
|
cachedStats: {
|
|
48
51
|
pointsInVolume: any[];
|
|
49
52
|
projectionPoints: any[];
|
|
53
|
+
statistics: ROICachedStats;
|
|
50
54
|
};
|
|
51
55
|
labelmapUID: any;
|
|
52
56
|
};
|
|
@@ -54,10 +58,11 @@ declare class CircleROIStartEndThresholdTool extends CircleROITool {
|
|
|
54
58
|
_endCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
55
59
|
renderAnnotation: (enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean;
|
|
56
60
|
_computeProjectionPoints(annotation: CircleROIStartEndThresholdAnnotation, imageVolume: Types.IImageVolume): void;
|
|
57
|
-
_computePointsInsideVolume(annotation: any, imageVolume: any, enabledElement: any): void;
|
|
61
|
+
_computePointsInsideVolume(annotation: any, imageVolume: any, targetId: any, enabledElement: any): void;
|
|
58
62
|
_calculateCachedStatsTool(annotation: any, enabledElement: any): any;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
_getStartCoordinate(worldPos: Types.Point3, spacingInNormal: number, viewPlaneNormal: Types.Point3): number | undefined;
|
|
64
|
+
_getEndCoordinate(worldPos: Types.Point3, spacingInNormal: number, viewPlaneNormal: Types.Point3): number | undefined;
|
|
65
|
+
_getIndexOfCoordinatesForViewplaneNormal(viewPlaneNormal: Types.Point3): number;
|
|
66
|
+
_getCoordinateForViewplaneNormal(pos: vec3 | number, viewPlaneNormal: Types.Point3): number | undefined;
|
|
62
67
|
}
|
|
63
68
|
export default CircleROIStartEndThresholdTool;
|