@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
|
@@ -17,13 +17,12 @@ import { triggerAnnotationModified } from '../../stateManagement/annotation/help
|
|
|
17
17
|
import { drawLinkedTextBox } from '../../drawingSvg';
|
|
18
18
|
import { getTextBoxCoordsCanvas } from '../../utilities/drawing';
|
|
19
19
|
import { getLineSegmentIntersectionsCoordinates } from '../../utilities/math/polyline';
|
|
20
|
-
import pointInShapeCallback from '../../utilities/pointInShapeCallback';
|
|
21
20
|
import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScaled';
|
|
22
|
-
import { getPixelValueUnits } from '../../utilities/getPixelValueUnits';
|
|
23
21
|
import { BasicStatsCalculator } from '../../utilities/math/basic';
|
|
24
22
|
import calculatePerimeter from '../../utilities/contours/calculatePerimeter';
|
|
25
23
|
import ContourSegmentationBaseTool from '../base/ContourSegmentationBaseTool';
|
|
26
24
|
import { KeyboardBindings, ChangeTypes } from '../../enums';
|
|
25
|
+
import { getPixelValueUnits } from '../../utilities/getPixelValueUnits';
|
|
27
26
|
const { pointCanProjectOnLine } = polyline;
|
|
28
27
|
const { EPSILON } = CONSTANTS;
|
|
29
28
|
const PARALLEL_THRESHOLD = 1 - EPSILON;
|
|
@@ -31,6 +30,7 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
31
30
|
constructor(toolProps = {}, defaultToolProps = {
|
|
32
31
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
33
32
|
configuration: {
|
|
33
|
+
storePointData: false,
|
|
34
34
|
shadow: true,
|
|
35
35
|
preventHandleOutsideImage: false,
|
|
36
36
|
contourHoleAdditionModifierKey: KeyboardBindings.Shift,
|
|
@@ -144,45 +144,12 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
144
144
|
}
|
|
145
145
|
const { imageData, metadata } = image;
|
|
146
146
|
const canvasCoordinates = points.map((p) => viewport.worldToCanvas(p));
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const deltaYPoint = viewport.canvasToWorld([
|
|
154
|
-
canvasPoint[0],
|
|
155
|
-
canvasPoint[1] + 1,
|
|
156
|
-
]);
|
|
157
|
-
const deltaInX = vec3.distance(originalWorldPoint, deltaXPoint);
|
|
158
|
-
const deltaInY = vec3.distance(originalWorldPoint, deltaYPoint);
|
|
159
|
-
const worldPosIndex = csUtils.transformWorldToIndex(imageData, points[0]);
|
|
160
|
-
worldPosIndex[0] = Math.floor(worldPosIndex[0]);
|
|
161
|
-
worldPosIndex[1] = Math.floor(worldPosIndex[1]);
|
|
162
|
-
worldPosIndex[2] = Math.floor(worldPosIndex[2]);
|
|
163
|
-
let iMin = worldPosIndex[0];
|
|
164
|
-
let iMax = worldPosIndex[0];
|
|
165
|
-
let jMin = worldPosIndex[1];
|
|
166
|
-
let jMax = worldPosIndex[1];
|
|
167
|
-
let kMin = worldPosIndex[2];
|
|
168
|
-
let kMax = worldPosIndex[2];
|
|
169
|
-
for (let j = 1; j < points.length; j++) {
|
|
170
|
-
const worldPosIndex = csUtils.transformWorldToIndex(imageData, points[j]);
|
|
171
|
-
worldPosIndex[0] = Math.floor(worldPosIndex[0]);
|
|
172
|
-
worldPosIndex[1] = Math.floor(worldPosIndex[1]);
|
|
173
|
-
worldPosIndex[2] = Math.floor(worldPosIndex[2]);
|
|
174
|
-
iMin = Math.min(iMin, worldPosIndex[0]);
|
|
175
|
-
iMax = Math.max(iMax, worldPosIndex[0]);
|
|
176
|
-
jMin = Math.min(jMin, worldPosIndex[1]);
|
|
177
|
-
jMax = Math.max(jMax, worldPosIndex[1]);
|
|
178
|
-
kMin = Math.min(kMin, worldPosIndex[2]);
|
|
179
|
-
kMax = Math.max(kMax, worldPosIndex[2]);
|
|
180
|
-
}
|
|
181
|
-
const worldPosIndex2 = csUtils.transformWorldToIndex(imageData, points[1]);
|
|
182
|
-
worldPosIndex2[0] = Math.floor(worldPosIndex2[0]);
|
|
183
|
-
worldPosIndex2[1] = Math.floor(worldPosIndex2[1]);
|
|
184
|
-
worldPosIndex2[2] = Math.floor(worldPosIndex2[2]);
|
|
185
|
-
const { scale, areaUnits } = getCalibratedLengthUnitsAndScale(image, () => {
|
|
147
|
+
const modalityUnitOptions = {
|
|
148
|
+
isPreScaled: isViewportPreScaled(viewport, targetId),
|
|
149
|
+
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
150
|
+
};
|
|
151
|
+
const pixelValueUnits = getPixelValueUnits(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions);
|
|
152
|
+
const calibratedScale = getCalibratedLengthUnitsAndScale(image, () => {
|
|
186
153
|
const polyline = data.contour.polyline;
|
|
187
154
|
const numPoints = polyline.length;
|
|
188
155
|
const projectedPolyline = new Array(numPoints);
|
|
@@ -190,10 +157,7 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
190
157
|
projectedPolyline[i] = viewport.worldToCanvas(polyline[i]);
|
|
191
158
|
}
|
|
192
159
|
const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY, } = math.polyline.getAABB(projectedPolyline);
|
|
193
|
-
const topLeftBBWorld = viewport.canvasToWorld([
|
|
194
|
-
canvasMinX,
|
|
195
|
-
canvasMinY,
|
|
196
|
-
]);
|
|
160
|
+
const topLeftBBWorld = viewport.canvasToWorld([canvasMinX, canvasMinY]);
|
|
197
161
|
const topLeftBBIndex = csUtils.transformWorldToIndex(imageData, topLeftBBWorld);
|
|
198
162
|
const bottomRightBBWorld = viewport.canvasToWorld([
|
|
199
163
|
canvasMaxX,
|
|
@@ -202,71 +166,29 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
202
166
|
const bottomRightBBIndex = csUtils.transformWorldToIndex(imageData, bottomRightBBWorld);
|
|
203
167
|
return [topLeftBBIndex, bottomRightBBIndex];
|
|
204
168
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const point = viewport.worldToCanvas(pointLPS);
|
|
229
|
-
if (point[1] != curRow) {
|
|
230
|
-
intersectionCounter = 0;
|
|
231
|
-
curRow = point[1];
|
|
232
|
-
intersections = getLineSegmentIntersectionsCoordinates(canvasCoordinates, point, [canvasPosEnd[0], point[1]]);
|
|
233
|
-
intersections.sort((function (index) {
|
|
234
|
-
return function (a, b) {
|
|
235
|
-
return a[index] === b[index]
|
|
236
|
-
? 0
|
|
237
|
-
: a[index] < b[index]
|
|
238
|
-
? -1
|
|
239
|
-
: 1;
|
|
240
|
-
};
|
|
241
|
-
})(0));
|
|
242
|
-
}
|
|
243
|
-
if (intersections.length && point[0] > intersections[0][0]) {
|
|
244
|
-
intersections.shift();
|
|
245
|
-
intersectionCounter++;
|
|
246
|
-
}
|
|
247
|
-
if (intersectionCounter % 2 === 0) {
|
|
248
|
-
result = false;
|
|
249
|
-
}
|
|
250
|
-
return result;
|
|
251
|
-
}, this.configuration.statsCalculator.statsCallback, boundsIJK);
|
|
252
|
-
const pixelUnitsOptions = {
|
|
253
|
-
isPreScaled: isViewportPreScaled(viewport, targetId),
|
|
254
|
-
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
255
|
-
};
|
|
256
|
-
const pixelValueUnits = getPixelValueUnits(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
257
|
-
const stats = this.configuration.statsCalculator.getStatistics();
|
|
258
|
-
cachedStats[targetId] = {
|
|
259
|
-
Modality: metadata.Modality,
|
|
260
|
-
area,
|
|
261
|
-
perimeter: calculatePerimeter(canvasCoordinates, closed),
|
|
262
|
-
mean: stats.mean?.value,
|
|
263
|
-
max: stats.max?.value,
|
|
264
|
-
stdDev: stats.stdDev?.value,
|
|
265
|
-
statsArray: stats.array,
|
|
266
|
-
pointsInShape: pointsInShape,
|
|
267
|
-
areaUnits,
|
|
268
|
-
pixelValueUnits,
|
|
269
|
-
};
|
|
169
|
+
if (closed) {
|
|
170
|
+
this.updateClosedCachedStats({
|
|
171
|
+
targetId,
|
|
172
|
+
viewport,
|
|
173
|
+
canvasCoordinates,
|
|
174
|
+
points,
|
|
175
|
+
imageData,
|
|
176
|
+
metadata,
|
|
177
|
+
cachedStats,
|
|
178
|
+
pixelValueUnits,
|
|
179
|
+
calibratedScale,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
this.updateOpenCachedStats({
|
|
184
|
+
metadata,
|
|
185
|
+
canvasCoordinates,
|
|
186
|
+
targetId,
|
|
187
|
+
cachedStats,
|
|
188
|
+
pixelValueUnits,
|
|
189
|
+
calibratedScale,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
270
192
|
}
|
|
271
193
|
triggerAnnotationModified(annotation, enabledElement.viewport.element, ChangeTypes.StatsUpdated);
|
|
272
194
|
annotation.invalidated = false;
|
|
@@ -459,10 +381,127 @@ class PlanarFreehandROITool extends ContourSegmentationBaseTool {
|
|
|
459
381
|
}
|
|
460
382
|
}
|
|
461
383
|
}
|
|
384
|
+
updateClosedCachedStats({ viewport, points, imageData, metadata, cachedStats, targetId, pixelValueUnits, canvasCoordinates, calibratedScale, }) {
|
|
385
|
+
const { scale, areaUnits, units } = calibratedScale;
|
|
386
|
+
const { voxelManager } = viewport.getImageData();
|
|
387
|
+
const canvasPoint = canvasCoordinates[0];
|
|
388
|
+
const originalWorldPoint = viewport.canvasToWorld(canvasPoint);
|
|
389
|
+
const deltaXPoint = viewport.canvasToWorld([
|
|
390
|
+
canvasPoint[0] + 1,
|
|
391
|
+
canvasPoint[1],
|
|
392
|
+
]);
|
|
393
|
+
const deltaYPoint = viewport.canvasToWorld([
|
|
394
|
+
canvasPoint[0],
|
|
395
|
+
canvasPoint[1] + 1,
|
|
396
|
+
]);
|
|
397
|
+
const deltaInX = vec3.distance(originalWorldPoint, deltaXPoint);
|
|
398
|
+
const deltaInY = vec3.distance(originalWorldPoint, deltaYPoint);
|
|
399
|
+
const worldPosIndex = csUtils.transformWorldToIndex(imageData, points[0]);
|
|
400
|
+
worldPosIndex[0] = Math.floor(worldPosIndex[0]);
|
|
401
|
+
worldPosIndex[1] = Math.floor(worldPosIndex[1]);
|
|
402
|
+
worldPosIndex[2] = Math.floor(worldPosIndex[2]);
|
|
403
|
+
let iMin = worldPosIndex[0];
|
|
404
|
+
let iMax = worldPosIndex[0];
|
|
405
|
+
let jMin = worldPosIndex[1];
|
|
406
|
+
let jMax = worldPosIndex[1];
|
|
407
|
+
let kMin = worldPosIndex[2];
|
|
408
|
+
let kMax = worldPosIndex[2];
|
|
409
|
+
for (let j = 1; j < points.length; j++) {
|
|
410
|
+
const worldPosIndex = csUtils.transformWorldToIndex(imageData, points[j]);
|
|
411
|
+
worldPosIndex[0] = Math.floor(worldPosIndex[0]);
|
|
412
|
+
worldPosIndex[1] = Math.floor(worldPosIndex[1]);
|
|
413
|
+
worldPosIndex[2] = Math.floor(worldPosIndex[2]);
|
|
414
|
+
iMin = Math.min(iMin, worldPosIndex[0]);
|
|
415
|
+
iMax = Math.max(iMax, worldPosIndex[0]);
|
|
416
|
+
jMin = Math.min(jMin, worldPosIndex[1]);
|
|
417
|
+
jMax = Math.max(jMax, worldPosIndex[1]);
|
|
418
|
+
kMin = Math.min(kMin, worldPosIndex[2]);
|
|
419
|
+
kMax = Math.max(kMax, worldPosIndex[2]);
|
|
420
|
+
}
|
|
421
|
+
const worldPosIndex2 = csUtils.transformWorldToIndex(imageData, points[1]);
|
|
422
|
+
worldPosIndex2[0] = Math.floor(worldPosIndex2[0]);
|
|
423
|
+
worldPosIndex2[1] = Math.floor(worldPosIndex2[1]);
|
|
424
|
+
worldPosIndex2[2] = Math.floor(worldPosIndex2[2]);
|
|
425
|
+
let area = polyline.getArea(canvasCoordinates) / scale / scale;
|
|
426
|
+
area *= deltaInX * deltaInY;
|
|
427
|
+
const iDelta = 0.01 * (iMax - iMin);
|
|
428
|
+
const jDelta = 0.01 * (jMax - jMin);
|
|
429
|
+
const kDelta = 0.01 * (kMax - kMin);
|
|
430
|
+
iMin = Math.floor(iMin - iDelta);
|
|
431
|
+
iMax = Math.ceil(iMax + iDelta);
|
|
432
|
+
jMin = Math.floor(jMin - jDelta);
|
|
433
|
+
jMax = Math.ceil(jMax + jDelta);
|
|
434
|
+
kMin = Math.floor(kMin - kDelta);
|
|
435
|
+
kMax = Math.ceil(kMax + kDelta);
|
|
436
|
+
const boundsIJK = [
|
|
437
|
+
[iMin, iMax],
|
|
438
|
+
[jMin, jMax],
|
|
439
|
+
[kMin, kMax],
|
|
440
|
+
];
|
|
441
|
+
const worldPosEnd = imageData.indexToWorld([iMax, jMax, kMax]);
|
|
442
|
+
const canvasPosEnd = viewport.worldToCanvas(worldPosEnd);
|
|
443
|
+
let curRow = 0;
|
|
444
|
+
let intersections = [];
|
|
445
|
+
let intersectionCounter = 0;
|
|
446
|
+
const pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
|
|
447
|
+
imageData,
|
|
448
|
+
isInObject: (pointLPS, _pointIJK) => {
|
|
449
|
+
let result = true;
|
|
450
|
+
const point = viewport.worldToCanvas(pointLPS);
|
|
451
|
+
if (point[1] != curRow) {
|
|
452
|
+
intersectionCounter = 0;
|
|
453
|
+
curRow = point[1];
|
|
454
|
+
intersections = getLineSegmentIntersectionsCoordinates(canvasCoordinates, point, [canvasPosEnd[0], point[1]]);
|
|
455
|
+
intersections.sort((function (index) {
|
|
456
|
+
return function (a, b) {
|
|
457
|
+
return a[index] === b[index]
|
|
458
|
+
? 0
|
|
459
|
+
: a[index] < b[index]
|
|
460
|
+
? -1
|
|
461
|
+
: 1;
|
|
462
|
+
};
|
|
463
|
+
})(0));
|
|
464
|
+
}
|
|
465
|
+
if (intersections.length && point[0] > intersections[0][0]) {
|
|
466
|
+
intersections.shift();
|
|
467
|
+
intersectionCounter++;
|
|
468
|
+
}
|
|
469
|
+
if (intersectionCounter % 2 === 0) {
|
|
470
|
+
result = false;
|
|
471
|
+
}
|
|
472
|
+
return result;
|
|
473
|
+
},
|
|
474
|
+
boundsIJK,
|
|
475
|
+
returnPoints: this.configuration.storePointData,
|
|
476
|
+
});
|
|
477
|
+
const stats = this.configuration.statsCalculator.getStatistics();
|
|
478
|
+
cachedStats[targetId] = {
|
|
479
|
+
Modality: metadata.Modality,
|
|
480
|
+
area,
|
|
481
|
+
perimeter: calculatePerimeter(canvasCoordinates, closed) / scale,
|
|
482
|
+
mean: stats.mean?.value,
|
|
483
|
+
max: stats.max?.value,
|
|
484
|
+
stdDev: stats.stdDev?.value,
|
|
485
|
+
statsArray: stats.array,
|
|
486
|
+
pointsInShape: pointsInShape,
|
|
487
|
+
areaUnits,
|
|
488
|
+
pixelValueUnits,
|
|
489
|
+
lengthUnits: units,
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
updateOpenCachedStats({ targetId, metadata, canvasCoordinates, cachedStats, pixelValueUnits, calibratedScale, }) {
|
|
493
|
+
const { scale, units } = calibratedScale;
|
|
494
|
+
cachedStats[targetId] = {
|
|
495
|
+
Modality: metadata.Modality,
|
|
496
|
+
length: calculatePerimeter(canvasCoordinates, false) / scale,
|
|
497
|
+
pixelValueUnits,
|
|
498
|
+
getPixelValueUnitunit: units,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
462
501
|
}
|
|
463
502
|
function defaultGetTextLines(data, targetId) {
|
|
464
503
|
const cachedVolumeStats = data.cachedStats[targetId];
|
|
465
|
-
const { area, mean, stdDev, perimeter, max, isEmptyArea, areaUnits, pixelValueUnits, } = cachedVolumeStats || {};
|
|
504
|
+
const { area, mean, stdDev, length, perimeter, max, isEmptyArea, lengthUnits, areaUnits, pixelValueUnits, } = cachedVolumeStats || {};
|
|
466
505
|
const textLines = [];
|
|
467
506
|
if (area) {
|
|
468
507
|
const areaLine = isEmptyArea
|
|
@@ -473,14 +512,17 @@ function defaultGetTextLines(data, targetId) {
|
|
|
473
512
|
if (mean) {
|
|
474
513
|
textLines.push(`Mean: ${roundNumber(mean)} ${pixelValueUnits}`);
|
|
475
514
|
}
|
|
476
|
-
if (max) {
|
|
515
|
+
if (Number.isFinite(max)) {
|
|
477
516
|
textLines.push(`Max: ${roundNumber(max)} ${pixelValueUnits}`);
|
|
478
517
|
}
|
|
479
518
|
if (stdDev) {
|
|
480
519
|
textLines.push(`Std Dev: ${roundNumber(stdDev)} ${pixelValueUnits}`);
|
|
481
520
|
}
|
|
482
521
|
if (perimeter) {
|
|
483
|
-
textLines.push(`Perimeter: ${roundNumber(perimeter)} ${
|
|
522
|
+
textLines.push(`Perimeter: ${roundNumber(perimeter)} ${lengthUnits}`);
|
|
523
|
+
}
|
|
524
|
+
if (length) {
|
|
525
|
+
textLines.push(`${roundNumber(length)} ${lengthUnits}`);
|
|
484
526
|
}
|
|
485
527
|
return textLines;
|
|
486
528
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import { AnnotationTool } from '../base';
|
|
3
|
-
import { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper } from '../../types';
|
|
4
|
-
import { ProbeAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
3
|
+
import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation } from '../../types';
|
|
4
|
+
import type { ProbeAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
5
5
|
declare class ProbeTool extends AnnotationTool {
|
|
6
6
|
static toolName: any;
|
|
7
|
-
touchDragCallback: any;
|
|
8
|
-
mouseDragCallback: any;
|
|
9
7
|
editData: {
|
|
10
|
-
annotation:
|
|
8
|
+
annotation: Annotation;
|
|
11
9
|
viewportIdsToRender: string[];
|
|
12
10
|
newAnnotation?: boolean;
|
|
13
11
|
} | null;
|
|
@@ -25,7 +23,7 @@ declare class ProbeTool extends AnnotationTool {
|
|
|
25
23
|
handleSelectedCallback(evt: EventTypes.InteractionEventType, annotation: ProbeAnnotation): void;
|
|
26
24
|
_endCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
27
25
|
_dragCallback: (evt: any) => void;
|
|
28
|
-
cancel: (element: HTMLDivElement) =>
|
|
26
|
+
cancel: (element: HTMLDivElement) => string;
|
|
29
27
|
_activateModify: (element: any) => void;
|
|
30
28
|
_deactivateModify: (element: any) => void;
|
|
31
29
|
renderAnnotation: (enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { vec2 } from 'gl-matrix';
|
|
1
|
+
import { vec2, vec3 } from 'gl-matrix';
|
|
2
2
|
import { getEnabledElement, VolumeViewport, utilities as csUtils, } from '@cornerstonejs/core';
|
|
3
3
|
import { AnnotationTool } from '../base';
|
|
4
4
|
import { addAnnotation, getAnnotations, removeAnnotation, } from '../../stateManagement/annotation/annotationState';
|
|
@@ -11,7 +11,7 @@ import { getViewportIdsWithToolToRender } from '../../utilities/viewportFilters'
|
|
|
11
11
|
import { roundNumber } from '../../utilities';
|
|
12
12
|
import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCursor';
|
|
13
13
|
import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds';
|
|
14
|
-
import { getPixelValueUnits
|
|
14
|
+
import { getPixelValueUnits } from '../../utilities/getPixelValueUnits';
|
|
15
15
|
import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScaled';
|
|
16
16
|
const { transformWorldToIndex } = csUtils;
|
|
17
17
|
class ProbeTool extends AnnotationTool {
|
|
@@ -29,11 +29,11 @@ class ProbeTool extends AnnotationTool {
|
|
|
29
29
|
const { currentPoints, element } = eventDetail;
|
|
30
30
|
const worldPos = currentPoints.world;
|
|
31
31
|
const enabledElement = getEnabledElement(element);
|
|
32
|
-
const { viewport
|
|
32
|
+
const { viewport } = enabledElement;
|
|
33
33
|
this.isDrawing = true;
|
|
34
34
|
const camera = viewport.getCamera();
|
|
35
35
|
const { viewPlaneNormal, viewUp } = camera;
|
|
36
|
-
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal
|
|
36
|
+
const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal);
|
|
37
37
|
const FrameOfReferenceUID = viewport.getFrameOfReferenceUID();
|
|
38
38
|
const annotation = {
|
|
39
39
|
invalidated: true,
|
|
@@ -265,42 +265,27 @@ class ProbeTool extends AnnotationTool {
|
|
|
265
265
|
if (!image) {
|
|
266
266
|
continue;
|
|
267
267
|
}
|
|
268
|
-
const { dimensions, imageData, metadata } = image;
|
|
269
|
-
const scalarData = 'getScalarData' in image ? image.getScalarData() : image.scalarData;
|
|
268
|
+
const { dimensions, imageData, metadata, voxelManager } = image;
|
|
270
269
|
const modality = metadata.Modality;
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
index[2] = Math.round(index[2]);
|
|
275
|
-
const samplesPerPixel = scalarData.length / dimensions[2] / dimensions[1] / dimensions[0];
|
|
276
|
-
if (csUtils.indexWithinDimensions(index, dimensions)) {
|
|
270
|
+
let ijk = transformWorldToIndex(imageData, worldPos);
|
|
271
|
+
ijk = vec3.round(ijk, ijk);
|
|
272
|
+
if (csUtils.indexWithinDimensions(ijk, dimensions)) {
|
|
277
273
|
this.isHandleOutsideImage = false;
|
|
278
|
-
|
|
279
|
-
const zMultiple = dimensions[0] * dimensions[1] * samplesPerPixel;
|
|
280
|
-
const baseIndex = index[2] * zMultiple +
|
|
281
|
-
index[1] * yMultiple +
|
|
282
|
-
index[0] * samplesPerPixel;
|
|
283
|
-
let value = samplesPerPixel > 2
|
|
284
|
-
? [
|
|
285
|
-
scalarData[baseIndex],
|
|
286
|
-
scalarData[baseIndex + 1],
|
|
287
|
-
scalarData[baseIndex + 2],
|
|
288
|
-
]
|
|
289
|
-
: scalarData[baseIndex];
|
|
274
|
+
let value = voxelManager.getAtIJKPoint(ijk);
|
|
290
275
|
if (targetId.startsWith('imageId:')) {
|
|
291
276
|
const imageId = targetId.split('imageId:')[1];
|
|
292
277
|
const imageURI = csUtils.imageIdToURI(imageId);
|
|
293
278
|
const viewports = csUtils.getViewportsWithImageURI(imageURI, renderingEngineId);
|
|
294
279
|
const viewport = viewports[0];
|
|
295
|
-
|
|
280
|
+
ijk[2] = viewport.getCurrentImageIdIndex();
|
|
296
281
|
}
|
|
297
282
|
let pixelValueUnits;
|
|
298
283
|
if (modality === 'US') {
|
|
299
284
|
const calibratedResults = getCalibratedProbeUnitsAndValue(image, [
|
|
300
|
-
|
|
285
|
+
ijk,
|
|
301
286
|
]);
|
|
302
287
|
const hasEnhancedRegionValues = calibratedResults.values.every((value) => value !== null);
|
|
303
|
-
value = hasEnhancedRegionValues ? calibratedResults.values : value;
|
|
288
|
+
value = (hasEnhancedRegionValues ? calibratedResults.values : value);
|
|
304
289
|
pixelValueUnits = hasEnhancedRegionValues
|
|
305
290
|
? calibratedResults.units
|
|
306
291
|
: 'raw';
|
|
@@ -309,7 +294,7 @@ class ProbeTool extends AnnotationTool {
|
|
|
309
294
|
pixelValueUnits = getPixelValueUnits(modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
310
295
|
}
|
|
311
296
|
cachedStats[targetId] = {
|
|
312
|
-
index,
|
|
297
|
+
index: ijk,
|
|
313
298
|
value,
|
|
314
299
|
Modality: modality,
|
|
315
300
|
pixelValueUnits,
|
|
@@ -318,7 +303,7 @@ class ProbeTool extends AnnotationTool {
|
|
|
318
303
|
else {
|
|
319
304
|
this.isHandleOutsideImage = true;
|
|
320
305
|
cachedStats[targetId] = {
|
|
321
|
-
index,
|
|
306
|
+
index: ijk,
|
|
322
307
|
Modality: modality,
|
|
323
308
|
};
|
|
324
309
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AnnotationTool } from '../base';
|
|
2
2
|
import type { Types } from '@cornerstonejs/core';
|
|
3
|
-
import { EventTypes, ToolHandle, ToolProps, PublicToolProps, SVGDrawingHelper } from '../../types';
|
|
4
|
-
import { RectangleROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
3
|
+
import type { EventTypes, ToolHandle, ToolProps, PublicToolProps, SVGDrawingHelper, Annotation } from '../../types';
|
|
4
|
+
import type { RectangleROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
5
5
|
declare class RectangleROITool extends AnnotationTool {
|
|
6
6
|
static toolName: any;
|
|
7
|
-
_throttledCalculateCachedStats:
|
|
7
|
+
_throttledCalculateCachedStats: Function;
|
|
8
8
|
editData: {
|
|
9
|
-
annotation:
|
|
9
|
+
annotation: Annotation;
|
|
10
10
|
viewportIdsToRender: string[];
|
|
11
11
|
handleIndex?: number;
|
|
12
12
|
movingTextBox?: boolean;
|
|
@@ -22,7 +22,7 @@ declare class RectangleROITool extends AnnotationTool {
|
|
|
22
22
|
handleSelectedCallback: (evt: EventTypes.InteractionEventType, annotation: RectangleROIAnnotation, handle: ToolHandle) => void;
|
|
23
23
|
_endCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
24
24
|
_dragCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
25
|
-
cancel: (element: HTMLDivElement) =>
|
|
25
|
+
cancel: (element: HTMLDivElement) => string;
|
|
26
26
|
_activateDraw: (element: any) => void;
|
|
27
27
|
_deactivateDraw: (element: any) => void;
|
|
28
28
|
_activateModify: (element: any) => void;
|
|
@@ -18,13 +18,13 @@ import { resetElementCursor, hideElementCursor, } from '../../cursors/elementCur
|
|
|
18
18
|
import triggerAnnotationRenderForViewportIds from '../../utilities/triggerAnnotationRenderForViewportIds';
|
|
19
19
|
import { getPixelValueUnits } from '../../utilities/getPixelValueUnits';
|
|
20
20
|
import { isViewportPreScaled } from '../../utilities/viewport/isViewportPreScaled';
|
|
21
|
-
import { pointInShapeCallback } from '../../utilities/';
|
|
22
21
|
import { BasicStatsCalculator } from '../../utilities/math/basic';
|
|
23
22
|
const { transformWorldToIndex } = csUtils;
|
|
24
23
|
class RectangleROITool extends AnnotationTool {
|
|
25
24
|
constructor(toolProps = {}, defaultToolProps = {
|
|
26
25
|
supportedInteractionTypes: ['Mouse', 'Touch'],
|
|
27
26
|
configuration: {
|
|
27
|
+
storePointData: false,
|
|
28
28
|
shadow: true,
|
|
29
29
|
preventHandleOutsideImage: false,
|
|
30
30
|
getTextLines: defaultGetTextLines,
|
|
@@ -464,7 +464,7 @@ class RectangleROITool extends AnnotationTool {
|
|
|
464
464
|
if (!image) {
|
|
465
465
|
continue;
|
|
466
466
|
}
|
|
467
|
-
const { dimensions, imageData, metadata } = image;
|
|
467
|
+
const { dimensions, imageData, metadata, voxelManager } = image;
|
|
468
468
|
const pos1Index = transformWorldToIndex(imageData, worldPos1);
|
|
469
469
|
pos1Index[0] = Math.floor(pos1Index[0]);
|
|
470
470
|
pos1Index[1] = Math.floor(pos1Index[1]);
|
|
@@ -495,7 +495,11 @@ class RectangleROITool extends AnnotationTool {
|
|
|
495
495
|
isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId),
|
|
496
496
|
};
|
|
497
497
|
const pixelValueUnits = getPixelValueUnits(metadata.Modality, annotation.metadata.referencedImageId, pixelUnitsOptions);
|
|
498
|
-
const pointsInShape =
|
|
498
|
+
const pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, {
|
|
499
|
+
boundsIJK,
|
|
500
|
+
imageData,
|
|
501
|
+
returnPoints: this.configuration.storePointData,
|
|
502
|
+
});
|
|
499
503
|
const stats = this.configuration.statsCalculator.getStatistics();
|
|
500
504
|
cachedStats[targetId] = {
|
|
501
505
|
Modality: metadata.Modality,
|
|
@@ -17,9 +17,7 @@ declare class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
17
17
|
static toolName: any;
|
|
18
18
|
static SplineTypes: typeof SplineTypesEnum;
|
|
19
19
|
static Actions: typeof SplineToolActions;
|
|
20
|
-
|
|
21
|
-
mouseDragCallback: any;
|
|
22
|
-
_throttledCalculateCachedStats: any;
|
|
20
|
+
_throttledCalculateCachedStats: Function;
|
|
23
21
|
editData: {
|
|
24
22
|
annotation: SplineROIAnnotation;
|
|
25
23
|
viewportIdsToRender: Array<string>;
|
|
@@ -576,7 +576,7 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
576
576
|
const handleGroupUID = '0';
|
|
577
577
|
drawHandlesSvg(svgDrawingHelper, annotationUID, handleGroupUID, canvasCoordinates, {
|
|
578
578
|
color,
|
|
579
|
-
lineWidth
|
|
579
|
+
lineWidth,
|
|
580
580
|
handleRadius: '3',
|
|
581
581
|
});
|
|
582
582
|
}
|
|
@@ -588,7 +588,7 @@ class SplineROITool extends ContourSegmentationBaseTool {
|
|
|
588
588
|
const previewPolylinePoints = spline.getPreviewPolylinePoints(lastCanvasPoint, SPLINE_CLICK_CLOSE_CURVE_DIST);
|
|
589
589
|
drawPolylineSvg(svgDrawingHelper, annotationUID, 'previewSplineChange', previewPolylinePoints, {
|
|
590
590
|
color: '#9EA0CA',
|
|
591
|
-
lineDash,
|
|
591
|
+
lineDash: lineDash,
|
|
592
592
|
lineWidth: 1,
|
|
593
593
|
});
|
|
594
594
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import { AnnotationTool } from '../base';
|
|
3
|
-
import { UltrasoundDirectionalAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
4
|
-
import { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation, InteractionTypes } from '../../types';
|
|
3
|
+
import type { UltrasoundDirectionalAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
4
|
+
import type { EventTypes, ToolHandle, PublicToolProps, ToolProps, SVGDrawingHelper, Annotation, InteractionTypes } from '../../types';
|
|
5
5
|
declare class UltrasoundDirectionalTool extends AnnotationTool {
|
|
6
6
|
static toolName: any;
|
|
7
|
-
touchDragCallback: any;
|
|
8
|
-
mouseDragCallback: any;
|
|
9
7
|
startedDrawing: boolean;
|
|
10
|
-
_throttledCalculateCachedStats:
|
|
8
|
+
_throttledCalculateCachedStats: Function;
|
|
11
9
|
editData: {
|
|
12
|
-
annotation:
|
|
10
|
+
annotation: Annotation;
|
|
13
11
|
viewportIdsToRender: string[];
|
|
14
12
|
handleIndex?: number;
|
|
15
13
|
movingTextBox?: boolean;
|
|
@@ -25,7 +23,7 @@ declare class UltrasoundDirectionalTool extends AnnotationTool {
|
|
|
25
23
|
handleSelectedCallback(evt: EventTypes.InteractionEventType, annotation: UltrasoundDirectionalAnnotation, handle: ToolHandle): void;
|
|
26
24
|
_endCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
27
25
|
_dragCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
28
|
-
cancel: (element: HTMLDivElement) =>
|
|
26
|
+
cancel: (element: HTMLDivElement) => string;
|
|
29
27
|
_activateModify: (element: HTMLDivElement) => void;
|
|
30
28
|
_deactivateModify: (element: HTMLDivElement) => void;
|
|
31
29
|
_activateDraw: (element: HTMLDivElement) => void;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import { AnnotationTool } from '../base';
|
|
3
|
-
import { EventTypes, SVGDrawingHelper } from '../../types';
|
|
4
|
-
import { VideoRedactionAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
3
|
+
import type { Annotation, EventTypes, SVGDrawingHelper } from '../../types';
|
|
4
|
+
import type { VideoRedactionAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
5
5
|
declare class VideoRedactionTool extends AnnotationTool {
|
|
6
|
-
_throttledCalculateCachedStats:
|
|
6
|
+
_throttledCalculateCachedStats: Function;
|
|
7
7
|
editData: {
|
|
8
|
-
annotation:
|
|
8
|
+
annotation: Annotation;
|
|
9
9
|
viewportUIDsToRender: string[];
|
|
10
10
|
handleIndex?: number;
|
|
11
11
|
newAnnotation?: boolean;
|
|
12
12
|
hasMoved?: boolean;
|
|
13
13
|
} | null;
|
|
14
|
-
_configuration: any;
|
|
15
14
|
isDrawing: boolean;
|
|
16
15
|
isHandleOutsideImage: boolean;
|
|
17
16
|
constructor(toolConfiguration?: {});
|
package/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Types } from '@cornerstonejs/core';
|
|
2
|
-
import { PlanarFreehandROIAnnotation } from '../../../types/ToolSpecificAnnotationTypes';
|
|
2
|
+
import type { PlanarFreehandROIAnnotation } from '../../../types/ToolSpecificAnnotationTypes';
|
|
3
3
|
export default function findOpenUShapedContourVectorToPeak(canvasPoints: Types.Point2[], viewport: Types.IStackViewport | Types.IVolumeViewport): Types.Point3[];
|
|
4
4
|
export declare function findOpenUShapedContourVectorToPeakOnRender(enabledElement: Types.IEnabledElement, annotation: PlanarFreehandROIAnnotation): Types.Point3[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
2
|
import type { ISpline, SplineProps, ClosestControlPoint, ClosestSplinePoint, ClosestPoint, ControlPointInfo, SplineCurveSegment } from '../../../types';
|
|
3
3
|
declare abstract class Spline implements ISpline {
|
|
4
4
|
private _controlPoints;
|