@cornerstonejs/tools 1.52.0 → 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/drawingSvg/drawPath.d.ts +11 -0
- package/dist/cjs/drawingSvg/drawPath.js +55 -0
- package/dist/cjs/drawingSvg/drawPath.js.map +1 -0
- package/dist/cjs/drawingSvg/drawPolyline.d.ts +1 -1
- package/dist/cjs/drawingSvg/drawPolyline.js +2 -10
- package/dist/cjs/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/cjs/drawingSvg/index.d.ts +2 -1
- package/dist/cjs/drawingSvg/index.js +3 -1
- package/dist/cjs/drawingSvg/index.js.map +1 -1
- package/dist/cjs/enums/WorkerTypes.d.ts +8 -0
- package/dist/cjs/enums/WorkerTypes.js +12 -0
- package/dist/cjs/enums/WorkerTypes.js.map +1 -0
- package/dist/cjs/enums/index.d.ts +2 -1
- package/dist/cjs/enums/index.js +3 -1
- package/dist/cjs/enums/index.js.map +1 -1
- package/dist/cjs/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
- package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +1 -1
- package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +171 -89
- package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
- package/dist/cjs/eventListeners/segmentation/imageChangeEventListener.js +4 -3
- package/dist/cjs/eventListeners/segmentation/imageChangeEventListener.js.map +1 -1
- package/dist/cjs/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +58 -47
- package/dist/cjs/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +1 -0
- package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +5 -0
- package/dist/cjs/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/annotationState.d.ts +7 -1
- package/dist/cjs/stateManagement/annotation/annotationState.js +54 -1
- package/dist/cjs/stateManagement/annotation/annotationState.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/helpers/state.d.ts +2 -1
- package/dist/cjs/stateManagement/annotation/helpers/state.js +14 -3
- package/dist/cjs/stateManagement/annotation/helpers/state.js.map +1 -1
- package/dist/cjs/stateManagement/index.d.ts +6 -1
- package/dist/cjs/stateManagement/index.js +6 -1
- package/dist/cjs/stateManagement/index.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js +4 -1
- package/dist/cjs/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/addRepresentationData.d.ts +12 -0
- package/dist/cjs/stateManagement/segmentation/addRepresentationData.js +35 -0
- package/dist/cjs/stateManagement/segmentation/addRepresentationData.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentation.js +32 -14
- package/dist/cjs/stateManagement/segmentation/addSegmentationRepresentation.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js +3 -52
- package/dist/cjs/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts +9 -2
- package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.js +44 -27
- package/dist/cjs/stateManagement/segmentation/convertStackToVolumeSegmentation.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts +13 -0
- package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.js +52 -26
- package/dist/cjs/stateManagement/segmentation/convertVolumeToStackSegmentation.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js +6 -9
- package/dist/cjs/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/index.d.ts +3 -1
- package/dist/cjs/stateManagement/segmentation/index.js +5 -1
- package/dist/cjs/stateManagement/segmentation/index.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +2 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +8 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +2 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js +11 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +7 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +162 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +6 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +71 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +6 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +120 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +4 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js +12 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +3 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +52 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +3 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +60 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +5 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +56 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +12 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +94 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +74 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts +2 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +83 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +3 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +64 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/index.d.ts +5 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/index.js +12 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/index.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.js +27 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/registerPolySegWorker.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/segmentIndex.js +4 -0
- package/dist/cjs/stateManagement/segmentation/segmentIndex.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/segmentationState.d.ts +6 -1
- package/dist/cjs/stateManagement/segmentation/segmentationState.js +30 -1
- package/dist/cjs/stateManagement/segmentation/segmentationState.js.map +1 -1
- package/dist/cjs/store/ToolGroupManager/ToolGroup.d.ts +3 -1
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js +3 -2
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/cjs/tools/ScaleOverlayTool.js +2 -1
- package/dist/cjs/tools/ScaleOverlayTool.js.map +1 -1
- package/dist/cjs/tools/SegmentationIntersectionTool.js +1 -1
- package/dist/cjs/tools/SegmentationIntersectionTool.js.map +1 -1
- package/dist/cjs/tools/annotation/LivewireContourSegmentationTool.js +1 -1
- package/dist/cjs/tools/annotation/LivewireContourSegmentationTool.js.map +1 -1
- package/dist/cjs/tools/annotation/LivewireContourTool.d.ts +4 -3
- package/dist/cjs/tools/annotation/LivewireContourTool.js +26 -26
- package/dist/cjs/tools/annotation/LivewireContourTool.js.map +1 -1
- package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -2
- package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.js +0 -11
- package/dist/cjs/tools/annotation/PlanarFreehandContourSegmentationTool.js.map +1 -1
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js +2 -2
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/ProbeTool.js +3 -0
- package/dist/cjs/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/cjs/tools/annotation/SplineROITool.d.ts +6 -3
- package/dist/cjs/tools/annotation/SplineROITool.js +37 -18
- package/dist/cjs/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +12 -7
- package/dist/cjs/tools/annotation/planarFreehandROITool/closedContourEditLoop.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js +25 -19
- package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEditLoop.js +16 -10
- package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEditLoop.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/renderMethods.js +19 -7
- package/dist/cjs/tools/annotation/planarFreehandROITool/renderMethods.js.map +1 -1
- package/dist/cjs/tools/annotation/splines/LinearSpline.js +1 -1
- package/dist/cjs/tools/annotation/splines/LinearSpline.js.map +1 -1
- package/dist/cjs/tools/annotation/splines/Spline.d.ts +2 -0
- package/dist/cjs/tools/annotation/splines/Spline.js +7 -3
- package/dist/cjs/tools/annotation/splines/Spline.js.map +1 -1
- package/dist/cjs/tools/base/AnnotationTool.js +1 -1
- package/dist/cjs/tools/base/AnnotationTool.js.map +1 -1
- package/dist/cjs/tools/base/BaseTool.js.map +1 -1
- package/dist/cjs/tools/base/ContourBaseTool.d.ts +1 -0
- package/dist/cjs/tools/base/ContourBaseTool.js +18 -1
- package/dist/cjs/tools/base/ContourBaseTool.js.map +1 -1
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.d.ts +1 -2
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.js +28 -24
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Contour/contourConfig.js +1 -0
- package/dist/cjs/tools/displayTools/Contour/contourConfig.js.map +1 -1
- package/dist/cjs/tools/displayTools/Contour/contourDisplay.js +9 -6
- package/dist/cjs/tools/displayTools/Contour/contourDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/Contour/removeContourFromElement.js.map +1 -1
- package/dist/cjs/tools/displayTools/Contour/{addContourSetsToElement.d.ts → vtkContour/addContourSetsToElement.d.ts} +1 -1
- package/dist/cjs/tools/displayTools/Contour/vtkContour/addContourSetsToElement.js.map +1 -0
- package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts +3 -0
- package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js +14 -0
- package/dist/cjs/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js.map +1 -0
- package/dist/cjs/tools/displayTools/Contour/vtkContour/contourConfigCache.js.map +1 -0
- package/dist/cjs/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts +3 -0
- package/dist/cjs/tools/displayTools/Contour/{updateContourSets.js → vtkContour/updateVTKContourSets.js} +4 -4
- package/dist/cjs/tools/displayTools/Contour/vtkContour/updateVTKContourSets.js.map +1 -0
- package/dist/cjs/tools/displayTools/Contour/{utils.d.ts → vtkContour/utils.d.ts} +2 -2
- package/dist/cjs/tools/displayTools/Contour/vtkContour/utils.js.map +1 -0
- package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/index.d.ts +2 -1
- package/dist/cjs/tools/displayTools/Labelmap/index.js +4 -1
- package/dist/cjs/tools/displayTools/Labelmap/index.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +20 -2
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.d.ts +4 -0
- package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.js +38 -0
- package/dist/cjs/tools/displayTools/Labelmap/validateLabelmap.js.map +1 -0
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts +3 -0
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +112 -0
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceConfig.d.ts +3 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceConfig.js +11 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceConfig.js.map +1 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.d.ts +7 -0
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js +173 -27
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.d.ts +1 -0
- package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js +27 -0
- package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js.map +1 -0
- package/dist/cjs/tools/segmentation/BrushTool.js +1 -1
- package/dist/cjs/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/CircleScissorsTool.js +1 -1
- package/dist/cjs/tools/segmentation/CircleScissorsTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/PaintFillTool.js +1 -1
- package/dist/cjs/tools/segmentation/PaintFillTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/RectangleScissorsTool.js +1 -1
- package/dist/cjs/tools/segmentation/RectangleScissorsTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/SegmentSelectTool.d.ts +6 -2
- package/dist/cjs/tools/segmentation/SegmentSelectTool.js +45 -35
- package/dist/cjs/tools/segmentation/SegmentSelectTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/SphereScissorsTool.js +1 -1
- package/dist/cjs/tools/segmentation/SphereScissorsTool.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/BrushStrategy.js +7 -5
- package/dist/cjs/tools/segmentation/strategies/BrushStrategy.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/compositions/regionFill.js +1 -1
- package/dist/cjs/tools/segmentation/strategies/compositions/regionFill.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/fillSphere.js +14 -5
- package/dist/cjs/tools/segmentation/strategies/fillSphere.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/utils/getStrategyData.js +21 -9
- package/dist/cjs/tools/segmentation/strategies/utils/getStrategyData.js.map +1 -1
- package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +5 -5
- package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.js +15 -8
- package/dist/cjs/tools/segmentation/strategies/utils/stackVolumeCheck.js.map +1 -1
- package/dist/cjs/types/AnnotationTypes.d.ts +2 -0
- package/dist/cjs/types/ContourAnnotation.d.ts +6 -0
- package/dist/cjs/types/ContourAnnotation.js +7 -0
- package/dist/cjs/types/ContourAnnotation.js.map +1 -1
- package/dist/cjs/types/ContourSegmentationAnnotation.d.ts +0 -1
- package/dist/cjs/types/ContourTypes.d.ts +1 -0
- package/dist/cjs/types/EventTypes.d.ts +4 -1
- package/dist/cjs/types/ISpline.d.ts +1 -0
- package/dist/cjs/types/LabelmapTypes.d.ts +5 -1
- package/dist/cjs/types/PolySeg.d.ts +6 -0
- package/dist/cjs/types/PolySeg.js +3 -0
- package/dist/cjs/types/PolySeg.js.map +1 -0
- package/dist/cjs/types/SegmentationStateTypes.d.ts +12 -2
- package/dist/cjs/types/SplineProps.d.ts +1 -0
- package/dist/cjs/types/SurfaceTypes.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/utilities/boundingBox/getBoundingBoxAroundShape.js +6 -6
- package/dist/cjs/utilities/boundingBox/getBoundingBoxAroundShape.js.map +1 -1
- package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +2 -0
- package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js +20 -0
- package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -0
- package/dist/cjs/utilities/contourSegmentation/areSameSegment.js +0 -2
- package/dist/cjs/utilities/contourSegmentation/areSameSegment.js.map +1 -1
- package/dist/cjs/utilities/contourSegmentation/index.d.ts +2 -0
- package/dist/cjs/utilities/contourSegmentation/index.js +5 -1
- package/dist/cjs/utilities/contourSegmentation/index.js.map +1 -1
- package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +2 -0
- package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +19 -0
- package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -0
- package/dist/cjs/utilities/contours/detectContourHoles.js.map +1 -1
- package/dist/cjs/utilities/contours/generateContourSetsFromLabelmap.js +2 -2
- package/dist/cjs/utilities/contours/generateContourSetsFromLabelmap.js.map +1 -1
- package/dist/cjs/utilities/contours/getContourHolesDataCanvas.d.ts +3 -0
- package/dist/cjs/utilities/contours/getContourHolesDataCanvas.js +21 -0
- package/dist/cjs/utilities/contours/getContourHolesDataCanvas.js.map +1 -0
- package/dist/cjs/utilities/contours/getContourHolesDataWorld.d.ts +3 -0
- package/dist/cjs/utilities/contours/getContourHolesDataWorld.js +10 -0
- package/dist/cjs/utilities/contours/getContourHolesDataWorld.js.map +1 -0
- package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts +11 -0
- package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.js +50 -0
- package/dist/cjs/utilities/contours/getDeduplicatedVTKPolyDataPoints.js.map +1 -0
- package/dist/cjs/utilities/contours/index.d.ts +5 -2
- package/dist/cjs/utilities/contours/index.js +9 -3
- package/dist/cjs/utilities/contours/index.js.map +1 -1
- package/dist/cjs/utilities/contours/updateContourPolyline.d.ts +10 -0
- package/dist/cjs/utilities/contours/updateContourPolyline.js +64 -0
- package/dist/cjs/utilities/contours/updateContourPolyline.js.map +1 -0
- package/dist/cjs/utilities/index.d.ts +3 -1
- package/dist/cjs/utilities/index.js +5 -1
- package/dist/cjs/utilities/index.js.map +1 -1
- package/dist/cjs/utilities/math/polyline/containsPoint.js.map +1 -1
- package/dist/cjs/utilities/math/polyline/containsPoints.d.ts +2 -0
- package/dist/cjs/utilities/math/polyline/containsPoints.js +16 -0
- package/dist/cjs/utilities/math/polyline/containsPoints.js.map +1 -0
- package/dist/cjs/utilities/math/polyline/getWindingDirection.d.ts +2 -0
- package/dist/cjs/utilities/math/polyline/getWindingDirection.js +12 -0
- package/dist/cjs/utilities/math/polyline/getWindingDirection.js.map +1 -0
- package/dist/cjs/utilities/math/polyline/index.d.ts +4 -1
- package/dist/cjs/utilities/math/polyline/index.js +7 -1
- package/dist/cjs/utilities/math/polyline/index.js.map +1 -1
- package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.d.ts +2 -0
- package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.js +34 -0
- package/dist/cjs/utilities/math/polyline/isPointInsidePolyline3D.js.map +1 -0
- package/dist/cjs/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +1 -0
- package/dist/cjs/utilities/segmentation/contourAndFindLargestBidirectional.js +0 -1
- package/dist/cjs/utilities/segmentation/contourAndFindLargestBidirectional.js.map +1 -1
- package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts +1 -0
- package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.js +18 -0
- package/dist/cjs/utilities/segmentation/getHoveredContourSegmentationAnnotation.js.map +1 -0
- package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts +7 -0
- package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.js +77 -0
- package/dist/cjs/utilities/segmentation/getSegmentAtLabelmapBorder.js.map +1 -0
- package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.d.ts +11 -0
- package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.js +82 -0
- package/dist/cjs/utilities/segmentation/getSegmentAtWorldPoint.js.map +1 -0
- package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.d.ts +2 -0
- package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js +59 -0
- package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -0
- package/dist/cjs/utilities/segmentation/index.d.ts +5 -1
- package/dist/cjs/utilities/segmentation/index.js +9 -1
- package/dist/cjs/utilities/segmentation/index.js.map +1 -1
- package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.d.ts +2 -0
- package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.js +32 -0
- package/dist/cjs/utilities/triggerAnnotationRenderForToolGroupIds.js.map +1 -0
- package/dist/cjs/workers/clippingPlaneWorker.d.ts +1 -0
- package/dist/cjs/workers/clippingPlaneWorker.js +63 -0
- package/dist/cjs/workers/clippingPlaneWorker.js.map +1 -0
- package/dist/cjs/workers/polySegConverters.d.ts +1 -0
- package/dist/cjs/workers/polySegConverters.js +267 -0
- package/dist/cjs/workers/polySegConverters.js.map +1 -0
- package/dist/esm/drawingSvg/drawPath.js +49 -0
- package/dist/esm/drawingSvg/drawPath.js.map +1 -0
- package/dist/esm/drawingSvg/drawPolyline.js +2 -10
- package/dist/esm/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/esm/drawingSvg/index.js +2 -1
- package/dist/esm/drawingSvg/index.js.map +1 -1
- package/dist/esm/enums/WorkerTypes.js +10 -0
- package/dist/esm/enums/WorkerTypes.js.map +1 -0
- package/dist/esm/enums/index.js +2 -1
- package/dist/esm/enums/index.js.map +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +112 -43
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
- package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js +3 -3
- package/dist/esm/eventListeners/segmentation/imageChangeEventListener.js.map +1 -1
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js +59 -45
- package/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js.map +1 -1
- package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js +5 -0
- package/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js.map +1 -1
- package/dist/esm/stateManagement/annotation/annotationState.js +46 -1
- package/dist/esm/stateManagement/annotation/annotationState.js.map +1 -1
- package/dist/esm/stateManagement/annotation/helpers/state.js +12 -2
- package/dist/esm/stateManagement/annotation/helpers/state.js.map +1 -1
- package/dist/esm/stateManagement/index.js +2 -2
- package/dist/esm/stateManagement/index.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js +4 -1
- package/dist/esm/stateManagement/segmentation/SegmentationStateManager.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/addRepresentationData.js +30 -0
- package/dist/esm/stateManagement/segmentation/addRepresentationData.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.js +32 -15
- package/dist/esm/stateManagement/segmentation/addSegmentationRepresentation.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js +1 -46
- package/dist/esm/stateManagement/segmentation/config/segmentationVisibility.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js +42 -27
- package/dist/esm/stateManagement/segmentation/convertStackToVolumeSegmentation.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js +49 -25
- package/dist/esm/stateManagement/segmentation/convertVolumeToStackSegmentation.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js +6 -6
- package/dist/esm/stateManagement/segmentation/helpers/validateSegmentationInput.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/index.js +3 -1
- package/dist/esm/stateManagement/segmentation/index.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +4 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js +7 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +142 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +53 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +108 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js +8 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +37 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +45 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js +41 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js +78 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js +59 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js +68 -0
- package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +47 -0
- package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/index.js +6 -0
- package/dist/esm/stateManagement/segmentation/polySeg/index.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/registerPolySegWorker.js +23 -0
- package/dist/esm/stateManagement/segmentation/polySeg/registerPolySegWorker.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/segmentIndex.js +4 -0
- package/dist/esm/stateManagement/segmentation/segmentIndex.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/segmentationState.js +28 -1
- package/dist/esm/stateManagement/segmentation/segmentationState.js.map +1 -1
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +3 -2
- package/dist/esm/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/esm/tools/ScaleOverlayTool.js +2 -1
- package/dist/esm/tools/ScaleOverlayTool.js.map +1 -1
- package/dist/esm/tools/SegmentationIntersectionTool.js +1 -1
- package/dist/esm/tools/SegmentationIntersectionTool.js.map +1 -1
- package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js +1 -1
- package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js.map +1 -1
- package/dist/esm/tools/annotation/LivewireContourTool.js +28 -28
- package/dist/esm/tools/annotation/LivewireContourTool.js.map +1 -1
- package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js +0 -11
- package/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js.map +1 -1
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +3 -3
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/esm/tools/annotation/ProbeTool.js +3 -0
- package/dist/esm/tools/annotation/ProbeTool.js.map +1 -1
- package/dist/esm/tools/annotation/SplineROITool.js +37 -19
- package/dist/esm/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +12 -7
- package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js +26 -20
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js +16 -10
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js +20 -8
- package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js.map +1 -1
- package/dist/esm/tools/annotation/splines/LinearSpline.js +1 -1
- package/dist/esm/tools/annotation/splines/LinearSpline.js.map +1 -1
- package/dist/esm/tools/annotation/splines/Spline.js +5 -1
- package/dist/esm/tools/annotation/splines/Spline.js.map +1 -1
- package/dist/esm/tools/base/AnnotationTool.js +1 -1
- package/dist/esm/tools/base/AnnotationTool.js.map +1 -1
- package/dist/esm/tools/base/BaseTool.js +1 -1
- package/dist/esm/tools/base/BaseTool.js.map +1 -1
- package/dist/esm/tools/base/ContourBaseTool.js +20 -3
- package/dist/esm/tools/base/ContourBaseTool.js.map +1 -1
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js +28 -24
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Contour/contourConfig.js +1 -0
- package/dist/esm/tools/displayTools/Contour/contourConfig.js.map +1 -1
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js +10 -7
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/Contour/removeContourFromElement.js.map +1 -1
- package/dist/esm/tools/displayTools/Contour/vtkContour/addContourSetsToElement.js.map +1 -0
- package/dist/esm/tools/displayTools/Contour/{addOrUpdateContourSets.js → vtkContour/addOrUpdateVTKContourSets.js} +4 -4
- package/dist/esm/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.js.map +1 -0
- package/dist/esm/tools/displayTools/Contour/vtkContour/contourConfigCache.js.map +1 -0
- package/dist/esm/tools/displayTools/Contour/{updateContourSets.js → vtkContour/updateVTKContourSets.js} +2 -2
- package/dist/esm/tools/displayTools/Contour/vtkContour/updateVTKContourSets.js.map +1 -0
- package/dist/esm/tools/displayTools/Contour/vtkContour/utils.js.map +1 -0
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js +1 -1
- package/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/index.js +2 -1
- package/dist/esm/tools/displayTools/Labelmap/index.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +20 -2
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.js +33 -0
- package/dist/esm/tools/displayTools/Labelmap/validateLabelmap.js.map +1 -0
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +106 -0
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -0
- package/dist/esm/tools/displayTools/Surface/surfaceConfig.js +9 -0
- package/dist/esm/tools/displayTools/Surface/surfaceConfig.js.map +1 -0
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +162 -28
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js +23 -0
- package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js.map +1 -0
- package/dist/esm/tools/segmentation/BrushTool.js +1 -1
- package/dist/esm/tools/segmentation/BrushTool.js.map +1 -1
- package/dist/esm/tools/segmentation/CircleScissorsTool.js +1 -1
- package/dist/esm/tools/segmentation/CircleScissorsTool.js.map +1 -1
- package/dist/esm/tools/segmentation/PaintFillTool.js +1 -1
- package/dist/esm/tools/segmentation/PaintFillTool.js.map +1 -1
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js +1 -1
- package/dist/esm/tools/segmentation/RectangleScissorsTool.js.map +1 -1
- package/dist/esm/tools/segmentation/SegmentSelectTool.js +47 -37
- package/dist/esm/tools/segmentation/SegmentSelectTool.js.map +1 -1
- package/dist/esm/tools/segmentation/SphereScissorsTool.js +1 -1
- package/dist/esm/tools/segmentation/SphereScissorsTool.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.js +7 -5
- package/dist/esm/tools/segmentation/strategies/BrushStrategy.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js +1 -1
- package/dist/esm/tools/segmentation/strategies/compositions/regionFill.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/fillSphere.js +14 -5
- package/dist/esm/tools/segmentation/strategies/fillSphere.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js +21 -9
- package/dist/esm/tools/segmentation/strategies/utils/getStrategyData.js.map +1 -1
- package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js +15 -7
- package/dist/esm/tools/segmentation/strategies/utils/stackVolumeCheck.js.map +1 -1
- package/dist/esm/types/ContourAnnotation.js +6 -1
- package/dist/esm/types/ContourAnnotation.js.map +1 -1
- package/dist/esm/types/PolySeg.js +2 -0
- package/dist/esm/types/PolySeg.js.map +1 -0
- package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js +3 -2
- package/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js.map +1 -1
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js +16 -0
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -0
- package/dist/esm/utilities/contourSegmentation/areSameSegment.js +0 -2
- package/dist/esm/utilities/contourSegmentation/areSameSegment.js.map +1 -1
- package/dist/esm/utilities/contourSegmentation/index.js +2 -0
- package/dist/esm/utilities/contourSegmentation/index.js.map +1 -1
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +15 -0
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -0
- package/dist/esm/utilities/contours/detectContourHoles.js.map +1 -1
- package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js +2 -2
- package/dist/esm/utilities/contours/generateContourSetsFromLabelmap.js.map +1 -1
- package/dist/esm/utilities/contours/getContourHolesDataCanvas.js +15 -0
- package/dist/esm/utilities/contours/getContourHolesDataCanvas.js.map +1 -0
- package/dist/esm/utilities/contours/getContourHolesDataWorld.js +6 -0
- package/dist/esm/utilities/contours/getContourHolesDataWorld.js.map +1 -0
- package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js +46 -0
- package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js.map +1 -0
- package/dist/esm/utilities/contours/index.js +5 -2
- package/dist/esm/utilities/contours/index.js.map +1 -1
- package/dist/esm/utilities/contours/updateContourPolyline.js +38 -0
- package/dist/esm/utilities/contours/updateContourPolyline.js.map +1 -0
- package/dist/esm/utilities/index.js +3 -1
- package/dist/esm/utilities/index.js.map +1 -1
- package/dist/esm/utilities/math/polyline/containsPoint.js.map +1 -1
- package/dist/esm/utilities/math/polyline/containsPoints.js +10 -0
- package/dist/esm/utilities/math/polyline/containsPoints.js.map +1 -0
- package/dist/esm/utilities/math/polyline/getWindingDirection.js +6 -0
- package/dist/esm/utilities/math/polyline/getWindingDirection.js.map +1 -0
- package/dist/esm/utilities/math/polyline/index.js +4 -1
- package/dist/esm/utilities/math/polyline/index.js.map +1 -1
- package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js +27 -0
- package/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js.map +1 -0
- package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.js +0 -1
- package/dist/esm/utilities/segmentation/contourAndFindLargestBidirectional.js.map +1 -1
- package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.js +14 -0
- package/dist/esm/utilities/segmentation/getHoveredContourSegmentationAnnotation.js.map +1 -0
- package/dist/esm/utilities/segmentation/getSegmentAtLabelmapBorder.js +73 -0
- package/dist/esm/utilities/segmentation/getSegmentAtLabelmapBorder.js.map +1 -0
- package/dist/esm/utilities/segmentation/getSegmentAtWorldPoint.js +75 -0
- package/dist/esm/utilities/segmentation/getSegmentAtWorldPoint.js.map +1 -0
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +55 -0
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -0
- package/dist/esm/utilities/segmentation/index.js +5 -1
- package/dist/esm/utilities/segmentation/index.js.map +1 -1
- package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js +25 -0
- package/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js.map +1 -0
- package/dist/esm/workers/clippingPlaneWorker.js +58 -0
- package/dist/esm/workers/clippingPlaneWorker.js.map +1 -0
- package/dist/esm/workers/polySegConverters.js +241 -0
- package/dist/esm/workers/polySegConverters.js.map +1 -0
- package/dist/types/drawingSvg/drawPath.d.ts +12 -0
- package/dist/types/drawingSvg/drawPath.d.ts.map +1 -0
- package/dist/types/drawingSvg/drawPolyline.d.ts +1 -1
- package/dist/types/drawingSvg/drawPolyline.d.ts.map +1 -1
- package/dist/types/drawingSvg/index.d.ts +2 -1
- package/dist/types/drawingSvg/index.d.ts.map +1 -1
- package/dist/types/enums/WorkerTypes.d.ts +9 -0
- package/dist/types/enums/WorkerTypes.d.ts.map +1 -0
- package/dist/types/enums/index.d.ts +2 -1
- package/dist/types/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +1 -1
- package/dist/types/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts.map +1 -1
- package/dist/types/eventListeners/segmentation/imageChangeEventListener.d.ts.map +1 -1
- package/dist/types/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.d.ts.map +1 -1
- package/dist/types/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts +1 -0
- package/dist/types/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.d.ts.map +1 -1
- package/dist/types/stateManagement/annotation/annotationState.d.ts +7 -1
- package/dist/types/stateManagement/annotation/annotationState.d.ts.map +1 -1
- package/dist/types/stateManagement/annotation/helpers/state.d.ts +2 -1
- package/dist/types/stateManagement/annotation/helpers/state.d.ts.map +1 -1
- package/dist/types/stateManagement/index.d.ts +6 -1
- package/dist/types/stateManagement/segmentation/SegmentationStateManager.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/addRepresentationData.d.ts +13 -0
- package/dist/types/stateManagement/segmentation/addRepresentationData.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/addSegmentationRepresentation.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/config/segmentationVisibility.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts +9 -2
- package/dist/types/stateManagement/segmentation/convertStackToVolumeSegmentation.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts +13 -0
- package/dist/types/stateManagement/segmentation/convertVolumeToStackSegmentation.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/helpers/validateSegmentationInput.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/index.d.ts +3 -1
- package/dist/types/stateManagement/segmentation/index.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +3 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts +3 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts +8 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts +7 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts +7 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts +5 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts +4 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts +4 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts +6 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts +13 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts +2 -0
- package/dist/types/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts +3 -0
- package/dist/types/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts +4 -0
- package/dist/types/stateManagement/segmentation/polySeg/computeAndAddRepresentation.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/index.d.ts +6 -0
- package/dist/types/stateManagement/segmentation/polySeg/index.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts +2 -0
- package/dist/types/stateManagement/segmentation/polySeg/registerPolySegWorker.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/segmentIndex.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/segmentationState.d.ts +6 -1
- package/dist/types/stateManagement/segmentation/segmentationState.d.ts.map +1 -1
- package/dist/types/store/ToolGroupManager/ToolGroup.d.ts +3 -1
- package/dist/types/store/ToolGroupManager/ToolGroup.d.ts.map +1 -1
- package/dist/types/tools/ScaleOverlayTool.d.ts.map +1 -1
- package/dist/types/tools/annotation/LivewireContourTool.d.ts +4 -3
- package/dist/types/tools/annotation/LivewireContourTool.d.ts.map +1 -1
- package/dist/types/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts +1 -2
- package/dist/types/tools/annotation/PlanarFreehandContourSegmentationTool.d.ts.map +1 -1
- package/dist/types/tools/annotation/PlanarFreehandROITool.d.ts.map +1 -1
- package/dist/types/tools/annotation/ProbeTool.d.ts.map +1 -1
- package/dist/types/tools/annotation/SplineROITool.d.ts +6 -3
- package/dist/types/tools/annotation/SplineROITool.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/closedContourEditLoop.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/drawLoop.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/openContourEditLoop.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/renderMethods.d.ts.map +1 -1
- package/dist/types/tools/annotation/splines/Spline.d.ts +2 -0
- package/dist/types/tools/annotation/splines/Spline.d.ts.map +1 -1
- package/dist/types/tools/base/AnnotationTool.d.ts.map +1 -1
- package/dist/types/tools/base/BaseTool.d.ts.map +1 -1
- package/dist/types/tools/base/ContourBaseTool.d.ts +1 -0
- package/dist/types/tools/base/ContourBaseTool.d.ts.map +1 -1
- package/dist/types/tools/base/ContourSegmentationBaseTool.d.ts +1 -2
- package/dist/types/tools/base/ContourSegmentationBaseTool.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Contour/contourConfig.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Contour/contourDisplay.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Contour/removeContourFromElement.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Contour/{addContourSetsToElement.d.ts → vtkContour/addContourSetsToElement.d.ts} +1 -1
- package/dist/types/tools/displayTools/Contour/vtkContour/addContourSetsToElement.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts +4 -0
- package/dist/types/tools/displayTools/Contour/vtkContour/addOrUpdateVTKContourSets.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Contour/vtkContour/contourConfigCache.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts +4 -0
- package/dist/types/tools/displayTools/Contour/vtkContour/updateVTKContourSets.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Contour/{utils.d.ts → vtkContour/utils.d.ts} +2 -2
- package/dist/types/tools/displayTools/Contour/vtkContour/utils.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Labelmap/index.d.ts +2 -1
- package/dist/types/tools/displayTools/Labelmap/index.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Labelmap/labelmapDisplay.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Labelmap/validateLabelmap.d.ts +5 -0
- package/dist/types/tools/displayTools/Labelmap/validateLabelmap.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts +4 -0
- package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Surface/surfaceConfig.d.ts +4 -0
- package/dist/types/tools/displayTools/Surface/surfaceConfig.d.ts.map +1 -0
- package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts +7 -0
- package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts.map +1 -1
- package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts +2 -0
- package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts.map +1 -0
- package/dist/types/tools/segmentation/CircleScissorsTool.d.ts.map +1 -1
- package/dist/types/tools/segmentation/RectangleScissorsTool.d.ts.map +1 -1
- package/dist/types/tools/segmentation/SegmentSelectTool.d.ts +6 -2
- package/dist/types/tools/segmentation/SegmentSelectTool.d.ts.map +1 -1
- package/dist/types/tools/segmentation/SphereScissorsTool.d.ts.map +1 -1
- package/dist/types/tools/segmentation/strategies/BrushStrategy.d.ts.map +1 -1
- package/dist/types/tools/segmentation/strategies/fillSphere.d.ts.map +1 -1
- package/dist/types/tools/segmentation/strategies/utils/getStrategyData.d.ts.map +1 -1
- package/dist/types/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts +5 -5
- package/dist/types/tools/segmentation/strategies/utils/stackVolumeCheck.d.ts.map +1 -1
- package/dist/types/types/AnnotationTypes.d.ts +2 -0
- package/dist/types/types/AnnotationTypes.d.ts.map +1 -1
- package/dist/types/types/ContourAnnotation.d.ts +6 -0
- package/dist/types/types/ContourAnnotation.d.ts.map +1 -1
- package/dist/types/types/ContourSegmentationAnnotation.d.ts +0 -1
- package/dist/types/types/ContourSegmentationAnnotation.d.ts.map +1 -1
- package/dist/types/types/ContourTypes.d.ts +1 -0
- package/dist/types/types/ContourTypes.d.ts.map +1 -1
- package/dist/types/types/EventTypes.d.ts +4 -1
- package/dist/types/types/EventTypes.d.ts.map +1 -1
- package/dist/types/types/ISpline.d.ts +1 -0
- package/dist/types/types/ISpline.d.ts.map +1 -1
- package/dist/types/types/LabelmapTypes.d.ts +5 -1
- package/dist/types/types/LabelmapTypes.d.ts.map +1 -1
- package/dist/types/types/PolySeg.d.ts +7 -0
- package/dist/types/types/PolySeg.d.ts.map +1 -0
- package/dist/types/types/SegmentationStateTypes.d.ts +12 -2
- package/dist/types/types/SegmentationStateTypes.d.ts.map +1 -1
- package/dist/types/types/SplineProps.d.ts +1 -0
- package/dist/types/types/SplineProps.d.ts.map +1 -1
- package/dist/types/types/SurfaceTypes.d.ts +1 -1
- package/dist/types/types/SurfaceTypes.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +2 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utilities/boundingBox/getBoundingBoxAroundShape.d.ts.map +1 -1
- package/dist/types/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts +3 -0
- package/dist/types/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts.map +1 -0
- package/dist/types/utilities/contourSegmentation/areSameSegment.d.ts.map +1 -1
- package/dist/types/utilities/contourSegmentation/index.d.ts +2 -0
- package/dist/types/utilities/contourSegmentation/index.d.ts.map +1 -1
- package/dist/types/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts +3 -0
- package/dist/types/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts.map +1 -0
- package/dist/types/utilities/contours/detectContourHoles.d.ts.map +1 -1
- package/dist/types/utilities/contours/getContourHolesDataCanvas.d.ts +4 -0
- package/dist/types/utilities/contours/getContourHolesDataCanvas.d.ts.map +1 -0
- package/dist/types/utilities/contours/getContourHolesDataWorld.d.ts +4 -0
- package/dist/types/utilities/contours/getContourHolesDataWorld.d.ts.map +1 -0
- package/dist/types/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts +12 -0
- package/dist/types/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts.map +1 -0
- package/dist/types/utilities/contours/index.d.ts +5 -2
- package/dist/types/utilities/contours/index.d.ts.map +1 -1
- package/dist/types/utilities/contours/updateContourPolyline.d.ts +11 -0
- package/dist/types/utilities/contours/updateContourPolyline.d.ts.map +1 -0
- package/dist/types/utilities/index.d.ts +3 -1
- package/dist/types/utilities/index.d.ts.map +1 -1
- package/dist/types/utilities/math/polyline/containsPoint.d.ts.map +1 -1
- package/dist/types/utilities/math/polyline/containsPoints.d.ts +3 -0
- package/dist/types/utilities/math/polyline/containsPoints.d.ts.map +1 -0
- package/dist/types/utilities/math/polyline/getWindingDirection.d.ts +3 -0
- package/dist/types/utilities/math/polyline/getWindingDirection.d.ts.map +1 -0
- package/dist/types/utilities/math/polyline/index.d.ts +4 -1
- package/dist/types/utilities/math/polyline/index.d.ts.map +1 -1
- package/dist/types/utilities/math/polyline/isPointInsidePolyline3D.d.ts +3 -0
- package/dist/types/utilities/math/polyline/isPointInsidePolyline3D.d.ts.map +1 -0
- package/dist/types/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +1 -0
- package/dist/types/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts.map +1 -1
- package/dist/types/utilities/segmentation/contourAndFindLargestBidirectional.d.ts.map +1 -1
- package/dist/types/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts +2 -0
- package/dist/types/utilities/segmentation/getHoveredContourSegmentationAnnotation.d.ts.map +1 -0
- package/dist/types/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts +8 -0
- package/dist/types/utilities/segmentation/getSegmentAtLabelmapBorder.d.ts.map +1 -0
- package/dist/types/utilities/segmentation/getSegmentAtWorldPoint.d.ts +12 -0
- package/dist/types/utilities/segmentation/getSegmentAtWorldPoint.d.ts.map +1 -0
- package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts +3 -0
- package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts.map +1 -0
- package/dist/types/utilities/segmentation/index.d.ts +5 -1
- package/dist/types/utilities/segmentation/index.d.ts.map +1 -1
- package/dist/types/utilities/triggerAnnotationRenderForToolGroupIds.d.ts +3 -0
- package/dist/types/utilities/triggerAnnotationRenderForToolGroupIds.d.ts.map +1 -0
- package/dist/types/workers/clippingPlaneWorker.d.ts +2 -0
- package/dist/types/workers/clippingPlaneWorker.d.ts.map +1 -0
- package/dist/types/workers/polySegConverters.d.ts +2 -0
- package/dist/types/workers/polySegConverters.d.ts.map +1 -0
- package/dist/umd/17dd54813d5acc10bf8f.wasm +0 -0
- package/dist/umd/444.index.js +3 -0
- package/dist/umd/444.index.js.LICENSE.txt +5 -0
- package/dist/umd/444.index.js.map +1 -0
- package/dist/umd/78.index.js +3 -0
- package/dist/umd/78.index.js.LICENSE.txt +5 -0
- package/dist/umd/78.index.js.map +1 -0
- package/dist/umd/985.index.js +2 -0
- package/dist/umd/985.index.js.map +1 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +5 -3
- package/src/drawingSvg/drawPath.ts +96 -0
- package/src/drawingSvg/drawPolyline.ts +12 -16
- package/src/drawingSvg/index.ts +2 -0
- package/src/enums/WorkerTypes.ts +16 -0
- package/src/enums/index.js +2 -0
- package/src/eventDispatchers/shared/getActiveToolForMouseEvent.ts +1 -1
- package/src/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.ts +204 -75
- package/src/eventListeners/segmentation/imageChangeEventListener.ts +3 -4
- package/src/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.ts +97 -69
- package/src/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.ts +11 -0
- package/src/stateManagement/annotation/annotationState.ts +107 -0
- package/src/stateManagement/annotation/helpers/state.ts +29 -1
- package/src/stateManagement/index.js +10 -0
- package/src/stateManagement/segmentation/SegmentationStateManager.ts +4 -1
- package/src/stateManagement/segmentation/addRepresentationData.ts +71 -0
- package/src/stateManagement/segmentation/addSegmentationRepresentation.ts +39 -16
- package/src/stateManagement/segmentation/config/segmentationVisibility.ts +1 -59
- package/src/stateManagement/segmentation/convertStackToVolumeSegmentation.ts +74 -37
- package/src/stateManagement/segmentation/convertVolumeToStackSegmentation.ts +102 -38
- package/src/stateManagement/segmentation/helpers/validateSegmentationInput.ts +13 -8
- package/src/stateManagement/segmentation/index.ts +9 -2
- package/src/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.ts +17 -0
- package/src/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.ts +25 -0
- package/src/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.ts +273 -0
- package/src/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.ts +89 -0
- package/src/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.ts +193 -0
- package/src/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.ts +26 -0
- package/src/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.ts +62 -0
- package/src/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.ts +81 -0
- package/src/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.ts +81 -0
- package/src/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.ts +167 -0
- package/src/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.ts +95 -0
- package/src/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.ts +123 -0
- package/src/stateManagement/segmentation/polySeg/computeAndAddRepresentation.ts +97 -0
- package/src/stateManagement/segmentation/polySeg/index.ts +12 -0
- package/src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts +34 -0
- package/src/stateManagement/segmentation/segmentIndex.ts +5 -0
- package/src/stateManagement/segmentation/segmentationState.ts +62 -0
- package/src/store/ToolGroupManager/ToolGroup.ts +9 -2
- package/src/tools/ScaleOverlayTool.ts +4 -1
- package/src/tools/SegmentationIntersectionTool.ts +1 -1
- package/src/tools/annotation/LivewireContourSegmentationTool.ts +1 -1
- package/src/tools/annotation/LivewireContourTool.ts +65 -38
- package/src/tools/annotation/PlanarFreehandContourSegmentationTool.ts +1 -22
- package/src/tools/annotation/PlanarFreehandROITool.ts +8 -5
- package/src/tools/annotation/ProbeTool.ts +4 -0
- package/src/tools/annotation/SplineROITool.ts +76 -29
- package/src/tools/annotation/planarFreehandROITool/closedContourEditLoop.ts +20 -11
- package/src/tools/annotation/planarFreehandROITool/drawLoop.ts +42 -23
- package/src/tools/annotation/planarFreehandROITool/openContourEditLoop.ts +28 -13
- package/src/tools/annotation/planarFreehandROITool/openContourEndEditLoop.ts +1 -1
- package/src/tools/annotation/planarFreehandROITool/renderMethods.ts +28 -10
- package/src/tools/annotation/splines/LinearSpline.ts +1 -1
- package/src/tools/annotation/splines/Spline.ts +13 -1
- package/src/tools/base/AnnotationTool.ts +2 -1
- package/src/tools/base/BaseTool.ts +1 -6
- package/src/tools/base/ContourBaseTool.ts +46 -4
- package/src/tools/base/ContourSegmentationBaseTool.ts +51 -42
- package/src/tools/displayTools/Contour/contourConfig.ts +1 -0
- package/src/tools/displayTools/Contour/contourDisplay.ts +82 -9
- package/src/tools/displayTools/Contour/removeContourFromElement.ts +2 -0
- package/src/tools/displayTools/Contour/{addContourSetsToElement.ts → vtkContour/addContourSetsToElement.ts} +1 -1
- package/src/tools/displayTools/Contour/{addOrUpdateContourSets.ts → vtkContour/addOrUpdateVTKContourSets.ts} +4 -4
- package/src/tools/displayTools/Contour/{updateContourSets.ts → vtkContour/updateVTKContourSets.ts} +2 -2
- package/src/tools/displayTools/Contour/{utils.ts → vtkContour/utils.ts} +1 -1
- package/src/tools/displayTools/Labelmap/addLabelmapToElement.ts +1 -1
- package/src/tools/displayTools/Labelmap/index.ts +10 -1
- package/src/tools/displayTools/Labelmap/labelmapDisplay.ts +39 -4
- package/src/tools/displayTools/Labelmap/validateLabelmap.ts +71 -0
- package/src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts +172 -0
- package/src/tools/displayTools/Surface/surfaceConfig.ts +12 -0
- package/src/tools/displayTools/Surface/surfaceDisplay.ts +275 -35
- package/src/tools/displayTools/registerDisplayToolsWorker.ts +34 -0
- package/src/tools/segmentation/BrushTool.ts +1 -1
- package/src/tools/segmentation/CircleScissorsTool.ts +3 -1
- package/src/tools/segmentation/PaintFillTool.ts +1 -1
- package/src/tools/segmentation/RectangleScissorsTool.ts +3 -1
- package/src/tools/segmentation/SegmentSelectTool.ts +70 -75
- package/src/tools/segmentation/SphereScissorsTool.ts +3 -1
- package/src/tools/segmentation/strategies/BrushStrategy.ts +12 -9
- package/src/tools/segmentation/strategies/compositions/regionFill.ts +1 -1
- package/src/tools/segmentation/strategies/fillSphere.ts +13 -5
- package/src/tools/segmentation/strategies/utils/getStrategyData.ts +30 -15
- package/src/tools/segmentation/strategies/utils/stackVolumeCheck.ts +24 -17
- package/src/types/AnnotationTypes.ts +14 -0
- package/src/types/ContourAnnotation.ts +13 -0
- package/src/types/ContourSegmentationAnnotation.ts +0 -1
- package/src/types/ContourTypes.ts +3 -0
- package/src/types/EventTypes.ts +9 -0
- package/src/types/ISpline.ts +3 -0
- package/src/types/LabelmapTypes.ts +7 -1
- package/src/types/PolySeg.ts +7 -0
- package/src/types/SegmentationStateTypes.ts +20 -4
- package/src/types/SplineProps.ts +10 -0
- package/src/types/SurfaceTypes.ts +1 -1
- package/src/types/index.ts +3 -0
- package/src/utilities/boundingBox/getBoundingBoxAroundShape.ts +4 -2
- package/src/utilities/contourSegmentation/addContourSegmentationAnnotation.ts +29 -0
- package/src/utilities/contourSegmentation/areSameSegment.ts +0 -2
- package/src/utilities/contourSegmentation/index.ts +2 -0
- package/src/utilities/contourSegmentation/removeContourSegmentationAnnotation.ts +30 -0
- package/src/utilities/contours/detectContourHoles.ts +2 -0
- package/src/utilities/contours/generateContourSetsFromLabelmap.ts +2 -2
- package/src/utilities/contours/getContourHolesDataCanvas.ts +33 -0
- package/src/utilities/contours/getContourHolesDataWorld.ts +19 -0
- package/src/utilities/contours/getDeduplicatedVTKPolyDataPoints.ts +66 -0
- package/src/utilities/contours/index.ts +8 -2
- package/src/utilities/contours/updateContourPolyline.ts +74 -0
- package/src/utilities/index.ts +4 -0
- package/src/utilities/math/polyline/containsPoint.ts +4 -2
- package/src/utilities/math/polyline/containsPoints.ts +22 -0
- package/src/utilities/math/polyline/getWindingDirection.ts +14 -0
- package/src/utilities/math/polyline/index.ts +6 -0
- package/src/utilities/math/polyline/isPointInsidePolyline3D.ts +56 -0
- package/src/utilities/math/polyline/planarFreehandROIInternalTypes.ts +1 -0
- package/src/utilities/segmentation/contourAndFindLargestBidirectional.ts +0 -1
- package/src/utilities/segmentation/getHoveredContourSegmentationAnnotation.ts +25 -0
- package/src/utilities/segmentation/getSegmentAtLabelmapBorder.ts +179 -0
- package/src/utilities/segmentation/getSegmentAtWorldPoint.ts +173 -0
- package/src/utilities/segmentation/getUniqueSegmentIndices.ts +76 -0
- package/src/utilities/segmentation/index.ts +8 -0
- package/src/utilities/triggerAnnotationRenderForToolGroupIds.ts +38 -0
- package/src/workers/clippingPlaneWorker.js +87 -0
- package/src/workers/polySegConverters.js +467 -0
- package/dist/cjs/tools/displayTools/Contour/addContourSetsToElement.js.map +0 -1
- package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.d.ts +0 -3
- package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.js +0 -14
- package/dist/cjs/tools/displayTools/Contour/addOrUpdateContourSets.js.map +0 -1
- package/dist/cjs/tools/displayTools/Contour/contourConfigCache.js.map +0 -1
- package/dist/cjs/tools/displayTools/Contour/updateContourSets.d.ts +0 -3
- package/dist/cjs/tools/displayTools/Contour/updateContourSets.js.map +0 -1
- package/dist/cjs/tools/displayTools/Contour/utils.js.map +0 -1
- package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.d.ts +0 -3
- package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.js +0 -20
- package/dist/cjs/tools/displayTools/Labelmap/validateRepresentationData.js.map +0 -1
- package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.d.ts +0 -2
- package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js +0 -84
- package/dist/cjs/tools/displayTools/Surface/addSurfaceToElement.js.map +0 -1
- package/dist/cjs/utilities/contours/mergePoints.d.ts +0 -8
- package/dist/cjs/utilities/contours/mergePoints.js +0 -77
- package/dist/cjs/utilities/contours/mergePoints.js.map +0 -1
- package/dist/esm/tools/displayTools/Contour/addContourSetsToElement.js.map +0 -1
- package/dist/esm/tools/displayTools/Contour/addOrUpdateContourSets.js.map +0 -1
- package/dist/esm/tools/displayTools/Contour/contourConfigCache.js.map +0 -1
- package/dist/esm/tools/displayTools/Contour/updateContourSets.js.map +0 -1
- package/dist/esm/tools/displayTools/Contour/utils.js.map +0 -1
- package/dist/esm/tools/displayTools/Labelmap/validateRepresentationData.js +0 -18
- package/dist/esm/tools/displayTools/Labelmap/validateRepresentationData.js.map +0 -1
- package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js +0 -79
- package/dist/esm/tools/displayTools/Surface/addSurfaceToElement.js.map +0 -1
- package/dist/esm/utilities/contours/mergePoints.js +0 -73
- package/dist/esm/utilities/contours/mergePoints.js.map +0 -1
- package/dist/types/tools/displayTools/Contour/addContourSetsToElement.d.ts.map +0 -1
- package/dist/types/tools/displayTools/Contour/addOrUpdateContourSets.d.ts +0 -4
- package/dist/types/tools/displayTools/Contour/addOrUpdateContourSets.d.ts.map +0 -1
- package/dist/types/tools/displayTools/Contour/contourConfigCache.d.ts.map +0 -1
- package/dist/types/tools/displayTools/Contour/updateContourSets.d.ts +0 -4
- package/dist/types/tools/displayTools/Contour/updateContourSets.d.ts.map +0 -1
- package/dist/types/tools/displayTools/Contour/utils.d.ts.map +0 -1
- package/dist/types/tools/displayTools/Labelmap/validateRepresentationData.d.ts +0 -4
- package/dist/types/tools/displayTools/Labelmap/validateRepresentationData.d.ts.map +0 -1
- package/dist/types/tools/displayTools/Surface/addSurfaceToElement.d.ts +0 -3
- package/dist/types/tools/displayTools/Surface/addSurfaceToElement.d.ts.map +0 -1
- package/dist/types/utilities/contours/mergePoints.d.ts +0 -9
- package/dist/types/utilities/contours/mergePoints.d.ts.map +0 -1
- package/src/tools/displayTools/Labelmap/validateRepresentationData.ts +0 -36
- package/src/tools/displayTools/Surface/addSurfaceToElement.ts +0 -115
- package/src/utilities/contours/mergePoints.ts +0 -108
- /package/dist/cjs/tools/displayTools/Contour/{addContourSetsToElement.js → vtkContour/addContourSetsToElement.js} +0 -0
- /package/dist/cjs/tools/displayTools/Contour/{contourConfigCache.d.ts → vtkContour/contourConfigCache.d.ts} +0 -0
- /package/dist/cjs/tools/displayTools/Contour/{contourConfigCache.js → vtkContour/contourConfigCache.js} +0 -0
- /package/dist/cjs/tools/displayTools/Contour/{utils.js → vtkContour/utils.js} +0 -0
- /package/dist/esm/tools/displayTools/Contour/{addContourSetsToElement.js → vtkContour/addContourSetsToElement.js} +0 -0
- /package/dist/esm/tools/displayTools/Contour/{contourConfigCache.js → vtkContour/contourConfigCache.js} +0 -0
- /package/dist/esm/tools/displayTools/Contour/{utils.js → vtkContour/utils.js} +0 -0
- /package/dist/types/tools/displayTools/Contour/{contourConfigCache.d.ts → vtkContour/contourConfigCache.d.ts} +0 -0
- /package/src/tools/displayTools/Contour/{contourConfigCache.ts → vtkContour/contourConfigCache.ts} +0 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUniqueSegmentIndices = void 0;
|
|
4
|
+
const core_1 = require("@cornerstonejs/core");
|
|
5
|
+
const enums_1 = require("../../enums");
|
|
6
|
+
const segmentationState_1 = require("../../stateManagement/segmentation/segmentationState");
|
|
7
|
+
const stackVolumeCheck_1 = require("../../tools/segmentation/strategies/utils/stackVolumeCheck");
|
|
8
|
+
function getUniqueSegmentIndices(segmentationId) {
|
|
9
|
+
var _a, _b, _c, _d;
|
|
10
|
+
const segmentation = (0, segmentationState_1.getSegmentation)(segmentationId);
|
|
11
|
+
if (segmentation.type === enums_1.SegmentationRepresentations.Labelmap) {
|
|
12
|
+
const labelmapData = segmentation.representationData[enums_1.SegmentationRepresentations.Labelmap];
|
|
13
|
+
const keySet = new Set();
|
|
14
|
+
if ((0, stackVolumeCheck_1.isVolumeSegmentation)(labelmapData)) {
|
|
15
|
+
const volume = core_1.cache.getVolume(segmentationId);
|
|
16
|
+
const scalarData = volume.getScalarData();
|
|
17
|
+
for (let i = 0; i < scalarData.length; i++) {
|
|
18
|
+
const segmentIndex = scalarData[i];
|
|
19
|
+
if (segmentIndex !== 0) {
|
|
20
|
+
keySet.add(segmentIndex);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
labelmapData.imageIdReferenceMap.forEach((segmentationImageId) => {
|
|
26
|
+
const image = core_1.cache.getImage(segmentationImageId);
|
|
27
|
+
const scalarData = image.getPixelData();
|
|
28
|
+
for (let i = 0; i < scalarData.length; i++) {
|
|
29
|
+
const segmentIndex = scalarData[i];
|
|
30
|
+
if (segmentIndex !== 0) {
|
|
31
|
+
keySet.add(segmentIndex);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return Array.from(keySet)
|
|
37
|
+
.map((it) => parseInt(it))
|
|
38
|
+
.sort();
|
|
39
|
+
}
|
|
40
|
+
else if (segmentation.type === enums_1.SegmentationRepresentations.Contour) {
|
|
41
|
+
const annotationUIDsMap = (_a = segmentation.representationData.CONTOUR) === null || _a === void 0 ? void 0 : _a.annotationUIDsMap;
|
|
42
|
+
const indices = new Set(annotationUIDsMap.keys());
|
|
43
|
+
const geometryIds = (_b = segmentation.representationData.CONTOUR) === null || _b === void 0 ? void 0 : _b.geometryIds;
|
|
44
|
+
if (!geometryIds) {
|
|
45
|
+
throw new Error(`No geometryIds found for segmentationId ${segmentationId}`);
|
|
46
|
+
}
|
|
47
|
+
geometryIds.forEach((geometryId) => {
|
|
48
|
+
const geometry = core_1.cache.getGeometry(geometryId);
|
|
49
|
+
indices.add(geometry.data.getSegmentIndex());
|
|
50
|
+
});
|
|
51
|
+
return Array.from(indices.values()).sort();
|
|
52
|
+
}
|
|
53
|
+
else if (segmentation.type === enums_1.SegmentationRepresentations.Surface) {
|
|
54
|
+
const geometryIds = (_d = (_c = segmentation.representationData.SURFACE) === null || _c === void 0 ? void 0 : _c.geometryIds) !== null && _d !== void 0 ? _d : [];
|
|
55
|
+
return Array.from(geometryIds.keys());
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.getUniqueSegmentIndices = getUniqueSegmentIndices;
|
|
59
|
+
//# sourceMappingURL=getUniqueSegmentIndices.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUniqueSegmentIndices.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/getUniqueSegmentIndices.ts"],"names":[],"mappings":";;;AAAA,8CAAmD;AACnD,uCAA0D;AAC1D,4FAAuF;AACvF,iGAAkG;AASlG,SAAS,uBAAuB,CAAC,cAAc;;IAC7C,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC,cAAc,CAAC,CAAC;IAErD,IAAI,YAAY,CAAC,IAAI,KAAK,mCAA2B,CAAC,QAAQ,EAAE;QAC9D,MAAM,YAAY,GAChB,YAAY,CAAC,kBAAkB,CAAC,mCAA2B,CAA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,MAAA,YAAY,CAAC,kBAAkB,CAAC,OAAO,0CAAE,iBAAiB,CAAC;QAE7D,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,MAAA,YAAY,CAAC,kBAAkB,CAAC,OAAO,0CAAE,WAAW,CAAC;QAEzE,IAAI,CAAC,WAAW,EAAE;YAChB,MAAM,IAAI,KAAK,CACb,2CAA2C,cAAc,EAAE,CAC5D,CAAC;SACH;QAED,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE;YACjC,MAAM,QAAQ,GAAG,YAAK,CAAC,WAAW,CAAC,UAAU,CAAoB,CAAC;YAClE,OAAO,CAAC,GAAG,CAAE,QAAQ,CAAC,IAA0B,CAAC,eAAe,EAAE,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;KAC5C;SAAM,IAAI,YAAY,CAAC,IAAI,KAAK,mCAA2B,CAAC,OAAO,EAAE;QACpE,MAAM,WAAW,GACf,MAAA,MAAA,YAAY,CAAC,kBAAkB,CAAC,OAAO,0CAAE,WAAW,mCAAI,EAAE,CAAC;QAE7D,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;KACvC;AACH,CAAC;AAEQ,0DAAuB"}
|
|
@@ -14,4 +14,8 @@ import contourAndFindLargestBidirectional from './contourAndFindLargestBidirecti
|
|
|
14
14
|
import createBidirectionalToolData from './createBidirectionalToolData';
|
|
15
15
|
import segmentContourAction from './segmentContourAction';
|
|
16
16
|
import { invalidateBrushCursor } from './invalidateBrushCursor';
|
|
17
|
-
|
|
17
|
+
import { getUniqueSegmentIndices } from './getUniqueSegmentIndices';
|
|
18
|
+
import { getSegmentAtWorldPoint } from './getSegmentAtWorldPoint';
|
|
19
|
+
import { getSegmentAtLabelmapBorder } from './getSegmentAtLabelmapBorder';
|
|
20
|
+
import { getHoveredContourSegmentationAnnotation } from './getHoveredContourSegmentationAnnotation';
|
|
21
|
+
export { thresholdVolumeByRange, createMergedLabelmapForIndex, isValidRepresentationConfig, getDefaultRepresentationConfig, createLabelmapVolumeForViewport, rectangleROIThresholdVolumeByRange, triggerSegmentationRender, floodFill, getBrushSizeForToolGroup, setBrushSizeForToolGroup, getBrushThresholdForToolGroup, setBrushThresholdForToolGroup, thresholdSegmentationByRange, createImageIdReferenceMap, contourAndFindLargestBidirectional, createBidirectionalToolData, segmentContourAction, invalidateBrushCursor, getUniqueSegmentIndices, getSegmentAtWorldPoint, getSegmentAtLabelmapBorder, getHoveredContourSegmentationAnnotation, };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.invalidateBrushCursor = exports.segmentContourAction = exports.createBidirectionalToolData = exports.contourAndFindLargestBidirectional = exports.createImageIdReferenceMap = exports.thresholdSegmentationByRange = exports.setBrushThresholdForToolGroup = exports.getBrushThresholdForToolGroup = exports.setBrushSizeForToolGroup = exports.getBrushSizeForToolGroup = exports.floodFill = exports.triggerSegmentationRender = exports.rectangleROIThresholdVolumeByRange = exports.createLabelmapVolumeForViewport = exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = void 0;
|
|
6
|
+
exports.getHoveredContourSegmentationAnnotation = exports.getSegmentAtLabelmapBorder = exports.getSegmentAtWorldPoint = exports.getUniqueSegmentIndices = exports.invalidateBrushCursor = exports.segmentContourAction = exports.createBidirectionalToolData = exports.contourAndFindLargestBidirectional = exports.createImageIdReferenceMap = exports.thresholdSegmentationByRange = exports.setBrushThresholdForToolGroup = exports.getBrushThresholdForToolGroup = exports.setBrushSizeForToolGroup = exports.getBrushSizeForToolGroup = exports.floodFill = exports.triggerSegmentationRender = exports.rectangleROIThresholdVolumeByRange = exports.createLabelmapVolumeForViewport = exports.getDefaultRepresentationConfig = exports.isValidRepresentationConfig = exports.createMergedLabelmapForIndex = exports.thresholdVolumeByRange = void 0;
|
|
7
7
|
const thresholdVolumeByRange_1 = __importDefault(require("./thresholdVolumeByRange"));
|
|
8
8
|
exports.thresholdVolumeByRange = thresholdVolumeByRange_1.default;
|
|
9
9
|
const rectangleROIThresholdVolumeByRange_1 = __importDefault(require("./rectangleROIThresholdVolumeByRange"));
|
|
@@ -38,4 +38,12 @@ const segmentContourAction_1 = __importDefault(require("./segmentContourAction")
|
|
|
38
38
|
exports.segmentContourAction = segmentContourAction_1.default;
|
|
39
39
|
const invalidateBrushCursor_1 = require("./invalidateBrushCursor");
|
|
40
40
|
Object.defineProperty(exports, "invalidateBrushCursor", { enumerable: true, get: function () { return invalidateBrushCursor_1.invalidateBrushCursor; } });
|
|
41
|
+
const getUniqueSegmentIndices_1 = require("./getUniqueSegmentIndices");
|
|
42
|
+
Object.defineProperty(exports, "getUniqueSegmentIndices", { enumerable: true, get: function () { return getUniqueSegmentIndices_1.getUniqueSegmentIndices; } });
|
|
43
|
+
const getSegmentAtWorldPoint_1 = require("./getSegmentAtWorldPoint");
|
|
44
|
+
Object.defineProperty(exports, "getSegmentAtWorldPoint", { enumerable: true, get: function () { return getSegmentAtWorldPoint_1.getSegmentAtWorldPoint; } });
|
|
45
|
+
const getSegmentAtLabelmapBorder_1 = require("./getSegmentAtLabelmapBorder");
|
|
46
|
+
Object.defineProperty(exports, "getSegmentAtLabelmapBorder", { enumerable: true, get: function () { return getSegmentAtLabelmapBorder_1.getSegmentAtLabelmapBorder; } });
|
|
47
|
+
const getHoveredContourSegmentationAnnotation_1 = require("./getHoveredContourSegmentationAnnotation");
|
|
48
|
+
Object.defineProperty(exports, "getHoveredContourSegmentationAnnotation", { enumerable: true, get: function () { return getHoveredContourSegmentationAnnotation_1.getHoveredContourSegmentationAnnotation; } });
|
|
41
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA8D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/segmentation/index.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA8D;AA4B5D,iCA5BK,gCAAsB,CA4BL;AA3BxB,8GAAsF;AAgCpF,6CAhCK,4CAAkC,CAgCL;AA/BpC,kGAA0E;AA2BxE,uCA3BK,sCAA4B,CA2BL;AA1B9B,gGAAwE;AA2BtE,sCA3BK,qCAA2B,CA2BL;AA1B7B,sGAA8E;AA2B5E,yCA3BK,wCAA8B,CA2BL;AA1BhC,wGAAgF;AA2B9E,0CA3BK,yCAA+B,CA2BL;AA1BjC,2EAAwE;AA4BtE,0GA5BO,qDAAyB,OA4BP;AA3B3B,4DAAoC;AA4BlC,oBA5BK,mBAAS,CA4BL;AA3BX,mEAGiC;AAyB/B,yGA3BA,gDAAwB,OA2BA;AACxB,yGA3BA,gDAAwB,OA2BA;AAzB1B,6EAGsC;AAuBpC,8GAzBA,0DAA6B,OAyBA;AAC7B,8GAzBA,0DAA6B,OAyBA;AAvB/B,kGAA0E;AAwBxE,uCAxBK,sCAA4B,CAwBL;AAvB9B,2EAAwE;AAwBtE,0GAxBO,qDAAyB,OAwBP;AAvB3B,8GAAsF;AAwBpF,6CAxBK,4CAAkC,CAwBL;AAvBpC,gGAAwE;AAwBtE,sCAxBK,qCAA2B,CAwBL;AAvB7B,kFAA0D;AAwBxD,+BAxBK,8BAAoB,CAwBL;AAvBtB,mEAAgE;AAwB9D,sGAxBO,6CAAqB,OAwBP;AAvBvB,uEAAoE;AAwBlE,wGAxBO,iDAAuB,OAwBP;AAvBzB,qEAAkE;AAwBhE,uGAxBO,+CAAsB,OAwBP;AAvBxB,6EAA0E;AAwBxE,2GAxBO,uDAA0B,OAwBP;AAvB5B,uGAAoG;AAwBlG,wHAxBO,iFAAuC,OAwBP"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.triggerAnnotationRenderForToolGroupIds = void 0;
|
|
7
|
+
const core_1 = require("@cornerstonejs/core");
|
|
8
|
+
const triggerAnnotationRender_1 = __importDefault(require("./triggerAnnotationRender"));
|
|
9
|
+
const ToolGroupManager_1 = require("../store/ToolGroupManager");
|
|
10
|
+
function triggerAnnotationRenderForToolGroupIds(toolGroupIds) {
|
|
11
|
+
toolGroupIds.forEach((toolGroupId) => {
|
|
12
|
+
const toolGroup = (0, ToolGroupManager_1.getToolGroup)(toolGroupId);
|
|
13
|
+
if (!toolGroup) {
|
|
14
|
+
console.warn(`ToolGroup not available for ${toolGroupId}`);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const viewportsInfo = toolGroup.getViewportsInfo();
|
|
18
|
+
viewportsInfo.forEach((viewportInfo) => {
|
|
19
|
+
const { renderingEngineId, viewportId } = viewportInfo;
|
|
20
|
+
const renderingEngine = (0, core_1.getRenderingEngine)(renderingEngineId);
|
|
21
|
+
if (!renderingEngine) {
|
|
22
|
+
console.warn(`RenderingEngine not available for ${renderingEngineId}`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const viewport = renderingEngine.getViewport(viewportId);
|
|
26
|
+
(0, triggerAnnotationRender_1.default)(viewport.element);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.triggerAnnotationRenderForToolGroupIds = triggerAnnotationRenderForToolGroupIds;
|
|
31
|
+
exports.default = triggerAnnotationRenderForToolGroupIds;
|
|
32
|
+
//# sourceMappingURL=triggerAnnotationRenderForToolGroupIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triggerAnnotationRenderForToolGroupIds.js","sourceRoot":"","sources":["../../../src/utilities/triggerAnnotationRenderForToolGroupIds.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqE;AACrE,wFAAgE;AAChE,gEAAyD;AAOzD,SAAgB,sCAAsC,CACpD,YAAsB;IAEtB,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,IAAA,+BAAY,EAAC,WAAW,CAAC,CAAC;QAE5C,IAAI,CAAC,SAAS,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,+BAA+B,WAAW,EAAE,CAAC,CAAC;YAC3D,OAAO;SACR;QAED,MAAM,aAAa,GAAG,SAAS,CAAC,gBAAgB,EAAE,CAAC;QAEnD,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YACrC,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC;YAEvD,MAAM,eAAe,GAAG,IAAA,yBAAkB,EAAC,iBAAiB,CAAC,CAAC;YAC9D,IAAI,CAAC,eAAe,EAAE;gBACpB,OAAO,CAAC,IAAI,CAAC,qCAAqC,iBAAiB,EAAE,CAAC,CAAC;gBACvE,OAAO;aACR;YAED,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YACzD,IAAA,iCAAuB,EAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AA1BD,wFA0BC;AAED,kBAAe,sCAAsC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const comlink_1 = require("comlink");
|
|
7
|
+
const Plane_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/Plane"));
|
|
8
|
+
const ClipClosedSurface_1 = __importDefault(require("@kitware/vtk.js/Filters/General/ClipClosedSurface"));
|
|
9
|
+
const PolyData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/PolyData"));
|
|
10
|
+
const obj = {
|
|
11
|
+
clipSurfaceWithPlanes({ planesInfo, pointsAndPolys }, progressCallback, updateCacheCallback) {
|
|
12
|
+
const numberOfPlanes = planesInfo.length;
|
|
13
|
+
const clippingFilter = ClipClosedSurface_1.default.newInstance({
|
|
14
|
+
clippingPlanes: [],
|
|
15
|
+
activePlaneId: 2,
|
|
16
|
+
passPointData: false,
|
|
17
|
+
});
|
|
18
|
+
clippingFilter.setGenerateOutline(true);
|
|
19
|
+
clippingFilter.setGenerateFaces(false);
|
|
20
|
+
const plane1 = Plane_1.default.newInstance();
|
|
21
|
+
const plane2 = Plane_1.default.newInstance();
|
|
22
|
+
try {
|
|
23
|
+
for (const [index, planeInfo] of planesInfo.entries()) {
|
|
24
|
+
const { sliceIndex, planes } = planeInfo;
|
|
25
|
+
const polyDataResults = new Map();
|
|
26
|
+
for (const polyDataInfo of pointsAndPolys) {
|
|
27
|
+
const { points, polys, id } = polyDataInfo;
|
|
28
|
+
const surfacePolyData = PolyData_1.default.newInstance();
|
|
29
|
+
surfacePolyData.getPoints().setData(points, 3);
|
|
30
|
+
surfacePolyData.getPolys().setData(polys, 3);
|
|
31
|
+
clippingFilter.setInputData(surfacePolyData);
|
|
32
|
+
const clippingPlanes = [plane1, plane2];
|
|
33
|
+
plane1.setOrigin(planes[0].origin);
|
|
34
|
+
plane1.setNormal(planes[0].normal);
|
|
35
|
+
plane2.setOrigin(planes[1].origin);
|
|
36
|
+
plane2.setNormal(planes[1].normal);
|
|
37
|
+
clippingFilter.setClippingPlanes(clippingPlanes);
|
|
38
|
+
clippingFilter.update();
|
|
39
|
+
const polyData = clippingFilter.getOutputData();
|
|
40
|
+
if (polyData) {
|
|
41
|
+
polyDataResults.set(id, {
|
|
42
|
+
points: polyData.getPoints().getData(),
|
|
43
|
+
lines: polyData.getLines().getData(),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
progressCallback({ progress: (index + 1) / numberOfPlanes });
|
|
48
|
+
updateCacheCallback({ sliceIndex, polyDataResults });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (e) {
|
|
52
|
+
console.error('Error during processing', e);
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
pointsAndPolys = null;
|
|
56
|
+
clippingFilter.delete();
|
|
57
|
+
plane1.delete();
|
|
58
|
+
plane2.delete();
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
(0, comlink_1.expose)(obj);
|
|
63
|
+
//# sourceMappingURL=clippingPlaneWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clippingPlaneWorker.js","sourceRoot":"","sources":["../../../src/workers/clippingPlaneWorker.js"],"names":[],"mappings":";;;;;AAAA,qCAAiC;AACjC,mFAA8D;AAC9D,0GAAqF;AACrF,yFAAoE;AAEpE,MAAM,GAAG,GAAG;IAYV,qBAAqB,CACnB,EAAE,UAAU,EAAE,cAAc,EAAE,EAC9B,gBAAgB,EAChB,mBAAmB;QAEnB,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;QACzC,MAAM,cAAc,GAAG,2BAAoB,CAAC,WAAW,CAAC;YACtD,cAAc,EAAE,EAAE;YAClB,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,KAAK;SACrB,CAAC,CAAC;QACH,cAAc,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACxC,cAAc,CAAC,gBAAgB,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c,CAAC,aAAa,EAAE,CAAC;oBAEhD,IAAI,QAAQ,EAAE;wBACZ,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE;4BACtB,MAAM,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE;4BACtC,KAAK,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE;yBACrC,CAAC,CAAC;qBACJ;iBACF;gBAED,gBAAgB,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC,CAAC;gBAE7D,mBAAmB,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;aACtD;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC,CAAC,CAAC;SAC7C;gBAAS;YAER,cAAc,GAAG,IAAI,CAAC;YACtB,cAAc,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,CAAC,MAAM,EAAE,CAAC;SACjB;IACH,CAAC;CACF,CAAC;AAEF,IAAA,gBAAM,EAAC,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const comlink_1 = require("comlink");
|
|
16
|
+
const ImageData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/ImageData"));
|
|
17
|
+
const DataArray_1 = __importDefault(require("@kitware/vtk.js/Common/Core/DataArray"));
|
|
18
|
+
const polyseg_wasm_1 = __importDefault(require("@icr/polyseg-wasm"));
|
|
19
|
+
const core_1 = require("@cornerstonejs/core");
|
|
20
|
+
const boundingBox_1 = require("../utilities/boundingBox");
|
|
21
|
+
const utilities_1 = require("../utilities");
|
|
22
|
+
const polyline_1 = require("../utilities/math/polyline");
|
|
23
|
+
const polySegConverters = {
|
|
24
|
+
polySeg: null,
|
|
25
|
+
polySegInitializing: false,
|
|
26
|
+
polySegInitializingPromise: null,
|
|
27
|
+
initializePolySeg(progressCallback) {
|
|
28
|
+
var _a;
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
if (this.polySegInitializing) {
|
|
31
|
+
yield this.polySegInitializingPromise;
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if ((_a = this.polySeg) === null || _a === void 0 ? void 0 : _a.instance) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.polySegInitializing = true;
|
|
38
|
+
this.polySegInitializingPromise = new Promise((resolve) => {
|
|
39
|
+
this.polySeg = new polyseg_wasm_1.default();
|
|
40
|
+
this.polySeg
|
|
41
|
+
.initialize({
|
|
42
|
+
updateProgress: progressCallback,
|
|
43
|
+
})
|
|
44
|
+
.then(() => {
|
|
45
|
+
this.polySegInitializing = false;
|
|
46
|
+
resolve();
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
yield this.polySegInitializingPromise;
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
convertContourToSurface(args, ...callbacks) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const { polylines, numPointsArray } = args;
|
|
55
|
+
const [progressCallback] = callbacks;
|
|
56
|
+
yield this.initializePolySeg(progressCallback);
|
|
57
|
+
const results = yield this.polySeg.instance.convertContourRoiToSurface(polylines, numPointsArray);
|
|
58
|
+
return results;
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
convertLabelmapToSurface(args, ...callbacks) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const [progressCallback] = callbacks;
|
|
64
|
+
yield this.initializePolySeg(progressCallback);
|
|
65
|
+
const results = this.polySeg.instance.convertLabelmapToSurface(args.scalarData, args.dimensions, args.spacing, args.direction, args.origin, [args.segmentIndex]);
|
|
66
|
+
return results;
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
convertContourToVolumeLabelmap(args, ...callbacks) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const [progressCallback] = callbacks;
|
|
72
|
+
const polySeg = yield new polyseg_wasm_1.default();
|
|
73
|
+
yield polySeg.initialize({
|
|
74
|
+
updateProgress: progressCallback,
|
|
75
|
+
});
|
|
76
|
+
const { segmentIndices, scalarData, annotationUIDsInSegmentMap, dimensions, origin, direction, spacing, } = args;
|
|
77
|
+
const segmentationVoxelManager = core_1.utilities.VoxelManager.createVolumeVoxelManager(dimensions, scalarData);
|
|
78
|
+
const imageData = ImageData_1.default.newInstance();
|
|
79
|
+
imageData.setDimensions(dimensions);
|
|
80
|
+
imageData.setOrigin(origin);
|
|
81
|
+
imageData.setDirection(direction);
|
|
82
|
+
imageData.setSpacing(spacing);
|
|
83
|
+
const scalarArray = DataArray_1.default.newInstance({
|
|
84
|
+
name: 'Pixels',
|
|
85
|
+
numberOfComponents: 1,
|
|
86
|
+
values: scalarData,
|
|
87
|
+
});
|
|
88
|
+
imageData.getPointData().setScalars(scalarArray);
|
|
89
|
+
imageData.modified();
|
|
90
|
+
for (const index of segmentIndices) {
|
|
91
|
+
const annotations = annotationUIDsInSegmentMap.get(index);
|
|
92
|
+
for (const annotation of annotations) {
|
|
93
|
+
const bounds = (0, boundingBox_1.getBoundingBoxAroundShapeWorld)(annotation.data.contour.polyline);
|
|
94
|
+
const [iMin, jMin, kMin] = core_1.utilities.transformWorldToIndex(imageData, [
|
|
95
|
+
bounds[0][0],
|
|
96
|
+
bounds[1][0],
|
|
97
|
+
bounds[2][0],
|
|
98
|
+
]);
|
|
99
|
+
const [iMax, jMax, kMax] = core_1.utilities.transformWorldToIndex(imageData, [
|
|
100
|
+
bounds[0][1],
|
|
101
|
+
bounds[1][1],
|
|
102
|
+
bounds[2][1],
|
|
103
|
+
]);
|
|
104
|
+
(0, utilities_1.pointInShapeCallback)(imageData, (pointLPS) => {
|
|
105
|
+
return (0, polyline_1.isPointInsidePolyline3D)(pointLPS, annotation.data.contour.polyline);
|
|
106
|
+
}, ({ pointIJK }) => {
|
|
107
|
+
segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
|
|
108
|
+
}, [
|
|
109
|
+
[iMin, iMax],
|
|
110
|
+
[jMin, jMax],
|
|
111
|
+
[kMin, kMax],
|
|
112
|
+
]);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return segmentationVoxelManager.scalarData;
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
convertContourToStackLabelmap(args, ...callbacks) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const [progressCallback] = callbacks;
|
|
121
|
+
const polySeg = yield new polyseg_wasm_1.default();
|
|
122
|
+
yield polySeg.initialize({
|
|
123
|
+
updateProgress: progressCallback,
|
|
124
|
+
});
|
|
125
|
+
const { segmentationsInfo, annotationUIDsInSegmentMap, segmentIndices } = args;
|
|
126
|
+
const segmentationVoxelManagers = new Map();
|
|
127
|
+
segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
|
|
128
|
+
const { dimensions, scalarData, direction, spacing, origin } = segmentationInfo;
|
|
129
|
+
const manager = core_1.utilities.VoxelManager.createVolumeVoxelManager(dimensions, scalarData);
|
|
130
|
+
const imageData = ImageData_1.default.newInstance();
|
|
131
|
+
imageData.setDimensions(dimensions);
|
|
132
|
+
imageData.setOrigin(origin);
|
|
133
|
+
imageData.setDirection(direction);
|
|
134
|
+
imageData.setSpacing(spacing);
|
|
135
|
+
const scalarArray = DataArray_1.default.newInstance({
|
|
136
|
+
name: 'Pixels',
|
|
137
|
+
numberOfComponents: 1,
|
|
138
|
+
values: scalarData,
|
|
139
|
+
});
|
|
140
|
+
imageData.getPointData().setScalars(scalarArray);
|
|
141
|
+
imageData.modified();
|
|
142
|
+
segmentationVoxelManagers.set(referencedImageId, { manager, imageData });
|
|
143
|
+
});
|
|
144
|
+
for (const index of segmentIndices) {
|
|
145
|
+
const annotations = annotationUIDsInSegmentMap.get(index);
|
|
146
|
+
for (const annotation of annotations) {
|
|
147
|
+
if (!(annotation === null || annotation === void 0 ? void 0 : annotation.data)) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const bounds = (0, boundingBox_1.getBoundingBoxAroundShapeWorld)(annotation.data.contour.polyline);
|
|
151
|
+
const { referencedImageId } = annotation.metadata;
|
|
152
|
+
const { manager: segmentationVoxelManager, imageData } = segmentationVoxelManagers.get(referencedImageId);
|
|
153
|
+
const [iMin, jMin, kMin] = core_1.utilities.transformWorldToIndex(imageData, [
|
|
154
|
+
bounds[0][0],
|
|
155
|
+
bounds[1][0],
|
|
156
|
+
bounds[2][0],
|
|
157
|
+
]);
|
|
158
|
+
const [iMax, jMax, kMax] = core_1.utilities.transformWorldToIndex(imageData, [
|
|
159
|
+
bounds[0][1],
|
|
160
|
+
bounds[1][1],
|
|
161
|
+
bounds[2][1],
|
|
162
|
+
]);
|
|
163
|
+
(0, utilities_1.pointInShapeCallback)(imageData, (pointLPS) => {
|
|
164
|
+
return (0, polyline_1.isPointInsidePolyline3D)(pointLPS, annotation.data.contour.polyline);
|
|
165
|
+
}, ({ pointIJK }) => {
|
|
166
|
+
segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
|
|
167
|
+
}, [
|
|
168
|
+
[iMin, iMax],
|
|
169
|
+
[jMin, jMax],
|
|
170
|
+
[kMin, kMax],
|
|
171
|
+
]);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
|
|
175
|
+
const { manager: segmentationVoxelManager } = segmentationVoxelManagers.get(referencedImageId);
|
|
176
|
+
segmentationInfo.scalarData = segmentationVoxelManager.scalarData;
|
|
177
|
+
});
|
|
178
|
+
return segmentationsInfo;
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
convertSurfaceToVolumeLabelmap(args, ...callbacks) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
const [progressCallback] = callbacks;
|
|
184
|
+
yield this.initializePolySeg(progressCallback);
|
|
185
|
+
const results = this.polySeg.instance.convertSurfaceToLabelmap(args.points, args.polys, args.dimensions, args.spacing, args.direction, args.origin);
|
|
186
|
+
return results;
|
|
187
|
+
});
|
|
188
|
+
},
|
|
189
|
+
convertSurfacesToVolumeLabelmap(args, ...callbacks) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
const [progressCallback] = callbacks;
|
|
192
|
+
yield this.initializePolySeg(progressCallback);
|
|
193
|
+
const { segmentsInfo } = args;
|
|
194
|
+
const promises = Array.from(segmentsInfo.keys()).map((segmentIndex) => {
|
|
195
|
+
const { points, polys } = segmentsInfo.get(segmentIndex);
|
|
196
|
+
const result = this.polySeg.instance.convertSurfaceToLabelmap(points, polys, args.dimensions, args.spacing, args.direction, args.origin);
|
|
197
|
+
return Object.assign(Object.assign({}, result), { segmentIndex });
|
|
198
|
+
});
|
|
199
|
+
const results = yield Promise.all(promises);
|
|
200
|
+
const targetImageData = ImageData_1.default.newInstance();
|
|
201
|
+
targetImageData.setDimensions(args.dimensions);
|
|
202
|
+
targetImageData.setOrigin(args.origin);
|
|
203
|
+
targetImageData.setSpacing(args.spacing);
|
|
204
|
+
targetImageData.setDirection(args.direction);
|
|
205
|
+
const totalSize = args.dimensions[0] * args.dimensions[1] * args.dimensions[2];
|
|
206
|
+
const scalarArray = DataArray_1.default.newInstance({
|
|
207
|
+
name: 'Pixels',
|
|
208
|
+
numberOfComponents: 1,
|
|
209
|
+
values: new Uint8Array(totalSize),
|
|
210
|
+
});
|
|
211
|
+
targetImageData.getPointData().setScalars(scalarArray);
|
|
212
|
+
targetImageData.modified();
|
|
213
|
+
const segmentationVoxelManager = core_1.utilities.VoxelManager.createVolumeVoxelManager(args.dimensions, targetImageData.getPointData().getScalars().getData());
|
|
214
|
+
const outputVolumesInfo = results.map((result) => {
|
|
215
|
+
const { data, dimensions, direction, origin, spacing } = result;
|
|
216
|
+
const volume = ImageData_1.default.newInstance();
|
|
217
|
+
volume.setDimensions(dimensions);
|
|
218
|
+
volume.setOrigin(origin);
|
|
219
|
+
volume.setSpacing(spacing);
|
|
220
|
+
volume.setDirection(direction);
|
|
221
|
+
const scalarArray = DataArray_1.default.newInstance({
|
|
222
|
+
name: 'Pixels',
|
|
223
|
+
numberOfComponents: 1,
|
|
224
|
+
values: data,
|
|
225
|
+
});
|
|
226
|
+
volume.getPointData().setScalars(scalarArray);
|
|
227
|
+
volume.modified();
|
|
228
|
+
const voxelManager = core_1.utilities.VoxelManager.createVolumeVoxelManager(dimensions, data);
|
|
229
|
+
const extent = volume.getExtent();
|
|
230
|
+
return {
|
|
231
|
+
volume,
|
|
232
|
+
voxelManager,
|
|
233
|
+
extent,
|
|
234
|
+
scalarData: data,
|
|
235
|
+
segmentIndex: result.segmentIndex,
|
|
236
|
+
};
|
|
237
|
+
});
|
|
238
|
+
(0, utilities_1.pointInShapeCallback)(targetImageData, () => true, ({ pointIJK, pointLPS }) => {
|
|
239
|
+
try {
|
|
240
|
+
for (const volumeInfo of outputVolumesInfo) {
|
|
241
|
+
const { volume, extent, voxelManager, segmentIndex } = volumeInfo;
|
|
242
|
+
const index = volume.worldToIndex(pointLPS);
|
|
243
|
+
if (index[0] < extent[0] ||
|
|
244
|
+
index[0] > extent[1] ||
|
|
245
|
+
index[1] < extent[2] ||
|
|
246
|
+
index[1] > extent[3] ||
|
|
247
|
+
index[2] < extent[4] ||
|
|
248
|
+
index[2] > extent[5]) {
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
const roundedIndex = index.map(Math.round);
|
|
252
|
+
const value = voxelManager.getAtIJK(...roundedIndex);
|
|
253
|
+
if (value > 0) {
|
|
254
|
+
segmentationVoxelManager.setAtIJKPoint(pointIJK, segmentIndex);
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
catch (error) {
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
return segmentationVoxelManager.scalarData;
|
|
263
|
+
});
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
(0, comlink_1.expose)(polySegConverters);
|
|
267
|
+
//# sourceMappingURL=polySegConverters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polySegConverters.js","sourceRoot":"","sources":["../../../src/workers/polySegConverters.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,qCAAiC;AACjC,2FAAsE;AACtE,sFAAiE;AACjE,qEAA2C;AAC3C,8CAAgD;AAChD,0DAA0E;AAC1E,4CAAoD;AACpD,yDAAqE;AAYrE,MAAM,iBAAiB,GAAG;IAIxB,OAAO,EAAE,IAAI;IAKb,mBAAmB,EAAE,KAAK;IAC1B,0BAA0B,EAAE,IAAI;IAI1B,iBAAiB,CAAC,gBAAgB;;;YACtC,IAAI,IAAI,CAAC,mBAAmB,EAAE;gBAC5B,MAAM,IAAI,CAAC,0BAA0B,CAAC;gBACtC,OAAO;aACR;YAED,IAAI,MAAA,IAAI,CAAC,OAAO,0CAAE,QAAQ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EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC;wBAElE,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;wBAG5C,IACE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;4BACpB,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EACpB;4BACA,SAAS;yBACV;wBAED,MAAM,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wBAC3C,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC;wBACrD,IAAI,KAAK,GAAG,CAAC,EAAE;4BACb,wBAAwB,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;4BAC/D,MAAM;yBACP;qBACF;iBACF;gBAAC,OAAO,KAAK,EAAE;iBAEf;YACH,CAAC,CACF,CAAC;YAEF,OAAO,wBAAwB,CAAC,UAAU,CAAC;QAC7C,CAAC;KAAA;CACF,CAAC;AAEF,IAAA,gBAAM,EAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _getHash from './_getHash';
|
|
2
|
+
import setNewAttributesIfValid from './setNewAttributesIfValid';
|
|
3
|
+
import setAttributesIfNecessary from './setAttributesIfNecessary';
|
|
4
|
+
export default function drawPath(svgDrawingHelper, annotationUID, pathUID, points, options) {
|
|
5
|
+
const hasSubArrays = points.length && points[0].length && Array.isArray(points[0][0]);
|
|
6
|
+
const pointsArrays = hasSubArrays ? points : [points];
|
|
7
|
+
const { color = 'dodgerblue', width = 10, fillColor = 'none', fillOpacity = 0, lineWidth, lineDash, closePath = false, } = options;
|
|
8
|
+
const strokeWidth = lineWidth || width;
|
|
9
|
+
const svgns = 'http://www.w3.org/2000/svg';
|
|
10
|
+
const svgNodeHash = _getHash(annotationUID, 'path', pathUID);
|
|
11
|
+
const existingNode = svgDrawingHelper.getSvgNode(svgNodeHash);
|
|
12
|
+
let pointsAttribute = '';
|
|
13
|
+
for (let i = 0, numArrays = pointsArrays.length; i < numArrays; i++) {
|
|
14
|
+
const points = pointsArrays[i];
|
|
15
|
+
const numPoints = points.length;
|
|
16
|
+
if (numPoints < 2) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
for (let j = 0; j < numPoints; j++) {
|
|
20
|
+
const point = points[j];
|
|
21
|
+
const cmd = j ? 'L' : 'M';
|
|
22
|
+
pointsAttribute += `${cmd} ${point[0]},${point[1]} `;
|
|
23
|
+
}
|
|
24
|
+
if (closePath) {
|
|
25
|
+
pointsAttribute += 'Z ';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (!pointsAttribute) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const attributes = {
|
|
32
|
+
d: pointsAttribute,
|
|
33
|
+
stroke: color,
|
|
34
|
+
fill: fillColor,
|
|
35
|
+
'fill-opacity': fillOpacity,
|
|
36
|
+
'stroke-width': strokeWidth,
|
|
37
|
+
'stroke-dasharray': lineDash,
|
|
38
|
+
};
|
|
39
|
+
if (existingNode) {
|
|
40
|
+
setAttributesIfNecessary(attributes, existingNode);
|
|
41
|
+
svgDrawingHelper.setNodeTouched(svgNodeHash);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
const newNode = document.createElementNS(svgns, 'path');
|
|
45
|
+
setNewAttributesIfValid(attributes, newNode);
|
|
46
|
+
svgDrawingHelper.appendNode(newNode, svgNodeHash);
|
|
47
|
+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|
|
7
7
|
}
|
|
8
|
-
const {
|
|
9
|
-
color: 'dodgerblue',
|
|
10
|
-
width: '2',
|
|
11
|
-
fillColor: 'none',
|
|
12
|
-
fillOpacity: 0,
|
|
13
|
-
lineWidth: undefined,
|
|
14
|
-
lineDash: undefined,
|
|
15
|
-
connectLastToFirst: false,
|
|
16
|
-
}, options);
|
|
8
|
+
const { color = 'dodgerblue', width = 10, fillColor = 'none', fillOpacity = 0, lineWidth, lineDash, closePath = false, } = options;
|
|
17
9
|
const strokeWidth = lineWidth || width;
|
|
18
10
|
const svgns = 'http://www.w3.org/2000/svg';
|
|
19
11
|
const svgNodeHash = _getHash(annotationUID, 'polyline', polylineUID);
|
|
@@ -22,7 +14,7 @@ export default function drawPolyline(svgDrawingHelper, annotationUID, polylineUI
|
|
|
22
14
|
for (const point of points) {
|
|
23
15
|
pointsAttribute += `${point[0].toFixed(1)}, ${point[1].toFixed(1)} `;
|
|
24
16
|
}
|
|
25
|
-
if (
|
|
17
|
+
if (closePath) {
|
|
26
18
|
const firstPoint = points[0];
|
|
27
19
|
pointsAttribute += `${firstPoint[0]}, ${firstPoint[1]}`;
|
|
28
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawPolyline.js","sourceRoot":"","sources":["../../../src/drawingSvg/drawPolyline.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAChE,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AASlE,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,gBAAkC,EAClC,aAAqB,EACrB,WAAmB,EACnB,MAAsB,EACtB,OAQC;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,OAAO;KACR;IAED,MAAM,
|
|
1
|
+
{"version":3,"file":"drawPolyline.js","sourceRoot":"","sources":["../../../src/drawingSvg/drawPolyline.ts"],"names":[],"mappings":"AACA,OAAO,Q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E,WAAW;QAC3B,kBAAkB,EAAE,QAAQ;KAC7B,CAAC;IAEF,IAAI,gBAAgB,EAAE;QAEpB,wBAAwB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;QAEvD,gBAAgB,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;KAC9C;SAAM;QACL,MAAM,WAAW,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAEhE,uBAAuB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAEjD,gBAAgB,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;KACvD;AACH,CAAC"}
|
|
@@ -6,6 +6,7 @@ import drawHandles from './drawHandles';
|
|
|
6
6
|
import drawHandle from './drawHandle';
|
|
7
7
|
import drawLine from './drawLine';
|
|
8
8
|
import drawPolyline from './drawPolyline';
|
|
9
|
+
import drawPath from './drawPath';
|
|
9
10
|
import drawLinkedTextBox from './drawLinkedTextBox';
|
|
10
11
|
import drawRect from './drawRect';
|
|
11
12
|
import drawTextBox from './drawTextBox';
|
|
@@ -13,5 +14,5 @@ import drawArrow from './drawArrow';
|
|
|
13
14
|
import drawRedactionRect from './drawRedactionRect';
|
|
14
15
|
import setAttributesIfNecessary from './setAttributesIfNecessary';
|
|
15
16
|
import setNewAttributesIfValid from './setNewAttributesIfValid';
|
|
16
|
-
export { draw, drawCircle, drawEllipse, drawEllipseByCoordinates, drawHandles, drawHandle, drawLine, drawPolyline, drawLinkedTextBox, drawRect, drawTextBox, drawArrow, drawRedactionRect, setAttributesIfNecessary, setNewAttributesIfValid, };
|
|
17
|
+
export { draw, drawCircle, drawEllipse, drawEllipseByCoordinates, drawHandles, drawHandle, drawLine, drawPolyline, drawPath, drawLinkedTextBox, drawRect, drawTextBox, drawArrow, drawRedactionRect, setAttributesIfNecessary, setNewAttributesIfValid, };
|
|
17
18
|
//# sourceMappingURL=index.js.map
|