@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,467 @@
|
|
|
1
|
+
import { expose } from 'comlink';
|
|
2
|
+
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
3
|
+
import vtkDataArray from '@kitware/vtk.js/Common/Core/DataArray';
|
|
4
|
+
import ICRPolySeg from '@icr/polyseg-wasm';
|
|
5
|
+
import { utilities } from '@cornerstonejs/core';
|
|
6
|
+
import { getBoundingBoxAroundShapeWorld } from '../utilities/boundingBox';
|
|
7
|
+
import { pointInShapeCallback } from '../utilities';
|
|
8
|
+
import { isPointInsidePolyline3D } from '../utilities/math/polyline';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Object containing methods for converting between different representations of
|
|
12
|
+
* segmentations (e.g., contour, labelmap, surface, etc.) These logics
|
|
13
|
+
* are used in a webworker to avoid blocking the main thread. You can
|
|
14
|
+
* search for workerManager.executeTask('polySeg', ...) to see
|
|
15
|
+
* how these methods are used.
|
|
16
|
+
*
|
|
17
|
+
* See also the webworker docs at packages/docs/docs/concepts/cornerstone-core/web-worker.md
|
|
18
|
+
* to learn more about how to use webworkers in the context of Cornerstone.
|
|
19
|
+
*/
|
|
20
|
+
const polySegConverters = {
|
|
21
|
+
/**
|
|
22
|
+
* The polySeg instance that is used to convert between different representations
|
|
23
|
+
*/
|
|
24
|
+
polySeg: null,
|
|
25
|
+
/**
|
|
26
|
+
* Utilities to keep track of the initialization state of the polySeg instance
|
|
27
|
+
* and avoid initializing it multiple times
|
|
28
|
+
*/
|
|
29
|
+
polySegInitializing: false,
|
|
30
|
+
polySegInitializingPromise: null,
|
|
31
|
+
/**
|
|
32
|
+
* This method initializes the polySeg instance and sets it to this.polySeg
|
|
33
|
+
*/
|
|
34
|
+
async initializePolySeg(progressCallback) {
|
|
35
|
+
if (this.polySegInitializing) {
|
|
36
|
+
await this.polySegInitializingPromise;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (this.polySeg?.instance) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
this.polySegInitializing = true;
|
|
45
|
+
this.polySegInitializingPromise = new Promise((resolve) => {
|
|
46
|
+
this.polySeg = new ICRPolySeg();
|
|
47
|
+
this.polySeg
|
|
48
|
+
.initialize({
|
|
49
|
+
updateProgress: progressCallback,
|
|
50
|
+
})
|
|
51
|
+
.then(() => {
|
|
52
|
+
this.polySegInitializing = false;
|
|
53
|
+
resolve();
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
await this.polySegInitializingPromise;
|
|
58
|
+
},
|
|
59
|
+
/**
|
|
60
|
+
* Converts a contour to a surface using the PolySeg library.
|
|
61
|
+
* @param {Object} args - The arguments for the conversion.
|
|
62
|
+
* @param {Array} args.polylines - The polylines representing the contour.
|
|
63
|
+
* @param {Array} args.numPointsArray - The number of points in each polyline.
|
|
64
|
+
* @param {...Function} callbacks - Optional callback functions.
|
|
65
|
+
* @returns {Promise} - A promise that resolves to the converted surface.
|
|
66
|
+
*/
|
|
67
|
+
async convertContourToSurface(args, ...callbacks) {
|
|
68
|
+
const { polylines, numPointsArray } = args;
|
|
69
|
+
const [progressCallback] = callbacks;
|
|
70
|
+
await this.initializePolySeg(progressCallback);
|
|
71
|
+
const results = await this.polySeg.instance.convertContourRoiToSurface(
|
|
72
|
+
polylines,
|
|
73
|
+
numPointsArray
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
return results;
|
|
77
|
+
},
|
|
78
|
+
/**
|
|
79
|
+
* Converts a labelmap to a surface using the specified arguments.
|
|
80
|
+
* @param {Object} args - The arguments for the conversion.
|
|
81
|
+
* @param {Array} args.scalarData - The scalar data of the labelmap.
|
|
82
|
+
* @param {Array} args.dimensions - The dimensions of the labelmap.
|
|
83
|
+
* @param {Array} args.spacing - The spacing of the labelmap.
|
|
84
|
+
* @param {Array} args.direction - The direction of the labelmap.
|
|
85
|
+
* @param {Array} args.origin - The origin of the labelmap.
|
|
86
|
+
* @param {number} args.segmentIndex - The segment index of the labelmap.
|
|
87
|
+
* @param {Function} progressCallback - The callback function for progress updates.
|
|
88
|
+
* @returns {Promise} - A promise that resolves with the converted surface results.
|
|
89
|
+
*/
|
|
90
|
+
async convertLabelmapToSurface(args, ...callbacks) {
|
|
91
|
+
const [progressCallback] = callbacks;
|
|
92
|
+
await this.initializePolySeg(progressCallback);
|
|
93
|
+
|
|
94
|
+
const results = this.polySeg.instance.convertLabelmapToSurface(
|
|
95
|
+
args.scalarData,
|
|
96
|
+
args.dimensions,
|
|
97
|
+
args.spacing,
|
|
98
|
+
args.direction,
|
|
99
|
+
args.origin,
|
|
100
|
+
[args.segmentIndex]
|
|
101
|
+
);
|
|
102
|
+
return results;
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Converts a contour to a volume labelmap.
|
|
106
|
+
* @param {Object} args - The arguments for the conversion.
|
|
107
|
+
* @param {Array} args.segmentIndices - The indices of the segments.
|
|
108
|
+
* @param {Array} args.scalarData - The scalar data.
|
|
109
|
+
* @param {Map} args.annotationUIDsInSegmentMap - The map of annotation UIDs in segment.
|
|
110
|
+
* @param {Array} args.dimensions - The dimensions of the image data.
|
|
111
|
+
* @param {Array} args.origin - The origin of the image data.
|
|
112
|
+
* @param {Array} args.direction - The direction of the image data.
|
|
113
|
+
* @param {Array} args.spacing - The spacing of the image data.
|
|
114
|
+
* @param {...Function} callbacks - Optional callbacks.
|
|
115
|
+
* @param {Function} callbacks[0] - The progress callback.
|
|
116
|
+
* @returns {Array} - The scalar data of the segmentation voxel manager.
|
|
117
|
+
*/
|
|
118
|
+
async convertContourToVolumeLabelmap(args, ...callbacks) {
|
|
119
|
+
const [progressCallback] = callbacks;
|
|
120
|
+
const polySeg = await new ICRPolySeg();
|
|
121
|
+
await polySeg.initialize({
|
|
122
|
+
updateProgress: progressCallback,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const {
|
|
126
|
+
segmentIndices,
|
|
127
|
+
scalarData,
|
|
128
|
+
annotationUIDsInSegmentMap,
|
|
129
|
+
dimensions,
|
|
130
|
+
origin,
|
|
131
|
+
direction,
|
|
132
|
+
spacing,
|
|
133
|
+
} = args;
|
|
134
|
+
|
|
135
|
+
const segmentationVoxelManager =
|
|
136
|
+
utilities.VoxelManager.createVolumeVoxelManager(dimensions, scalarData);
|
|
137
|
+
|
|
138
|
+
const imageData = vtkImageData.newInstance();
|
|
139
|
+
imageData.setDimensions(dimensions);
|
|
140
|
+
imageData.setOrigin(origin);
|
|
141
|
+
imageData.setDirection(direction);
|
|
142
|
+
imageData.setSpacing(spacing);
|
|
143
|
+
|
|
144
|
+
const scalarArray = vtkDataArray.newInstance({
|
|
145
|
+
name: 'Pixels',
|
|
146
|
+
numberOfComponents: 1,
|
|
147
|
+
values: scalarData,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
imageData.getPointData().setScalars(scalarArray);
|
|
151
|
+
|
|
152
|
+
imageData.modified();
|
|
153
|
+
|
|
154
|
+
for (const index of segmentIndices) {
|
|
155
|
+
const annotations = annotationUIDsInSegmentMap.get(index);
|
|
156
|
+
|
|
157
|
+
for (const annotation of annotations) {
|
|
158
|
+
const bounds = getBoundingBoxAroundShapeWorld(
|
|
159
|
+
annotation.data.contour.polyline
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
const [iMin, jMin, kMin] = utilities.transformWorldToIndex(imageData, [
|
|
163
|
+
bounds[0][0],
|
|
164
|
+
bounds[1][0],
|
|
165
|
+
bounds[2][0],
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
const [iMax, jMax, kMax] = utilities.transformWorldToIndex(imageData, [
|
|
169
|
+
bounds[0][1],
|
|
170
|
+
bounds[1][1],
|
|
171
|
+
bounds[2][1],
|
|
172
|
+
]);
|
|
173
|
+
|
|
174
|
+
// Run the pointInShapeCallback for the combined bounding box
|
|
175
|
+
pointInShapeCallback(
|
|
176
|
+
imageData,
|
|
177
|
+
(pointLPS) => {
|
|
178
|
+
// Check if the point is inside any of the polylines for this segment
|
|
179
|
+
return isPointInsidePolyline3D(
|
|
180
|
+
pointLPS,
|
|
181
|
+
annotation.data.contour.polyline
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
({ pointIJK }) => {
|
|
185
|
+
segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
|
|
186
|
+
},
|
|
187
|
+
[
|
|
188
|
+
[iMin, iMax],
|
|
189
|
+
[jMin, jMax],
|
|
190
|
+
[kMin, kMax],
|
|
191
|
+
]
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return segmentationVoxelManager.scalarData;
|
|
197
|
+
},
|
|
198
|
+
/**
|
|
199
|
+
* Converts a contour to a stack labelmap.
|
|
200
|
+
* @param {Object} args - The arguments for the conversion.
|
|
201
|
+
* @param {Array} callbacks - Optional callbacks for progress updates.
|
|
202
|
+
* @returns {Promise<Object>} - The converted segmentations information.
|
|
203
|
+
*/
|
|
204
|
+
async convertContourToStackLabelmap(args, ...callbacks) {
|
|
205
|
+
const [progressCallback] = callbacks;
|
|
206
|
+
const polySeg = await new ICRPolySeg();
|
|
207
|
+
await polySeg.initialize({
|
|
208
|
+
updateProgress: progressCallback,
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
const { segmentationsInfo, annotationUIDsInSegmentMap, segmentIndices } =
|
|
212
|
+
args;
|
|
213
|
+
|
|
214
|
+
const segmentationVoxelManagers = new Map();
|
|
215
|
+
|
|
216
|
+
segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
|
|
217
|
+
const { dimensions, scalarData, direction, spacing, origin } =
|
|
218
|
+
segmentationInfo;
|
|
219
|
+
const manager = utilities.VoxelManager.createVolumeVoxelManager(
|
|
220
|
+
dimensions,
|
|
221
|
+
scalarData
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
const imageData = vtkImageData.newInstance();
|
|
225
|
+
imageData.setDimensions(dimensions);
|
|
226
|
+
imageData.setOrigin(origin);
|
|
227
|
+
imageData.setDirection(direction);
|
|
228
|
+
imageData.setSpacing(spacing);
|
|
229
|
+
|
|
230
|
+
const scalarArray = vtkDataArray.newInstance({
|
|
231
|
+
name: 'Pixels',
|
|
232
|
+
numberOfComponents: 1,
|
|
233
|
+
values: scalarData,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
imageData.getPointData().setScalars(scalarArray);
|
|
237
|
+
|
|
238
|
+
imageData.modified();
|
|
239
|
+
|
|
240
|
+
segmentationVoxelManagers.set(referencedImageId, { manager, imageData });
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
for (const index of segmentIndices) {
|
|
244
|
+
const annotations = annotationUIDsInSegmentMap.get(index);
|
|
245
|
+
|
|
246
|
+
for (const annotation of annotations) {
|
|
247
|
+
if (!annotation?.data) {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
const bounds = getBoundingBoxAroundShapeWorld(
|
|
251
|
+
annotation.data.contour.polyline
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
const { referencedImageId } = annotation.metadata;
|
|
255
|
+
|
|
256
|
+
const { manager: segmentationVoxelManager, imageData } =
|
|
257
|
+
segmentationVoxelManagers.get(referencedImageId);
|
|
258
|
+
|
|
259
|
+
const [iMin, jMin, kMin] = utilities.transformWorldToIndex(imageData, [
|
|
260
|
+
bounds[0][0],
|
|
261
|
+
bounds[1][0],
|
|
262
|
+
bounds[2][0],
|
|
263
|
+
]);
|
|
264
|
+
|
|
265
|
+
const [iMax, jMax, kMax] = utilities.transformWorldToIndex(imageData, [
|
|
266
|
+
bounds[0][1],
|
|
267
|
+
bounds[1][1],
|
|
268
|
+
bounds[2][1],
|
|
269
|
+
]);
|
|
270
|
+
|
|
271
|
+
// Run the pointInShapeCallback for the combined bounding box
|
|
272
|
+
pointInShapeCallback(
|
|
273
|
+
imageData,
|
|
274
|
+
(pointLPS) => {
|
|
275
|
+
// Check if the point is inside any of the polylines for this segment
|
|
276
|
+
return isPointInsidePolyline3D(
|
|
277
|
+
pointLPS,
|
|
278
|
+
annotation.data.contour.polyline
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
({ pointIJK }) => {
|
|
282
|
+
segmentationVoxelManager.setAtIJKPoint(pointIJK, index);
|
|
283
|
+
},
|
|
284
|
+
[
|
|
285
|
+
[iMin, iMax],
|
|
286
|
+
[jMin, jMax],
|
|
287
|
+
[kMin, kMax],
|
|
288
|
+
]
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
segmentationsInfo.forEach((segmentationInfo, referencedImageId) => {
|
|
294
|
+
const { manager: segmentationVoxelManager } =
|
|
295
|
+
segmentationVoxelManagers.get(referencedImageId);
|
|
296
|
+
|
|
297
|
+
segmentationInfo.scalarData = segmentationVoxelManager.scalarData;
|
|
298
|
+
});
|
|
299
|
+
return segmentationsInfo;
|
|
300
|
+
},
|
|
301
|
+
/**
|
|
302
|
+
* Converts a surface to a volume labelmap.
|
|
303
|
+
*
|
|
304
|
+
* @param {Object} args - The arguments for the conversion.
|
|
305
|
+
* @param {Array} args.points - The points defining the surface.
|
|
306
|
+
* @param {Array} args.polys - The polygons defining the surface.
|
|
307
|
+
* @param {Array} args.dimensions - The dimensions of the volume.
|
|
308
|
+
* @param {Array} args.spacing - The spacing between voxels in the volume.
|
|
309
|
+
* @param {Array} args.direction - The direction of the volume.
|
|
310
|
+
* @param {Array} args.origin - The origin of the volume.
|
|
311
|
+
* @param {Function} progressCallback - The callback function for reporting progress.
|
|
312
|
+
* @returns {Promise} - A promise that resolves with the converted labelmap.
|
|
313
|
+
*/
|
|
314
|
+
async convertSurfaceToVolumeLabelmap(args, ...callbacks) {
|
|
315
|
+
const [progressCallback] = callbacks;
|
|
316
|
+
await this.initializePolySeg(progressCallback);
|
|
317
|
+
|
|
318
|
+
const results = this.polySeg.instance.convertSurfaceToLabelmap(
|
|
319
|
+
args.points,
|
|
320
|
+
args.polys,
|
|
321
|
+
args.dimensions,
|
|
322
|
+
args.spacing,
|
|
323
|
+
args.direction,
|
|
324
|
+
args.origin
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
return results;
|
|
328
|
+
},
|
|
329
|
+
/**
|
|
330
|
+
* Converts surfaces to a volume labelmap.
|
|
331
|
+
* @param {Object} args - The arguments for the conversion.
|
|
332
|
+
* @param {Map} args.segmentsInfo - A map containing information about the segments.
|
|
333
|
+
* @param {Function} progressCallback - A callback function for reporting progress.
|
|
334
|
+
* @returns {Uint8Array} - The resulting volume labelmap.
|
|
335
|
+
*/
|
|
336
|
+
async convertSurfacesToVolumeLabelmap(args, ...callbacks) {
|
|
337
|
+
const [progressCallback] = callbacks;
|
|
338
|
+
await this.initializePolySeg(progressCallback);
|
|
339
|
+
|
|
340
|
+
const { segmentsInfo } = args;
|
|
341
|
+
|
|
342
|
+
const promises = Array.from(segmentsInfo.keys()).map((segmentIndex) => {
|
|
343
|
+
const { points, polys } = segmentsInfo.get(segmentIndex);
|
|
344
|
+
const result = this.polySeg.instance.convertSurfaceToLabelmap(
|
|
345
|
+
points,
|
|
346
|
+
polys,
|
|
347
|
+
args.dimensions,
|
|
348
|
+
args.spacing,
|
|
349
|
+
args.direction,
|
|
350
|
+
args.origin
|
|
351
|
+
);
|
|
352
|
+
|
|
353
|
+
return {
|
|
354
|
+
...result,
|
|
355
|
+
segmentIndex,
|
|
356
|
+
};
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
const results = await Promise.all(promises);
|
|
360
|
+
|
|
361
|
+
const targetImageData = vtkImageData.newInstance();
|
|
362
|
+
targetImageData.setDimensions(args.dimensions);
|
|
363
|
+
targetImageData.setOrigin(args.origin);
|
|
364
|
+
targetImageData.setSpacing(args.spacing);
|
|
365
|
+
targetImageData.setDirection(args.direction);
|
|
366
|
+
|
|
367
|
+
const totalSize =
|
|
368
|
+
args.dimensions[0] * args.dimensions[1] * args.dimensions[2];
|
|
369
|
+
|
|
370
|
+
const scalarArray = vtkDataArray.newInstance({
|
|
371
|
+
name: 'Pixels',
|
|
372
|
+
numberOfComponents: 1,
|
|
373
|
+
values: new Uint8Array(totalSize),
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
targetImageData.getPointData().setScalars(scalarArray);
|
|
377
|
+
targetImageData.modified();
|
|
378
|
+
|
|
379
|
+
// we need to then consolidate the results into a single volume
|
|
380
|
+
// by looping into each voxel with pointInShapeCallback
|
|
381
|
+
// and check if the voxel is inside any of the reconstructed
|
|
382
|
+
// labelmaps
|
|
383
|
+
|
|
384
|
+
const segmentationVoxelManager =
|
|
385
|
+
utilities.VoxelManager.createVolumeVoxelManager(
|
|
386
|
+
args.dimensions,
|
|
387
|
+
targetImageData.getPointData().getScalars().getData()
|
|
388
|
+
);
|
|
389
|
+
|
|
390
|
+
const outputVolumesInfo = results.map((result) => {
|
|
391
|
+
const { data, dimensions, direction, origin, spacing } = result;
|
|
392
|
+
const volume = vtkImageData.newInstance();
|
|
393
|
+
volume.setDimensions(dimensions);
|
|
394
|
+
volume.setOrigin(origin);
|
|
395
|
+
volume.setSpacing(spacing);
|
|
396
|
+
volume.setDirection(direction);
|
|
397
|
+
|
|
398
|
+
const scalarArray = vtkDataArray.newInstance({
|
|
399
|
+
name: 'Pixels',
|
|
400
|
+
numberOfComponents: 1,
|
|
401
|
+
values: data,
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
volume.getPointData().setScalars(scalarArray);
|
|
405
|
+
|
|
406
|
+
volume.modified();
|
|
407
|
+
|
|
408
|
+
const voxelManager = utilities.VoxelManager.createVolumeVoxelManager(
|
|
409
|
+
dimensions,
|
|
410
|
+
data
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
const extent = volume.getExtent(); // e.g., [0, 176, 0, 268, 0, 337] for dimensions of [177, 269, 338]
|
|
414
|
+
|
|
415
|
+
return {
|
|
416
|
+
volume,
|
|
417
|
+
voxelManager,
|
|
418
|
+
extent,
|
|
419
|
+
scalarData: data,
|
|
420
|
+
segmentIndex: result.segmentIndex,
|
|
421
|
+
};
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
pointInShapeCallback(
|
|
425
|
+
targetImageData,
|
|
426
|
+
() => true, // we want to loop into all voxels
|
|
427
|
+
({ pointIJK, pointLPS }) => {
|
|
428
|
+
// Check if the point is inside any of the reconstructed labelmaps
|
|
429
|
+
// Todo: we can optimize this by returning early if the bounding box
|
|
430
|
+
// of the point is outside the bounding box of the labelmap
|
|
431
|
+
|
|
432
|
+
try {
|
|
433
|
+
for (const volumeInfo of outputVolumesInfo) {
|
|
434
|
+
const { volume, extent, voxelManager, segmentIndex } = volumeInfo;
|
|
435
|
+
|
|
436
|
+
const index = volume.worldToIndex(pointLPS);
|
|
437
|
+
|
|
438
|
+
// check if the ijk point is inside the volume
|
|
439
|
+
if (
|
|
440
|
+
index[0] < extent[0] ||
|
|
441
|
+
index[0] > extent[1] ||
|
|
442
|
+
index[1] < extent[2] ||
|
|
443
|
+
index[1] > extent[3] ||
|
|
444
|
+
index[2] < extent[4] ||
|
|
445
|
+
index[2] > extent[5]
|
|
446
|
+
) {
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
const roundedIndex = index.map(Math.round);
|
|
451
|
+
const value = voxelManager.getAtIJK(...roundedIndex);
|
|
452
|
+
if (value > 0) {
|
|
453
|
+
segmentationVoxelManager.setAtIJKPoint(pointIJK, segmentIndex);
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
} catch (error) {
|
|
458
|
+
// right now there is weird error if the point is outside the volume
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
|
|
463
|
+
return segmentationVoxelManager.scalarData;
|
|
464
|
+
},
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
expose(polySegConverters);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addContourSetsToElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Contour/addContourSetsToElement.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAmD;AACnD,sFAAiE;AACj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,IAAI,GAAG,CAAC,cAAc,CAAC;QACvC,kBAAkB;QAClB,kBAAkB;KACnB,CAAC,CACH,CAAC;IAEF,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAE3B,QAAQ,CAAC,QAAQ,CAAC;QAChB,GAAG,EAAE,eAAe;QACpB,KAAK,EAAE,KAA+B;KACvC,CAAC,CAAC;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,CAAC;AACpB,CAAC;AA9FD,0DA8FC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
2
|
-
import { SegmentationRepresentationConfig, ToolGroupSpecificContourRepresentation } from '../../../types';
|
|
3
|
-
export declare function addOrUpdateContourSets(viewport: Types.IVolumeViewport, geometryIds: string[], contourRepresentation: ToolGroupSpecificContourRepresentation, contourRepresentationConfig: SegmentationRepresentationConfig): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addOrUpdateContourSets = void 0;
|
|
4
|
-
const addContourSetsToElement_1 = require("./addContourSetsToElement");
|
|
5
|
-
const updateContourSets_1 = require("./updateContourSets");
|
|
6
|
-
function addOrUpdateContourSets(viewport, geometryIds, contourRepresentation, contourRepresentationConfig) {
|
|
7
|
-
const { segmentationRepresentationUID } = contourRepresentation;
|
|
8
|
-
const actorUID = `CONTOUR_${segmentationRepresentationUID}`;
|
|
9
|
-
const actor = viewport.getActor(actorUID);
|
|
10
|
-
const addOrUpdateFn = actor ? updateContourSets_1.updateContourSets : addContourSetsToElement_1.addContourSetsToElement;
|
|
11
|
-
addOrUpdateFn(viewport, geometryIds, contourRepresentation, contourRepresentationConfig, actorUID);
|
|
12
|
-
}
|
|
13
|
-
exports.addOrUpdateContourSets = addOrUpdateContourSets;
|
|
14
|
-
//# sourceMappingURL=addOrUpdateContourSets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addOrUpdateContourSets.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Contour/addOrUpdateContourSets.ts"],"names":[],"mappings":";;;AAMA,uEAAoE;AACpE,2DAAwD;AAExD,SAAgB,sBAAsB,CACpC,QAA+B,EAC/B,WAAqB,EACrB,qBAA6D,EAC7D,2BAA6D;IAE7D,MAAM,EAAE,6BAA6B,EAAE,GAAG,qBAAqB,CAAC;IAChE,MAAM,QAAQ,GAAG,WAAW,6BAA6B,EAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE1C,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,qCAAiB,CAAC,CAAC,CAAC,iDAAuB,CAAC;IAC1E,aAAa,CACX,QAAQ,EACR,WAAW,EACX,qBAAqB,EACrB,2BAA2B,EAC3B,QAAQ,CACT,CAAC;AACJ,CAAC;AAlBD,wDAkBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contourConfigCache.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Contour/contourConfigCache.ts"],"names":[],"mappings":";;;AAYA,MAAM,2CAA2C,GAAG,IAAI,GAAG,EAAE,CAAC;AAE9D,SAAgB,cAAc,CAC5B,6BAAqC;IAErC,OAAO,2CAA2C,CAAC,GAAG,CACpD,6BAA6B,CAC9B,CAAC;AACJ,CAAC;AAND,wCAMC;AAED,SAAgB,cAAc,CAC5B,6BAAqC,EACrC,MAAmB;IAEnB,2CAA2C,CAAC,GAAG,CAC7C,6BAA6B,EAC7B,MAAM,CACP,CAAC;AACJ,CAAC;AARD,wCAQC;AAED,SAAgB,iBAAiB,CAAC,6BAAqC;IACrE,2CAA2C,CAAC,MAAM,CAChD,6BAA6B,CAC9B,CAAC;AACJ,CAAC;AAJD,8CAIC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
2
|
-
import { SegmentationRepresentationConfig, ToolGroupSpecificContourRepresentation } from '../../../types';
|
|
3
|
-
export declare function updateContourSets(viewport: Types.IVolumeViewport, geometryIds: string[], contourRepresentation: ToolGroupSpecificContourRepresentation, contourRepresentationConfig: SegmentationRepresentationConfig, contourActorUID: string): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateContourSets.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Contour/updateContourSets.ts"],"names":[],"mappings":";;;AAAA,8CAAmD;AAOnD,6DAAsE;AACtE,mCAAmD;AAEnD,SAAgB,iBAAiB,CAC/B,QAA+B,EAC/B,WAAqB,EACrB,qBAA6D,EAC7D,2BAA6D,EAC7D,eAAuB;IAEvB,MAAM,EAAE,6BAA6B,EAAE,cAAc,EAAE,GACrD,qBAAqB,CAAC;IACxB,MAAM,gBAAgB,GAAG,2BAA2B,CAAC,eAAe,CAAC,OAAO,CAAC;IAC7E,MAAM,YAAY,GAAG,IAAA,mCAAc,EAAC,6BAA6B,CAAC,CAAC;IAEnE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IAE5D,IAAI,CAAC,gBAAgB,EAAE;QACrB,OAAO,CAAC,IAAI,CACV,uCAAuC,eAAe,oBAAoB,CAC3E,CAAC;QACF,OAAO;KACR;IAED,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAC;IAEnC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,kBAAkB,CAAC;IAEjE,IAAI,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,kBAAkB,MAAK,oBAAoB,EAAE;QAC5D,KAA6B;aAC3B,WAAW,EAAE;aACb,YAAY,CAAC,oBAAoB,CAAC,CAAC;QAEtC,IAAA,mCAAc,EACZ,6BAA6B,EAC7B,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,YAAY,EAAE;YAC9B,kBAAkB,EAAE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AW,EAAE,CAAC,OAAO,CAAC,CAAC,OAAuB,EAAE,EAAE;QAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;QACtC,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QAG/B,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAChC,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,CAAC,cAAc,GAAG,UAAU,CACnD,CAAC;QAGF,IAAI,IAAI,KAAK,YAAK,CAAC,WAAW,CAAC,aAAa,EAAE;YAC5C,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;SACpC;QAED,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEjD,UAAU,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QAE/B,KAAK,CAAC,cAAc,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC;QAExC,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC,MAAM,CAAC;IAC7C,CAAC,CAAC,CAAC;IAGH,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAG9B,MAAM,OAAO,GAAG,kBAAW,CAAC,WAAW,EAAE,CAAC;IAC1C,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExB,OAAO,OAAO,CAAC;AACjB,CAAC;AA1CD,kCA0CC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@cornerstonejs/core");
|
|
4
|
-
function validate(segmentationInput) {
|
|
5
|
-
if (!segmentationInput.representation.data) {
|
|
6
|
-
throw new Error('The segmentationInput.representationData.data is undefined, please provide a valid representationData.data');
|
|
7
|
-
}
|
|
8
|
-
const representationData = segmentationInput.representation
|
|
9
|
-
.data;
|
|
10
|
-
if ('volumeId' in representationData) {
|
|
11
|
-
const cachedVolume = core_1.cache.getVolume(representationData.volumeId);
|
|
12
|
-
if (!cachedVolume) {
|
|
13
|
-
throw new Error(`volumeId of ${representationData.volumeId} not found in cache, you should load and cache volume before adding segmentation`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.default = validate;
|
|
20
|
-
//# sourceMappingURL=validateRepresentationData.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validateRepresentationData.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Labelmap/validateRepresentationData.ts"],"names":[],"mappings":";;AACA,8CAA4C;AAM5C,SAAS,QAAQ,CAAC,iBAA0C;IAC1D,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,IAAI,EAAE;QAC1C,MAAM,IAAI,KAAK,CACb,4GAA4G,CAC7G,CAAC;KACH;IAED,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,cAAc;SACxD,IAAgC,CAAC;IAEpC,IAAI,UAAU,IAAI,kBAAkB,EAAE;QAEpC,MAAM,YAAY,GAAG,YAAK,CAAC,SAAS,CACjC,kBAAqD,CAAC,QAAQ,CAChE,CAAC;QAEF,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,IAAI,KAAK,CACb,eACG,kBAAqD,CAAC,QACzD,kFAAkF,CACnF,CAAC;SACH;KACF;SAAM;KAEN;AACH,CAAC;AAED,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,84 +0,0 @@
|
|
|
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 core_1 = require("@cornerstonejs/core");
|
|
7
|
-
const Mapper_1 = __importDefault(require("@kitware/vtk.js/Rendering/Core/Mapper"));
|
|
8
|
-
const Actor_1 = __importDefault(require("@kitware/vtk.js/Rendering/Core/Actor"));
|
|
9
|
-
const ClipClosedSurface_1 = __importDefault(require("@kitware/vtk.js/Filters/General/ClipClosedSurface"));
|
|
10
|
-
const PolyData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/PolyData"));
|
|
11
|
-
const CellArray_1 = __importDefault(require("@kitware/vtk.js/Common/Core/CellArray"));
|
|
12
|
-
const pointToString_1 = require("../../../utilities/pointToString");
|
|
13
|
-
const polyDataCache = new Map();
|
|
14
|
-
function addSurfaceToElement(element, surface, actorUID) {
|
|
15
|
-
const enabledElement = (0, core_1.getEnabledElement)(element);
|
|
16
|
-
const { viewport } = enabledElement;
|
|
17
|
-
const points = surface.getPoints();
|
|
18
|
-
const polys = surface.getPolys();
|
|
19
|
-
const color = surface.getColor();
|
|
20
|
-
const polyData = PolyData_1.default.newInstance();
|
|
21
|
-
polyData.getPoints().setData(points, 3);
|
|
22
|
-
const triangles = CellArray_1.default.newInstance({
|
|
23
|
-
values: Float32Array.from(polys),
|
|
24
|
-
});
|
|
25
|
-
polyData.setPolys(triangles);
|
|
26
|
-
const mapper = Mapper_1.default.newInstance({});
|
|
27
|
-
let clippingFilter;
|
|
28
|
-
if (!(viewport instanceof core_1.VolumeViewport3D)) {
|
|
29
|
-
clippingFilter = ClipClosedSurface_1.default.newInstance({
|
|
30
|
-
clippingPlanes: [],
|
|
31
|
-
activePlaneId: 2,
|
|
32
|
-
passPointData: false,
|
|
33
|
-
});
|
|
34
|
-
clippingFilter.setInputData(polyData);
|
|
35
|
-
clippingFilter.setGenerateOutline(true);
|
|
36
|
-
clippingFilter.setGenerateFaces(false);
|
|
37
|
-
clippingFilter.update();
|
|
38
|
-
const filteredData = clippingFilter.getOutputData();
|
|
39
|
-
mapper.setInputData(filteredData);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
mapper.setInputData(polyData);
|
|
43
|
-
}
|
|
44
|
-
const actor = Actor_1.default.newInstance();
|
|
45
|
-
actor.setMapper(mapper);
|
|
46
|
-
actor.getProperty().setColor(color[0] / 255, color[1] / 255, color[2] / 255);
|
|
47
|
-
viewport.addActor({
|
|
48
|
-
actor,
|
|
49
|
-
uid: actorUID,
|
|
50
|
-
clippingFilter,
|
|
51
|
-
});
|
|
52
|
-
element.addEventListener(core_1.Enums.Events.CLIPPING_PLANES_UPDATED, updateSurfacePlanes);
|
|
53
|
-
}
|
|
54
|
-
function updateSurfacePlanes(evt) {
|
|
55
|
-
const { actorEntry, vtkPlanes, viewport } = evt.detail;
|
|
56
|
-
if (!(actorEntry === null || actorEntry === void 0 ? void 0 : actorEntry.clippingFilter)) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const mapper = actorEntry.actor.getMapper();
|
|
60
|
-
const { viewPlaneNormal } = viewport.getCamera();
|
|
61
|
-
const imageIndex = viewport.getCurrentImageIdIndex();
|
|
62
|
-
const cacheId = `${viewport.id}-${(0, pointToString_1.pointToString)(viewPlaneNormal)}-${imageIndex}`;
|
|
63
|
-
let actorCache = polyDataCache.get(actorEntry.uid);
|
|
64
|
-
if (!actorCache) {
|
|
65
|
-
actorCache = new Map();
|
|
66
|
-
polyDataCache.set(actorEntry.uid, actorCache);
|
|
67
|
-
}
|
|
68
|
-
let polyData = actorCache.get(cacheId);
|
|
69
|
-
if (!polyData) {
|
|
70
|
-
const clippingFilter = actorEntry.clippingFilter;
|
|
71
|
-
clippingFilter.setClippingPlanes(vtkPlanes);
|
|
72
|
-
try {
|
|
73
|
-
clippingFilter.update();
|
|
74
|
-
polyData = clippingFilter.getOutputData();
|
|
75
|
-
actorCache.set(cacheId, polyData);
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
console.error('Error clipping surface', e);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
mapper.setInputData(polyData);
|
|
82
|
-
}
|
|
83
|
-
exports.default = addSurfaceToElement;
|
|
84
|
-
//# sourceMappingURL=addSurfaceToElement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addSurfaceToElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/addSurfaceToElement.ts"],"names":[],"mappings":";;;;;AAAA,8CAI6B;AAC7B,mFAA8D;AAC9D,iFAA4D;AAC5D,0GAAqF;AACrF,yFAAoE;AACpE,sFAAiE;AACjE,oEAAiE;AAEjE,MAAM,aAAa,GAAG,IAAI,GAAG,EAAE,CAAC;AAEhC,SAAS,mBAAmB,CAC1B,OAAuB,EACvB,OAAY,EACZ,QAAgB;IAEhB,MAAM,cAAc,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;IAClD,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC;IAKpC,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG,kBAAW,CAAC,WAAW,EAAE,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAExC,MAAM,SAAS,GAAG,mBAAY,CAAC,WAAW,CAAC;QACzC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;KACjC,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IAE7B,MAAM,MAAM,GAAG,gBAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACzC,IAAI,cAAc,CAAC;IACnB,IAAI,CAAC,CAAC,QAAQ,YAAY,uBAAgB,CAAC,EAAE;QAC3C,cAAc,GAAG,2BAAoB,CAAC,WAAW,C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