@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,3 +1,22 @@
|
|
|
1
|
+
export interface StackPrefetchData {
|
|
2
|
+
indicesToRequest: number[];
|
|
3
|
+
currentImageIdIndex: number;
|
|
4
|
+
stackCount: number;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
direction: number;
|
|
7
|
+
cacheFill?: boolean;
|
|
8
|
+
stats: {
|
|
9
|
+
start: number;
|
|
10
|
+
imageIds: Map<string, number>;
|
|
11
|
+
decodeTimeInMS: number;
|
|
12
|
+
loadTimeInMS: number;
|
|
13
|
+
totalBytes: number;
|
|
14
|
+
initialTime?: number;
|
|
15
|
+
initialSize?: number;
|
|
16
|
+
fillTime?: number;
|
|
17
|
+
fillSize?: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
1
20
|
declare function addToolState(element: HTMLDivElement, data: any): void;
|
|
2
|
-
declare function getToolState(element: HTMLDivElement):
|
|
21
|
+
declare function getToolState(element: HTMLDivElement): StackPrefetchData;
|
|
3
22
|
export { addToolState, getToolState };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDistance, IPoints, ITouchPoints } from '../../types';
|
|
1
|
+
import type { IDistance, IPoints, ITouchPoints } from '../../types';
|
|
2
2
|
declare function getDeltaPoints(currentPoints: IPoints[], lastPoints: IPoints[]): IPoints;
|
|
3
3
|
declare function getDeltaDistance(currentPoints: IPoints[], lastPoints: IPoints[]): IDistance;
|
|
4
4
|
declare function getDeltaRotation(currentPoints: ITouchPoints[], lastPoints: ITouchPoints[]): void;
|
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
declare class AnnotationRenderingEngine {
|
|
2
|
-
hasBeenDestroyed: boolean;
|
|
3
|
-
private _needsRender;
|
|
4
|
-
private _animationFrameSet;
|
|
5
|
-
private _animationFrameHandle;
|
|
6
|
-
private _viewportElements;
|
|
7
|
-
constructor();
|
|
8
|
-
addViewportElement(viewportId: string, element: HTMLDivElement): void;
|
|
9
|
-
removeViewportElement(viewportId: string, element: HTMLDivElement): void;
|
|
10
|
-
renderViewport(element: HTMLDivElement): void;
|
|
11
|
-
private _throwIfDestroyed;
|
|
12
|
-
private _renderFlaggedViewports;
|
|
13
|
-
private _setAllViewportsToBeRenderedNextFrame;
|
|
14
|
-
private _setViewportsToBeRenderedNextFrame;
|
|
15
|
-
private _render;
|
|
16
|
-
_triggerRender(element: any): void;
|
|
17
|
-
private _reset;
|
|
18
|
-
}
|
|
19
|
-
declare const annotationRenderingEngine: AnnotationRenderingEngine;
|
|
20
1
|
declare function triggerAnnotationRender(element: HTMLDivElement): void;
|
|
21
|
-
export { annotationRenderingEngine, triggerAnnotationRender };
|
|
22
2
|
export default triggerAnnotationRender;
|
|
@@ -1,116 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Events, ToolModes } from '../enums';
|
|
3
|
-
import { draw as drawSvg } from '../drawingSvg';
|
|
4
|
-
import getToolsWithModesForElement from './getToolsWithModesForElement';
|
|
5
|
-
const { Active, Passive, Enabled } = ToolModes;
|
|
6
|
-
class AnnotationRenderingEngine {
|
|
7
|
-
constructor() {
|
|
8
|
-
this._needsRender = new Set();
|
|
9
|
-
this._animationFrameSet = false;
|
|
10
|
-
this._animationFrameHandle = null;
|
|
11
|
-
this._renderFlaggedViewports = () => {
|
|
12
|
-
this._throwIfDestroyed();
|
|
13
|
-
const elements = Array.from(this._viewportElements.values());
|
|
14
|
-
for (let i = 0; i < elements.length; i++) {
|
|
15
|
-
const element = elements[i];
|
|
16
|
-
if (this._needsRender.has(element)) {
|
|
17
|
-
this._triggerRender(element);
|
|
18
|
-
this._needsRender.delete(element);
|
|
19
|
-
if (this._needsRender.size === 0) {
|
|
20
|
-
break;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
this._animationFrameSet = false;
|
|
25
|
-
this._animationFrameHandle = null;
|
|
26
|
-
this._render();
|
|
27
|
-
};
|
|
28
|
-
this._viewportElements = new Map();
|
|
29
|
-
}
|
|
30
|
-
addViewportElement(viewportId, element) {
|
|
31
|
-
this._viewportElements.set(viewportId, element);
|
|
32
|
-
}
|
|
33
|
-
removeViewportElement(viewportId, element) {
|
|
34
|
-
this._viewportElements.delete(viewportId);
|
|
35
|
-
this._needsRender.delete(element);
|
|
36
|
-
this._reset();
|
|
37
|
-
}
|
|
38
|
-
renderViewport(element) {
|
|
39
|
-
this._setViewportsToBeRenderedNextFrame([element]);
|
|
40
|
-
}
|
|
41
|
-
_throwIfDestroyed() {
|
|
42
|
-
if (this.hasBeenDestroyed) {
|
|
43
|
-
throw new Error('this.destroy() has been manually called to free up memory, can not longer use this instance. Instead make a new one.');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
_setAllViewportsToBeRenderedNextFrame() {
|
|
47
|
-
const elements = [...this._viewportElements.values()];
|
|
48
|
-
elements.forEach((element) => {
|
|
49
|
-
this._needsRender.add(element);
|
|
50
|
-
});
|
|
51
|
-
this._renderFlaggedViewports();
|
|
52
|
-
}
|
|
53
|
-
_setViewportsToBeRenderedNextFrame(elements) {
|
|
54
|
-
const elementsEnabled = [...this._viewportElements.values()];
|
|
55
|
-
elements.forEach((element) => {
|
|
56
|
-
if (elementsEnabled.indexOf(element) !== -1) {
|
|
57
|
-
this._needsRender.add(element);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
this._render();
|
|
61
|
-
}
|
|
62
|
-
_render() {
|
|
63
|
-
if (this._needsRender.size > 0 && this._animationFrameSet === false) {
|
|
64
|
-
this._animationFrameHandle = window.requestAnimationFrame(this._renderFlaggedViewports);
|
|
65
|
-
this._animationFrameSet = true;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
_triggerRender(element) {
|
|
69
|
-
const enabledElement = getEnabledElement(element);
|
|
70
|
-
if (!enabledElement) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
const renderingEngine = getRenderingEngine(enabledElement.renderingEngineId);
|
|
74
|
-
if (!renderingEngine) {
|
|
75
|
-
console.warn('rendering Engine has been destroyed');
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const enabledTools = getToolsWithModesForElement(element, [
|
|
79
|
-
Active,
|
|
80
|
-
Passive,
|
|
81
|
-
Enabled,
|
|
82
|
-
]);
|
|
83
|
-
const { renderingEngineId, viewportId } = enabledElement;
|
|
84
|
-
const eventDetail = {
|
|
85
|
-
element,
|
|
86
|
-
renderingEngineId,
|
|
87
|
-
viewportId,
|
|
88
|
-
};
|
|
89
|
-
drawSvg(element, (svgDrawingHelper) => {
|
|
90
|
-
let anyRendered = false;
|
|
91
|
-
const handleDrawSvg = (tool) => {
|
|
92
|
-
if (tool.renderAnnotation) {
|
|
93
|
-
const rendered = tool.renderAnnotation(enabledElement, svgDrawingHelper);
|
|
94
|
-
anyRendered = anyRendered || rendered;
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
enabledTools.forEach(handleDrawSvg);
|
|
98
|
-
if (anyRendered) {
|
|
99
|
-
triggerEvent(element, Events.ANNOTATION_RENDERED, { ...eventDetail });
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
_reset() {
|
|
104
|
-
window.cancelAnimationFrame(this._animationFrameHandle);
|
|
105
|
-
this._needsRender.clear();
|
|
106
|
-
this._animationFrameSet = false;
|
|
107
|
-
this._animationFrameHandle = null;
|
|
108
|
-
this._setAllViewportsToBeRenderedNextFrame();
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const annotationRenderingEngine = new AnnotationRenderingEngine();
|
|
1
|
+
import { annotationRenderingEngine } from '../stateManagement/annotation/AnnotationRenderingEngine';
|
|
112
2
|
function triggerAnnotationRender(element) {
|
|
113
3
|
annotationRenderingEngine.renderViewport(element);
|
|
114
4
|
}
|
|
115
|
-
export { annotationRenderingEngine, triggerAnnotationRender };
|
|
116
5
|
export default triggerAnnotationRender;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { cache, StackViewport, BaseVolumeViewport, } from '@cornerstonejs/core';
|
|
1
|
+
import { cache, StackViewport, BaseVolumeViewport, utilities, } from '@cornerstonejs/core';
|
|
2
2
|
function isViewportPreScaled(viewport, targetId) {
|
|
3
3
|
if (viewport instanceof BaseVolumeViewport) {
|
|
4
|
-
const
|
|
5
|
-
const volumeId = targetIdTokens.length > 1
|
|
6
|
-
? targetIdTokens[1].split('?')[0]
|
|
7
|
-
: targetIdTokens[0];
|
|
4
|
+
const volumeId = utilities.getVolumeId(targetId);
|
|
8
5
|
const volume = cache.getVolume(volumeId);
|
|
9
6
|
return !!volume?.scaling && Object.keys(volume.scaling).length > 0;
|
|
10
7
|
}
|
|
@@ -22,12 +22,10 @@ function _getImageSliceData(viewport, debounceLoading) {
|
|
|
22
22
|
: viewport.getCurrentImageIdIndex(),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
throw new Error('Unsupported viewport type');
|
|
30
|
-
}
|
|
25
|
+
return {
|
|
26
|
+
numberOfSlices: viewport.getNumberOfSlices(),
|
|
27
|
+
imageIndex: viewport.getSliceIndex(),
|
|
28
|
+
};
|
|
31
29
|
}
|
|
32
30
|
function _getImageIndexToJump(numberOfSlices, imageIndex) {
|
|
33
31
|
const lastSliceIndex = numberOfSlices - 1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
2
|
-
import { ColorbarCanvasProps } from './types/ColorbarCanvasProps';
|
|
1
|
+
import type { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
2
|
+
import type { ColorbarCanvasProps } from './types/ColorbarCanvasProps';
|
|
3
3
|
import type { ColorbarImageRange, ColorbarVOIRange } from './types';
|
|
4
4
|
import type { ColorbarSize } from './types/ColorbarSize';
|
|
5
5
|
declare class ColorbarCanvas {
|
|
@@ -28,7 +28,7 @@ class ViewportColorbar extends Colorbar {
|
|
|
28
28
|
this.imageRange = ViewportColorbar._getImageRange(this._element);
|
|
29
29
|
};
|
|
30
30
|
this._imageVolumeModifiedCallback = (evt) => {
|
|
31
|
-
const { volumeId } = evt.detail
|
|
31
|
+
const { volumeId } = evt.detail;
|
|
32
32
|
if (volumeId !== this._volumeId) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
1
|
+
import type { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
2
2
|
import type { ColorbarImageRange } from './ColorbarImageRange';
|
|
3
3
|
import type { ColorbarSize } from './ColorbarSize';
|
|
4
4
|
import type { ColorbarVOIRange } from './ColorbarVOIRange';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColorbarRangeTextPosition } from '../enums/ColorbarRangeTextPosition';
|
|
1
|
+
import type { ColorbarRangeTextPosition } from '../enums/ColorbarRangeTextPosition';
|
|
2
2
|
import type { ColorbarImageRange, ColorbarTicksStyle, ColorbarVOIRange } from '.';
|
|
3
3
|
export type ColorbarCommonProps = {
|
|
4
4
|
imageRange?: ColorbarImageRange;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
2
|
-
import { WidgetProps } from '../../../../widgets/types';
|
|
3
|
-
import { ColorbarCommonProps } from '.';
|
|
1
|
+
import type { IColorMapPreset } from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
2
|
+
import type { WidgetProps } from '../../../../widgets/types';
|
|
3
|
+
import type { ColorbarCommonProps } from '.';
|
|
4
4
|
export type ColorbarProps = (WidgetProps & ColorbarCommonProps) & {
|
|
5
5
|
colormaps: IColorMapPreset[];
|
|
6
6
|
activeColormapName?: string;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
declare function extractWindowLevelRegionToolData(viewport: any): {
|
|
2
|
+
scalarData: import("packages/core/dist/esm/types").PixelDataTypedArray;
|
|
3
|
+
minPixelValue: number;
|
|
4
|
+
maxPixelValue: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
rows: number;
|
|
8
|
+
columns: number;
|
|
9
|
+
} | {
|
|
2
10
|
scalarData: any;
|
|
3
11
|
width: any;
|
|
4
12
|
height: any;
|
|
@@ -11,20 +11,14 @@ function extractWindowLevelRegionToolData(viewport) {
|
|
|
11
11
|
function extractImageDataVolume(viewport) {
|
|
12
12
|
const { scalarData, width, height } = csUtils.getCurrentVolumeViewportSlice(viewport);
|
|
13
13
|
const { min: minPixelValue, max: maxPixelValue } = csUtils.getMinMax(scalarData);
|
|
14
|
-
const volumeId = viewport.getVolumeId();
|
|
15
|
-
const volume = cache.getVolume(volumeId);
|
|
16
|
-
const { metadata, cornerstoneImageMetaData } = volume;
|
|
17
|
-
const { Rows: rows, Columns: columns } = metadata;
|
|
18
|
-
const { color } = cornerstoneImageMetaData;
|
|
19
14
|
return {
|
|
20
15
|
scalarData,
|
|
21
|
-
width,
|
|
22
|
-
height,
|
|
23
16
|
minPixelValue,
|
|
24
17
|
maxPixelValue,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
width,
|
|
19
|
+
height,
|
|
20
|
+
rows: width,
|
|
21
|
+
columns: height,
|
|
28
22
|
};
|
|
29
23
|
}
|
|
30
24
|
function extractImageDataStack(viewport) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { WidgetProps } from './WidgetProps';
|
|
2
|
-
export { WidgetSize } from './WidgetSize';
|
|
1
|
+
export type { WidgetProps } from './WidgetProps';
|
|
2
|
+
export type { WidgetSize } from './WidgetSize';
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { expose } from 'comlink';
|
|
2
|
+
import { utilities } from '@cornerstonejs/core';
|
|
2
3
|
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
3
4
|
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
|
|
4
5
|
import ICRPolySeg from '@icr/polyseg-wasm';
|
|
5
|
-
import { utilities } from '@cornerstonejs/core';
|
|
6
6
|
import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
|
|
7
7
|
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
|
|
8
8
|
import vtkContourLoopExtraction from '@kitware/vtk.js/Filters/General/ContourLoopExtraction';
|
|
9
9
|
import vtkCutter from '@kitware/vtk.js/Filters/Core/Cutter';
|
|
10
10
|
import { getBoundingBoxAroundShapeWorld } from '../utilities/boundingBox';
|
|
11
|
-
import { pointInShapeCallback } from '../utilities';
|
|
12
11
|
import { containsPoint, getAABB, projectTo2D, } from '../utilities/math/polyline';
|
|
13
12
|
import { isPlaneIntersectingAABB } from '../utilities/planar';
|
|
14
13
|
const polySegConverters = {
|
|
@@ -57,7 +56,10 @@ const polySegConverters = {
|
|
|
57
56
|
updateProgress: progressCallback,
|
|
58
57
|
});
|
|
59
58
|
const { segmentIndices, scalarData, annotationUIDsInSegmentMap, dimensions, origin, direction, spacing, } = args;
|
|
60
|
-
const segmentationVoxelManager = utilities.VoxelManager.
|
|
59
|
+
const segmentationVoxelManager = utilities.VoxelManager.createScalarVolumeVoxelManager({
|
|
60
|
+
dimensions,
|
|
61
|
+
scalarData,
|
|
62
|
+
});
|
|
61
63
|
const imageData = vtkImageData.newInstance();
|
|
62
64
|
imageData.setDimensions(dimensions);
|
|
63
65
|
imageData.setOrigin(origin);
|
|
@@ -95,19 +97,27 @@ const polySegConverters = {
|
|
|
95
97
|
});
|
|
96
98
|
const firstDim = (sharedDimensionIndex + 1) % 3;
|
|
97
99
|
const secondDim = (sharedDimensionIndex + 2) % 3;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return isInside;
|
|
104
|
-
}, ({ pointIJK }) => {
|
|
100
|
+
const voxels = utilities.VoxelManager.createScalarVolumeVoxelManager({
|
|
101
|
+
dimensions,
|
|
102
|
+
scalarData,
|
|
103
|
+
});
|
|
104
|
+
voxels.forEach(({ pointIJK }) => {
|
|
105
105
|
segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
}, {
|
|
107
|
+
imageData,
|
|
108
|
+
isInObject: (pointLPS) => {
|
|
109
|
+
const point2D = [pointLPS[firstDim], pointLPS[secondDim]];
|
|
110
|
+
const isInside = containsPoint(projectedPolyline, point2D, {
|
|
111
|
+
holes,
|
|
112
|
+
});
|
|
113
|
+
return isInside;
|
|
114
|
+
},
|
|
115
|
+
boundsIJK: [
|
|
116
|
+
[iMin, iMax],
|
|
117
|
+
[jMin, jMax],
|
|
118
|
+
[kMin, kMax],
|
|
119
|
+
],
|
|
120
|
+
});
|
|
111
121
|
}
|
|
112
122
|
}
|
|
113
123
|
return segmentationVoxelManager.scalarData;
|
|
@@ -122,7 +132,10 @@ const polySegConverters = {
|
|
|
122
132
|
const segmentationVoxelManagers = new Map();
|
|
123
133
|
segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
|
|
124
134
|
const { dimensions, scalarData, direction, spacing, origin } = segmentationInfo;
|
|
125
|
-
const manager = utilities.VoxelManager.
|
|
135
|
+
const manager = utilities.VoxelManager.createScalarVolumeVoxelManager({
|
|
136
|
+
dimensions,
|
|
137
|
+
scalarData,
|
|
138
|
+
});
|
|
126
139
|
const imageData = vtkImageData.newInstance();
|
|
127
140
|
imageData.setDimensions(dimensions);
|
|
128
141
|
imageData.setOrigin(origin);
|
|
@@ -163,19 +176,27 @@ const polySegConverters = {
|
|
|
163
176
|
});
|
|
164
177
|
const firstDim = (sharedDimensionIndex + 1) % 3;
|
|
165
178
|
const secondDim = (sharedDimensionIndex + 2) % 3;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return isInside;
|
|
172
|
-
}, ({ pointIJK }) => {
|
|
179
|
+
const voxels = utilities.VoxelManager.createScalarVolumeVoxelManager({
|
|
180
|
+
dimensions: imageData.getDimensions(),
|
|
181
|
+
scalarData: imageData.getPointData().getScalars().getData(),
|
|
182
|
+
});
|
|
183
|
+
voxels.forEach(({ pointIJK }) => {
|
|
173
184
|
segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
185
|
+
}, {
|
|
186
|
+
imageData,
|
|
187
|
+
isInObject: (pointLPS) => {
|
|
188
|
+
const point2D = [pointLPS[firstDim], pointLPS[secondDim]];
|
|
189
|
+
const isInside = containsPoint(projectedPolyline, point2D, {
|
|
190
|
+
holes,
|
|
191
|
+
});
|
|
192
|
+
return isInside;
|
|
193
|
+
},
|
|
194
|
+
boundsIJK: [
|
|
195
|
+
[iMin, iMax],
|
|
196
|
+
[jMin, jMax],
|
|
197
|
+
[kMin, kMax],
|
|
198
|
+
],
|
|
199
|
+
});
|
|
179
200
|
}
|
|
180
201
|
}
|
|
181
202
|
segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
|
|
@@ -216,7 +237,12 @@ const polySegConverters = {
|
|
|
216
237
|
});
|
|
217
238
|
targetImageData.getPointData().setScalars(scalarArray);
|
|
218
239
|
targetImageData.modified();
|
|
219
|
-
const
|
|
240
|
+
const { dimensions } = args;
|
|
241
|
+
const scalarData = targetImageData.getPointData().getScalars().getData();
|
|
242
|
+
const segmentationVoxelManager = utilities.VoxelManager.createScalarVolumeVoxelManager({
|
|
243
|
+
dimensions,
|
|
244
|
+
scalarData,
|
|
245
|
+
});
|
|
220
246
|
const outputVolumesInfo = results.map((result) => {
|
|
221
247
|
const { data, dimensions, direction, origin, spacing } = result;
|
|
222
248
|
const volume = vtkImageData.newInstance();
|
|
@@ -231,7 +257,10 @@ const polySegConverters = {
|
|
|
231
257
|
});
|
|
232
258
|
volume.getPointData().setScalars(scalarArray);
|
|
233
259
|
volume.modified();
|
|
234
|
-
const voxelManager = utilities.VoxelManager.
|
|
260
|
+
const voxelManager = utilities.VoxelManager.createScalarVolumeVoxelManager({
|
|
261
|
+
dimensions,
|
|
262
|
+
scalarData: data,
|
|
263
|
+
});
|
|
235
264
|
const extent = volume.getExtent();
|
|
236
265
|
return {
|
|
237
266
|
volume,
|
|
@@ -241,7 +270,11 @@ const polySegConverters = {
|
|
|
241
270
|
segmentIndex: result.segmentIndex,
|
|
242
271
|
};
|
|
243
272
|
});
|
|
244
|
-
|
|
273
|
+
const voxels = utilities.VoxelManager.createScalarVolumeVoxelManager({
|
|
274
|
+
dimensions: targetImageData.getDimensions(),
|
|
275
|
+
scalarData: targetImageData.getPointData().getScalars().getData(),
|
|
276
|
+
});
|
|
277
|
+
voxels.forEach(({ pointIJK, pointLPS }) => {
|
|
245
278
|
try {
|
|
246
279
|
for (const volumeInfo of outputVolumesInfo) {
|
|
247
280
|
const { volume, extent, voxelManager, segmentIndex } = volumeInfo;
|
|
@@ -264,7 +297,7 @@ const polySegConverters = {
|
|
|
264
297
|
}
|
|
265
298
|
catch (error) {
|
|
266
299
|
}
|
|
267
|
-
});
|
|
300
|
+
}, { imageData: targetImageData });
|
|
268
301
|
return segmentationVoxelManager.scalarData;
|
|
269
302
|
},
|
|
270
303
|
getSurfacesAABBs({ surfacesInfo }) {
|