@cornerstonejs/tools 1.53.0 → 1.54.1
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/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/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +6 -11
- 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 +2 -1
- package/dist/cjs/stateManagement/annotation/annotationState.js +6 -1
- package/dist/cjs/stateManagement/annotation/annotationState.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/tools/ScaleOverlayTool.js +2 -1
- package/dist/cjs/tools/ScaleOverlayTool.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 +1 -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/planarFreehandROITool/drawLoop.js +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.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/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/ContourSegmentationBaseTool.d.ts +1 -2
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.js +24 -24
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.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/ContourSegmentationAnnotation.d.ts +0 -1
- 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/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/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 +2 -2
- package/dist/cjs/utilities/contours/index.js +3 -3
- package/dist/cjs/utilities/contours/index.js.map +1 -1
- 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/index.d.ts +2 -1
- package/dist/cjs/utilities/math/polyline/index.js +3 -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/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/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/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +7 -12
- 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 +5 -1
- package/dist/esm/stateManagement/annotation/annotationState.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/tools/ScaleOverlayTool.js +2 -1
- package/dist/esm/tools/ScaleOverlayTool.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 +1 -2
- 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/planarFreehandROITool/drawLoop.js +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.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/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/ContourSegmentationBaseTool.js +24 -24
- package/dist/esm/tools/base/ContourSegmentationBaseTool.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/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/getDeduplicatedVTKPolyDataPoints.js +46 -0
- package/dist/esm/utilities/contours/getDeduplicatedVTKPolyDataPoints.js.map +1 -0
- package/dist/esm/utilities/contours/index.js +2 -2
- package/dist/esm/utilities/contours/index.js.map +1 -1
- 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/index.js +2 -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/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/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 +2 -1
- package/dist/types/stateManagement/annotation/annotationState.d.ts.map +1 -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/tools/ScaleOverlayTool.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/base/BaseTool.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/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/ContourSegmentationAnnotation.d.ts +0 -1
- package/dist/types/types/ContourSegmentationAnnotation.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/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/getDeduplicatedVTKPolyDataPoints.d.ts +12 -0
- package/dist/types/utilities/contours/getDeduplicatedVTKPolyDataPoints.d.ts.map +1 -0
- package/dist/types/utilities/contours/index.d.ts +2 -2
- package/dist/types/utilities/contours/index.d.ts.map +1 -1
- 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/index.d.ts +2 -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/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/enums/WorkerTypes.ts +16 -0
- package/src/enums/index.js +2 -0
- package/src/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.ts +10 -17
- 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 +6 -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/tools/ScaleOverlayTool.ts +4 -1
- package/src/tools/annotation/PlanarFreehandContourSegmentationTool.ts +1 -22
- package/src/tools/annotation/PlanarFreehandROITool.ts +2 -4
- package/src/tools/annotation/ProbeTool.ts +4 -0
- package/src/tools/annotation/SplineROITool.ts +1 -1
- package/src/tools/annotation/planarFreehandROITool/drawLoop.ts +2 -2
- package/src/tools/annotation/planarFreehandROITool/openContourEndEditLoop.ts +1 -1
- package/src/tools/base/AnnotationTool.ts +1 -1
- package/src/tools/base/BaseTool.ts +1 -6
- package/src/tools/base/ContourBaseTool.ts +1 -1
- package/src/tools/base/ContourSegmentationBaseTool.ts +45 -42
- 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/ContourSegmentationAnnotation.ts +0 -1
- package/src/types/LabelmapTypes.ts +7 -1
- package/src/types/PolySeg.ts +7 -0
- package/src/types/SegmentationStateTypes.ts +20 -4
- 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/getDeduplicatedVTKPolyDataPoints.ts +66 -0
- package/src/utilities/contours/index.ts +2 -2
- package/src/utilities/index.ts +4 -0
- package/src/utilities/math/polyline/containsPoint.ts +3 -1
- package/src/utilities/math/polyline/index.ts +2 -0
- package/src/utilities/math/polyline/isPointInsidePolyline3D.ts +56 -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
package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { VolumeViewport, volumeLoader, utilities, } from '@cornerstonejs/core';
|
|
2
|
+
import { getUniqueSegmentIndices } from '../../../../utilities/segmentation';
|
|
3
|
+
import { getSegmentation } from '../../segmentationState';
|
|
4
|
+
import { convertContourToStackLabelmap, convertContourToVolumeLabelmap, } from './convertContourToLabelmap';
|
|
5
|
+
import { convertSurfaceToVolumeLabelmap } from './convertSurfaceToLabelmap';
|
|
6
|
+
import { computeStackSegmentationFromVolume } from '../../convertVolumeToStackSegmentation';
|
|
7
|
+
export async function computeLabelmapData(segmentationId, options = {}) {
|
|
8
|
+
const segmentIndices = options.segmentIndices?.length
|
|
9
|
+
? options.segmentIndices
|
|
10
|
+
: getUniqueSegmentIndices(segmentationId);
|
|
11
|
+
let rawLabelmapData;
|
|
12
|
+
const segmentation = getSegmentation(segmentationId);
|
|
13
|
+
const representationData = segmentation.representationData;
|
|
14
|
+
try {
|
|
15
|
+
if (representationData.CONTOUR) {
|
|
16
|
+
rawLabelmapData = await computeLabelmapFromContourSegmentation(segmentationId, {
|
|
17
|
+
segmentIndices,
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
else if (representationData.SURFACE) {
|
|
22
|
+
rawLabelmapData = await computeLabelmapFromSurfaceSegmentation(segmentation.segmentationId, {
|
|
23
|
+
segmentIndices,
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.error(error);
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
if (!rawLabelmapData) {
|
|
33
|
+
throw new Error('Not enough data to convert to surface, currently only support converting volume labelmap to surface if available');
|
|
34
|
+
}
|
|
35
|
+
return rawLabelmapData;
|
|
36
|
+
}
|
|
37
|
+
async function computeLabelmapFromContourSegmentation(segmentationId, options = {}) {
|
|
38
|
+
const isVolume = options.viewport instanceof VolumeViewport ?? true;
|
|
39
|
+
if (isVolume && !options.viewport) {
|
|
40
|
+
throw new Error('Cannot compute labelmap from contour segmentation without providing the viewport');
|
|
41
|
+
}
|
|
42
|
+
const segmentIndices = options.segmentIndices?.length
|
|
43
|
+
? options.segmentIndices
|
|
44
|
+
: getUniqueSegmentIndices(segmentationId);
|
|
45
|
+
const segmentation = getSegmentation(segmentationId);
|
|
46
|
+
const representationData = segmentation.representationData.CONTOUR;
|
|
47
|
+
let result;
|
|
48
|
+
if (isVolume) {
|
|
49
|
+
result = await convertContourToVolumeLabelmap(representationData, {
|
|
50
|
+
segmentIndices,
|
|
51
|
+
segmentationRepresentationUID: options.segmentationRepresentationUID,
|
|
52
|
+
viewport: options.viewport,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
result = await convertContourToStackLabelmap(representationData, {
|
|
57
|
+
segmentIndices,
|
|
58
|
+
segmentationRepresentationUID: options.segmentationRepresentationUID,
|
|
59
|
+
viewport: options.viewport,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
async function computeLabelmapFromSurfaceSegmentation(segmentationId, options = {}) {
|
|
65
|
+
const isVolume = options.viewport instanceof VolumeViewport ?? true;
|
|
66
|
+
const segmentIndices = options.segmentIndices?.length
|
|
67
|
+
? options.segmentIndices
|
|
68
|
+
: getUniqueSegmentIndices(segmentationId);
|
|
69
|
+
const segmentation = getSegmentation(segmentationId);
|
|
70
|
+
const segmentsGeometryIds = new Map();
|
|
71
|
+
const representationData = segmentation.representationData.SURFACE;
|
|
72
|
+
representationData.geometryIds.forEach((geometryId, segmentIndex) => {
|
|
73
|
+
if (segmentIndices.includes(segmentIndex)) {
|
|
74
|
+
segmentsGeometryIds.set(segmentIndex, geometryId);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
if (isVolume && !options.viewport) {
|
|
78
|
+
throw new Error('Cannot compute labelmap from surface segmentation without providing the viewport');
|
|
79
|
+
}
|
|
80
|
+
let segmentationVolume;
|
|
81
|
+
if (isVolume) {
|
|
82
|
+
const defaultActor = options.viewport.getDefaultActor();
|
|
83
|
+
const { uid: volumeId } = defaultActor;
|
|
84
|
+
segmentationVolume =
|
|
85
|
+
await volumeLoader.createAndCacheDerivedSegmentationVolume(volumeId);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
const imageIds = options.viewport.getImageIds();
|
|
89
|
+
const volumeId = 'generatedSegmentationVolumeId';
|
|
90
|
+
const volumeProps = utilities.generateVolumePropsFromImageIds(imageIds, volumeId);
|
|
91
|
+
delete volumeProps.imageIds;
|
|
92
|
+
segmentationVolume = await volumeLoader.createLocalSegmentationVolume({
|
|
93
|
+
...volumeProps,
|
|
94
|
+
scalarData: volumeProps.scalarData,
|
|
95
|
+
referencedImageIds: imageIds,
|
|
96
|
+
}, volumeId);
|
|
97
|
+
}
|
|
98
|
+
const result = await convertSurfaceToVolumeLabelmap({ geometryIds: segmentsGeometryIds }, segmentationVolume);
|
|
99
|
+
if (isVolume) {
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
const stackData = (await computeStackSegmentationFromVolume({
|
|
103
|
+
volumeId: segmentationVolume.volumeId,
|
|
104
|
+
}));
|
|
105
|
+
return stackData;
|
|
106
|
+
}
|
|
107
|
+
export { computeLabelmapFromContourSegmentation };
|
|
108
|
+
//# sourceMappingURL=labelmapComputationStrategies.js.map
|
package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labelmapComputationStrategies.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,YAAY,EACZ,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK1D,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAQ5F,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,cAAsB,EACtB,UAAoC,EAAE;IAEtC,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,MAAM;QACnD,CAAC,CAAC,OAAO,CAAC,cAAc;QACxB,CAAC,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAE5C,IAAI,eAAgC,CAAC;IACrC,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IACrD,MAAM,kBAAkB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C,kBAAkB;YAChB,MAAM,YAAY,CAAC,uCAAuC,CAAC,QAAQ,CAAC,CAAC;KACxE;SAAM;QAKL,MAAM,QAAQ,GAAI,OAAO,CAAC,QAAiC,CAAC,WAAW,EAAE,CAAC;QAC1E,MAAM,QAAQ,GAAG,+BAA+B,CAAC;QACjD,MAAM,WAAW,GAAG,SAAS,CAAC,+BAA+B,CAC3D,QAAQ,EACR,QAAQ,CACT,CAAC;QAIF,OAAO,WAAW,CAAC,QAAQ,CAAC;QAE5B,kBAAkB,GAAG,MAAM,YAAY,CAAC,6BAA6B,CACnE;YACE,GAAG,WAAW;YACd,UAAU,EAAE,WAAW,CAAC,UAAiC;YACzD,kBAAkB,EAAE,QAAQ;SAC7B,EACD,QAAQ,CACT,CAAC;KACH;IAED,MAAM,MAAM,GAAG,MAAM,8BAA8B,CACjD,EAAE,WAAW,EAAE,mBAAmB,EAAE,EACpC,kBAAkB,CACnB,CAAC;IAEF,IAAI,QAAQ,EAAE;QACZ,OAAO,MAAM,CAAC;KACf;IAGD,MAAM,SAAS,GAAG,CAAC,MAAM,kCAAkC,CAAC;QAC1D,QAAQ,EAAE,kBAAkB,CAAC,QAAQ;KACtC,CAAC,CAAkC,CAAC;IAErC,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,OAAO,EAAE,sCAAsC,EAAE,CAAC"}
|
package/dist/esm/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SegmentationRepresentations } from '../../../../enums';
|
|
2
|
+
import { computeAndAddRepresentation } from '../computeAndAddRepresentation';
|
|
3
|
+
import { computeSurfaceData } from './surfaceComputationStrategies';
|
|
4
|
+
import { updateSurfaceData } from './updateSurfaceData';
|
|
5
|
+
export function computeAndAddSurfaceRepresentation(segmentationId, options = {}) {
|
|
6
|
+
return computeAndAddRepresentation(segmentationId, SegmentationRepresentations.Surface, () => computeSurfaceData(segmentationId, options), () => updateSurfaceData(segmentationId));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=computeAndAddSurfaceRepresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeAndAddSurfaceRepresentation.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Surface/computeAndAddSurfaceRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAWxD,MAAM,UAAU,kCAAkC,CAChD,cAAsB,EACtB,UAAoC,EAAE;IAEtC,OAAO,2BAA2B,CAChC,cAAc,EACd,2BAA2B,CAAC,OAAO,EACnC,GAAG,EAAE,CAAC,kBAAkB,CAAC,cAAc,EAAE,OAAO,CAAC,EACjD,GAAG,EAAE,CAAC,iBAAiB,CAAC,cAAc,CAAC,CACxC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Enums, eventTarget, triggerEvent } from '@cornerstonejs/core';
|
|
2
|
+
import { getWebWorkerManager } from '@cornerstonejs/core';
|
|
3
|
+
import { getAnnotation } from '../../../annotation/annotationState';
|
|
4
|
+
import { WorkerTypes } from '../../../../enums';
|
|
5
|
+
const workerManager = getWebWorkerManager();
|
|
6
|
+
const triggerWorkerProgress = (eventTarget, progress) => {
|
|
7
|
+
triggerEvent(eventTarget, Enums.Events.WEB_WORKER_PROGRESS, {
|
|
8
|
+
progress,
|
|
9
|
+
type: WorkerTypes.POLYSEG_CONTOUR_TO_SURFACE,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export async function convertContourToSurface(contourRepresentationData, segmentIndex) {
|
|
13
|
+
const { annotationUIDsMap } = contourRepresentationData;
|
|
14
|
+
const polylines = [];
|
|
15
|
+
const numPointsArray = [];
|
|
16
|
+
const annotationUIDs = annotationUIDsMap.get(segmentIndex);
|
|
17
|
+
for (const annotationUID of annotationUIDs) {
|
|
18
|
+
const annotation = getAnnotation(annotationUID);
|
|
19
|
+
const { polyline } = annotation.data.contour;
|
|
20
|
+
numPointsArray.push(polyline.length);
|
|
21
|
+
polyline.forEach((polyline) => polylines.push(...polyline));
|
|
22
|
+
}
|
|
23
|
+
triggerWorkerProgress(eventTarget, 0);
|
|
24
|
+
const results = await workerManager.executeTask('polySeg', 'convertContourToSurface', {
|
|
25
|
+
polylines,
|
|
26
|
+
numPointsArray,
|
|
27
|
+
}, {
|
|
28
|
+
callbacks: [
|
|
29
|
+
(progress) => {
|
|
30
|
+
triggerWorkerProgress(eventTarget, progress);
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
});
|
|
34
|
+
triggerWorkerProgress(eventTarget, 100);
|
|
35
|
+
return results;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=convertContourToSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertContourToSurface.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAS,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;AAE5C,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,QAAQ,EAAE,EAAE;IACtD,YAAY,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE;QAC1D,QAAQ;QACR,IAAI,EAAE,WAAW,CAAC,0BAA0B;KAC7C,CAAC,CAAC;AACL,CAAC,CAAC;AASF,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,yBAAkD,EAClD,YAAoB;IAEpB,MAAM,EAAE,iBAAiB,EAAE,GAAG,yBAAyB,CAAC;IAGxD,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,cAAc,GAAG,EAAE,CAAC;IAC1B,MAAM,cAAc,GAAG,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE3D,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE;QAC1C,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;QAChD,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;QAC7C,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACrC,QAAQ,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;KAC7D;IAED,qBAAqB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAEtC,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,WAAW,CAC7C,SAAS,EACT,yBAAyB,EACzB;QACE,SAAS;QACT,cAAc;KACf,EACD;QACE,SAAS,EAAE;YACT,CAAC,QAAQ,EAAE,EAAE;gBACX,qBAAqB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YAC/C,CAAC;SACF;KACF,CACF,CAAC;IAEF,qBAAqB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { cache, eventTarget, triggerEvent, Enums, } from '@cornerstonejs/core';
|
|
2
|
+
import { getWebWorkerManager } from '@cornerstonejs/core';
|
|
3
|
+
import { computeVolumeSegmentationFromStack } from '../../convertStackToVolumeSegmentation';
|
|
4
|
+
import { WorkerTypes } from '../../../../enums';
|
|
5
|
+
const workerManager = getWebWorkerManager();
|
|
6
|
+
const triggerWorkerProgress = (eventTarget, progress) => {
|
|
7
|
+
triggerEvent(eventTarget, Enums.Events.WEB_WORKER_PROGRESS, {
|
|
8
|
+
progress,
|
|
9
|
+
type: WorkerTypes.POLYSEG_LABELMAP_TO_SURFACE,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export async function convertLabelmapToSurface(labelmapRepresentationData, segmentIndex, isVolume = true) {
|
|
13
|
+
let volumeId;
|
|
14
|
+
if (isVolume) {
|
|
15
|
+
volumeId = labelmapRepresentationData
|
|
16
|
+
.volumeId;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const { imageIdReferenceMap } = labelmapRepresentationData;
|
|
20
|
+
({ volumeId } = await computeVolumeSegmentationFromStack({
|
|
21
|
+
imageIdReferenceMap,
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
const volume = cache.getVolume(volumeId);
|
|
25
|
+
const scalarData = volume.getScalarData();
|
|
26
|
+
const { dimensions, spacing, origin, direction } = volume;
|
|
27
|
+
triggerWorkerProgress(eventTarget, 0);
|
|
28
|
+
const results = await workerManager.executeTask('polySeg', 'convertLabelmapToSurface', {
|
|
29
|
+
scalarData,
|
|
30
|
+
dimensions,
|
|
31
|
+
spacing,
|
|
32
|
+
origin,
|
|
33
|
+
direction,
|
|
34
|
+
segmentIndex,
|
|
35
|
+
}, {
|
|
36
|
+
callbacks: [
|
|
37
|
+
(progress) => {
|
|
38
|
+
triggerWorkerProgress(eventTarget, progress);
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
triggerWorkerProgress(eventTarget, 100);
|
|
43
|
+
return results;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=convertLabelmapToSurface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertLabelmapToSurface.js","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AAM,aAAa,CAAC,WAAW,CAC7C,SAAS,EACT,0BAA0B,EAC1B;QACE,UAAU;QACV,UAAU;QACV,OAAO;QACP,MAAM;QACN,SAAS;QACT,YAAY;KACb,EACD;QACE,SAAS,EAAE;YACT,CAAC,QAAQ,EAAE,EAAE;gBACX,qBAAqB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YAC/C,CAAC;SACF;KACF,CACF,CAAC;IAEF,qBAAqB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Enums, geometryLoader } from '@cornerstonejs/core';
|
|
2
|
+
import { getColorForSegmentIndex } from '../../config/segmentationColor';
|
|
3
|
+
import { findSegmentationRepresentationByUID, getSegmentation, } from '../../segmentationState';
|
|
4
|
+
export async function createAndCacheSurfacesFromRaw(segmentationId, rawSurfacesData, options = {}) {
|
|
5
|
+
let segmentationRepresentation, toolGroupId;
|
|
6
|
+
if (options.segmentationRepresentationUID) {
|
|
7
|
+
({ segmentationRepresentation, toolGroupId } =
|
|
8
|
+
findSegmentationRepresentationByUID(options.segmentationRepresentationUID));
|
|
9
|
+
}
|
|
10
|
+
const segmentation = getSegmentation(segmentationId);
|
|
11
|
+
const geometryIds = new Map();
|
|
12
|
+
const promises = Object.keys(rawSurfacesData).map(async (index) => {
|
|
13
|
+
const rawSurfaceData = rawSurfacesData[index];
|
|
14
|
+
const segmentIndex = rawSurfaceData.segmentIndex;
|
|
15
|
+
const color = segmentationRepresentation;
|
|
16
|
+
getColorForSegmentIndex(toolGroupId, segmentationRepresentation.segmentationRepresentationUID, segmentIndex).slice(0, 3);
|
|
17
|
+
if (!color) {
|
|
18
|
+
throw new Error('No color found for segment index, unable to create surface');
|
|
19
|
+
}
|
|
20
|
+
const closedSurface = {
|
|
21
|
+
id: `segmentation_${segmentation.segmentationId}_surface_${segmentIndex}`,
|
|
22
|
+
color,
|
|
23
|
+
frameOfReferenceUID: 'test-frameOfReferenceUID',
|
|
24
|
+
data: {
|
|
25
|
+
points: rawSurfaceData.data.points,
|
|
26
|
+
polys: rawSurfaceData.data.polys,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
const geometryId = closedSurface.id;
|
|
30
|
+
geometryIds.set(segmentIndex, geometryId);
|
|
31
|
+
return geometryLoader.createAndCacheGeometry(geometryId, {
|
|
32
|
+
type: Enums.GeometryType.SURFACE,
|
|
33
|
+
geometryData: closedSurface,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
await Promise.all(promises);
|
|
37
|
+
return {
|
|
38
|
+
geometryIds,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=createAndCacheSurfacesFromRaw.js.map
|
package/dist/esm/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAndCacheSurfacesFromRaw.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Surface/createAndCacheSurfacesFromRaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAS,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EACL,mCAAmC,EACnC,eAAe,GAChB,MAAM,yBAAyB,CAAC;AAcjC,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,cAAsB,EACtB,eAAgC,EAChC,UAAoC,EAAE;IAGtC,IAAI,0BAA+B,EAAE,WAAgB,CAAC;IACtD,IAAI,OAAO,CAAC,6BAA6B,EAAE;QACzC,CAAC,EAAE,0BAA0B,EAAE,WAAW,EAAE;YAC1C,mCAAmC,CACjC,OAAO,CAAC,6BAA6B,CACtC,CAAC,CAAC;KACN;IAED,MA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{ getUniqueSegmentIndices } from '../../../../utilities/segmentation';
|
|
2
|
+
import { getSegmentation } from '../../segmentationState';
|
|
3
|
+
import { convertContourToSurface } from './convertContourToSurface';
|
|
4
|
+
import { createAndCacheSurfacesFromRaw } from './createAndCacheSurfacesFromRaw';
|
|
5
|
+
import { isVolumeSegmentation } from '../../../../tools/segmentation/strategies/utils/stackVolumeCheck';
|
|
6
|
+
import { convertLabelmapToSurface } from './convertLabelmapToSurface';
|
|
7
|
+
export async function computeSurfaceData(segmentationId, options = {}) {
|
|
8
|
+
const segmentIndices = options.segmentIndices?.length
|
|
9
|
+
? options.segmentIndices
|
|
10
|
+
: getUniqueSegmentIndices(segmentationId);
|
|
11
|
+
let rawSurfacesData;
|
|
12
|
+
const segmentation = getSegmentation(segmentationId);
|
|
13
|
+
const representationData = segmentation.representationData;
|
|
14
|
+
try {
|
|
15
|
+
if (representationData.CONTOUR) {
|
|
16
|
+
rawSurfacesData = await computeSurfaceFromContourSegmentation(segmentationId, {
|
|
17
|
+
segmentIndices,
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
else if (representationData.LABELMAP) {
|
|
22
|
+
rawSurfacesData = await computeSurfaceFromLabelmapSegmentation(segmentation.segmentationId, {
|
|
23
|
+
segmentIndices,
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.error(error);
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
if (!rawSurfacesData) {
|
|
33
|
+
throw new Error('Not enough data to convert to surface, currently only support converting volume labelmap to surface if available');
|
|
34
|
+
}
|
|
35
|
+
const surfacesData = await createAndCacheSurfacesFromRaw(segmentationId, rawSurfacesData, options);
|
|
36
|
+
return surfacesData;
|
|
37
|
+
}
|
|
38
|
+
async function computeSurfaceFromLabelmapSegmentation(segmentationId, options = {}) {
|
|
39
|
+
const segmentation = getSegmentation(segmentationId);
|
|
40
|
+
if (!segmentation?.representationData?.LABELMAP) {
|
|
41
|
+
console.warn('Only support surface update from labelmaps');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const isVolume = isVolumeSegmentation(segmentation.representationData.LABELMAP);
|
|
45
|
+
const labelmapRepresentationData = segmentation.representationData.LABELMAP;
|
|
46
|
+
const segmentIndices = options.segmentIndices || getUniqueSegmentIndices(segmentationId);
|
|
47
|
+
const promises = segmentIndices.map((index) => {
|
|
48
|
+
const surface = convertLabelmapToSurface(labelmapRepresentationData, index, isVolume);
|
|
49
|
+
return surface;
|
|
50
|
+
});
|
|
51
|
+
const surfaces = await Promise.allSettled(promises);
|
|
52
|
+
const errors = surfaces.filter((p) => p.status === 'rejected');
|
|
53
|
+
if (errors.length > 0) {
|
|
54
|
+
console.error(errors);
|
|
55
|
+
throw new Error('Failed to convert labelmap to surface');
|
|
56
|
+
}
|
|
57
|
+
const rawSurfacesData = surfaces
|
|
58
|
+
.map((surface, index) => {
|
|
59
|
+
if (surface.status === 'fulfilled') {
|
|
60
|
+
return { segmentIndex: segmentIndices[index], data: surface.value };
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
.filter(Boolean);
|
|
64
|
+
return rawSurfacesData;
|
|
65
|
+
}
|
|
66
|
+
async function computeSurfaceFromContourSegmentation(segmentationId, options = {}) {
|
|
67
|
+
const segmentation = getSegmentation(segmentationId);
|
|
68
|
+
const contourRepresentationData = segmentation.representationData.CONTOUR;
|
|
69
|
+
const segmentIndices = options.segmentIndices || getUniqueSegmentIndices(segmentationId);
|
|
70
|
+
const promises = segmentIndices.map(async (index) => {
|
|
71
|
+
const surface = await convertContourToSurface(contourRepresentationData, index);
|
|
72
|
+
return { segmentIndex: index, data: surface };
|
|
73
|
+
});
|
|
74
|
+
const surfaces = await Promise.all(promises);
|
|
75
|
+
return surfaces;
|
|
76
|
+
}
|
|
77
|
+
export { computeSurfaceFromContourSegmentation, computeSurfaceFromLabelmapSegmentation, };
|
|
78
|
+
//# sourceMappingURL=surfaceComputationStrategies.js.map
|
package/dist/esm/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surfaceComputationStrategies.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Surface/surfaceComputationStrategies.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAMhF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AActE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,cAAsB,EACtB,UAAoC,EAAE;IAEtC,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,MAAM;QACnD,CAAC,CAAC,OAAO,CAAC,cAAc;QACxB,CAAC,CAAC,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAE5C,IAAI,eAAgC,CAAC;IACrC,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IACrD,MAAM,kBAAkB,GAAG,YAAY,CAAC,kBAAkB,CAAC;IAE3D,IAAI;QACF,IAAI,kBAAkB,CAAC,OAAO,EAAE;YAC9B,eAAe,GAAG,MAAM,qCAAqC,CAC3D,cAAc,EACd;gBACE,cAAc;gBACd,GAAG,OAAO;aACX,CACF,CAAC;SACH;aAAM,IAAI,kBAAkB,CAAC,QAAoC,EAAE;YAElE,eAAe,GAAG,MAAM,sCAAsC,CAC5D,YAAY,CAAC,cAAc,EAC3B;gBACE,cAAc;gBACd,GAAG,OAAO;aACX,CACF,CAAC;SACH;KACF;IAAC,OAAO,KAAK,E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,MAAM,CAAC,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;KAC1D;IAED,MAAM,eAAe,GAAG,QAAQ;SAC7B,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACtB,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,EAAE;YAClC,OAAO,EAAE,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;SACrE;IACH,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,eAAe,CAAC;AACzB,CAAC;AAQD,KAAK,UAAU,qCAAqC,CAClD,cAAsB,EACtB,UAAoC,EAAE;IAEtC,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,MAAM,yBAAyB,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC;IAE1E,MAAM,cAAc,GAClB,OAAO,CAAC,cAAc,IAAI,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAEpE,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAClD,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAC3C,yBAAoD,EACpD,KAAK,CACN,CAAC;QAEF,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE7C,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,OAAO,EACL,qCAAqC,EACrC,sCAAsC,GACvC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { cache } from '@cornerstonejs/core';
|
|
2
|
+
import { getUniqueSegmentIndices } from '../../../../utilities/segmentation';
|
|
3
|
+
import { getSegmentation, getSegmentationRepresentations, getToolGroupIdsWithSegmentation, } from '../../segmentationState';
|
|
4
|
+
import { triggerSegmentationModified } from '../../triggerSegmentationEvents';
|
|
5
|
+
import { SegmentationRepresentations } from '../../../../enums';
|
|
6
|
+
import { computeSurfaceFromLabelmapSegmentation } from './surfaceComputationStrategies';
|
|
7
|
+
import { createAndCacheSurfacesFromRaw } from './createAndCacheSurfacesFromRaw';
|
|
8
|
+
export async function updateSurfaceData(segmentationId) {
|
|
9
|
+
const surfacesObj = await computeSurfaceFromLabelmapSegmentation(segmentationId);
|
|
10
|
+
if (!surfacesObj) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const segmentation = getSegmentation(segmentationId);
|
|
14
|
+
const indices = getUniqueSegmentIndices(segmentationId);
|
|
15
|
+
if (!indices.length) {
|
|
16
|
+
const geometryIds = segmentation.representationData.SURFACE.geometryIds;
|
|
17
|
+
geometryIds.forEach((geometryId) => {
|
|
18
|
+
const geometry = cache.getGeometry(geometryId);
|
|
19
|
+
const surface = geometry.data;
|
|
20
|
+
surface.setPoints([]);
|
|
21
|
+
surface.setPolys([]);
|
|
22
|
+
});
|
|
23
|
+
triggerSegmentationModified(segmentationId);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const promises = surfacesObj.map(({ data, segmentIndex }) => {
|
|
27
|
+
const geometryId = `segmentation_${segmentationId}_surface_${segmentIndex}`;
|
|
28
|
+
const geometry = cache.getGeometry(geometryId);
|
|
29
|
+
if (!geometry) {
|
|
30
|
+
const toolGroupIds = getToolGroupIdsWithSegmentation(segmentationId);
|
|
31
|
+
return toolGroupIds.map((toolGroupId) => {
|
|
32
|
+
const segmentationRepresentations = getSegmentationRepresentations(toolGroupId);
|
|
33
|
+
return segmentationRepresentations.map((segmentationRepresentation) => {
|
|
34
|
+
if (segmentationRepresentation.type !==
|
|
35
|
+
SegmentationRepresentations.Surface) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
segmentation.representationData.SURFACE.geometryIds.set(segmentIndex, geometryId);
|
|
39
|
+
return createAndCacheSurfacesFromRaw(segmentationId, [{ segmentIndex, data }], {
|
|
40
|
+
segmentationRepresentationUID: segmentationRepresentation.segmentationRepresentationUID,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else if (indices.includes(segmentIndex)) {
|
|
46
|
+
const surface = geometry.data;
|
|
47
|
+
surface.setPoints(data.points);
|
|
48
|
+
surface.setPolys(data.polys);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const surface = geometry.data;
|
|
52
|
+
surface.setPoints([]);
|
|
53
|
+
surface.setPolys([]);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
await Promise.all(promises);
|
|
57
|
+
triggerSegmentationModified(segmentationId);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=updateSurfaceData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateSurfaceData.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Surface/updateSurfaceData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACL,eAAe,EACf,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAE9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,sCAAsC,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAEhF,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,cAAc;IACpD,MAAM,WAAW,GAAG,MAAM,sCAAsC,CAC9D,cAAc,CACf,CAAC;IAEF,IAAI,CAAC,WAAW,EA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C,WAAW,CAAC,GAAG,CACrD,YAAY,EACZ,UAAU,CACX,CAAC;oBAEF,OAAO,6BAA6B,CAClC,cAAc,EACd,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,EACxB;wBACE,6BAA6B,EAC3B,0BAA0B,CAAC,6BAA6B;qBAC3D,CACF,CAAC;gBACJ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;aAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;YAGzC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAsB,CAAC;YAChD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9B;aAAM;YACL,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAsB,CAAC;YAChD,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;YACtB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;SACtB;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAE5B,2BAA2B,CAAC,cAAc,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SegmentationRepresentations } from '../../../enums';
|
|
2
|
+
import { validateLabelmap } from '../../../tools/displayTools/Labelmap';
|
|
3
|
+
import { findSegmentationRepresentationByUID, getSegmentation, } from '../segmentationState';
|
|
4
|
+
const conversionPaths = new Map([
|
|
5
|
+
[
|
|
6
|
+
SegmentationRepresentations.Labelmap,
|
|
7
|
+
new Set([
|
|
8
|
+
SegmentationRepresentations.Surface,
|
|
9
|
+
SegmentationRepresentations.Contour,
|
|
10
|
+
]),
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
SegmentationRepresentations.Contour,
|
|
14
|
+
new Set([
|
|
15
|
+
SegmentationRepresentations.Labelmap,
|
|
16
|
+
SegmentationRepresentations.Surface,
|
|
17
|
+
]),
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
SegmentationRepresentations.Surface,
|
|
21
|
+
new Set([SegmentationRepresentations.Labelmap]),
|
|
22
|
+
],
|
|
23
|
+
]);
|
|
24
|
+
function canComputeRequestedRepresentation(segmentationRepresentationUID) {
|
|
25
|
+
const representationInfo = findSegmentationRepresentationByUID(segmentationRepresentationUID);
|
|
26
|
+
if (!representationInfo?.segmentationRepresentation) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const { segmentationRepresentation } = representationInfo;
|
|
30
|
+
const { type: representationType, polySeg } = segmentationRepresentation;
|
|
31
|
+
if (!polySeg || !polySeg.enabled) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const { representationData } = getSegmentation(segmentationRepresentation.segmentationId);
|
|
35
|
+
const existingRepresentationTypes = getExistingRepresentationTypes(representationData);
|
|
36
|
+
return existingRepresentationTypes.some((existingRepresentationType) => canConvertFromTo(existingRepresentationType, representationType));
|
|
37
|
+
}
|
|
38
|
+
function getExistingRepresentationTypes(representationData) {
|
|
39
|
+
const supportedTypes = [];
|
|
40
|
+
Object.keys(representationData).forEach((representationType) => {
|
|
41
|
+
const representationTypeData = representationData[representationType];
|
|
42
|
+
let validateFn;
|
|
43
|
+
switch (representationType) {
|
|
44
|
+
case SegmentationRepresentations.Labelmap:
|
|
45
|
+
validateFn = validateLabelmap;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (validateFn) {
|
|
49
|
+
try {
|
|
50
|
+
validateFn(representationTypeData);
|
|
51
|
+
supportedTypes.push(representationType);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.warn(`Validation failed for labelmap of type ${representationType}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
supportedTypes.push(representationType);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
return supportedTypes;
|
|
62
|
+
}
|
|
63
|
+
async function canConvertFromTo(fromRepresentationType, toRepresentationType) {
|
|
64
|
+
return (conversionPaths.get(fromRepresentationType)?.has(toRepresentationType) ||
|
|
65
|
+
false);
|
|
66
|
+
}
|
|
67
|
+
export { canComputeRequestedRepresentation };
|
|
68
|
+
//# sourceMappingURL=canComputeRequestedRepresentation.js.map
|
package/dist/esm/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canComputeRequestedRepresentation.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/polySeg/canComputeRequestedRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EACL,mCAAmC,EACnC,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,eAAe,GAAG,IAAI,GAAG,CAG7B;IACA;QACE,2BAA2B,CAAC,QAAQ;QACpC,IAAI,GAAG,CAAC;YACN,2BAA2B,CAAC,OAAO;YACnC,2BAA2B,CAAC,OAAO;SACpC,CAAC;KACH;IACD;QACE,2BAA2B,CAAC,OAAO;QACnC,IAAI,GAAG,CAAC;YACN,2BAA2B,CAAC,QAAQ;YACpC,2BAA2B,CAAC,OAAO;SACpC,CAAC;KACH;IACD;QACE,2BAA2B,CAAC,OAAO;QACnC,IAAI,GAAG,CAAC,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;KAChD;CACF,CAAC,CAAC;AAaH,SAAS,iCAAiC,CACxC,6BAAqC;IAErC,MAAM,kBAAkB,GAAG,mCAAmC,CAC5D,6BAA6B,CAC9B,CAAC;IAEF,IAAI,CAAC,kBAAkB,EAAE,0BAA0B,EAAE;QACnD,OAAO,KAAK,CAAC;KACd;IAED,MAAM,EAAE,0BAA0B,EAAE,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BAAoB;IAC1E,OAAO,CACL,eAAe,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,GAAG,CAAC,oBAAoB,CAAC;QACtE,KAAK,CACN,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,iCAAiC,EAAE,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { eventTarget } from '@cornerstonejs/core';
|
|
2
|
+
import { Events } from '../../../enums';
|
|
3
|
+
import addRepresentationData from '../addRepresentationData';
|
|
4
|
+
import { triggerSegmentationModified } from '../triggerSegmentationEvents';
|
|
5
|
+
import { debounce } from '../../../utilities';
|
|
6
|
+
import { registerPolySegWorker } from './registerPolySegWorker';
|
|
7
|
+
const computedRepresentations = new Map();
|
|
8
|
+
async function computeAndAddRepresentation(segmentationId, representationType, computeFunction, updateFunction) {
|
|
9
|
+
registerPolySegWorker();
|
|
10
|
+
const data = await computeFunction();
|
|
11
|
+
addRepresentationData({
|
|
12
|
+
segmentationId,
|
|
13
|
+
type: representationType,
|
|
14
|
+
data: { ...data },
|
|
15
|
+
});
|
|
16
|
+
if (!computedRepresentations.has(segmentationId)) {
|
|
17
|
+
computedRepresentations.set(segmentationId, []);
|
|
18
|
+
}
|
|
19
|
+
const representations = computedRepresentations.get(segmentationId);
|
|
20
|
+
if (!representations.includes(representationType)) {
|
|
21
|
+
representations.push(representationType);
|
|
22
|
+
}
|
|
23
|
+
subscribeToSegmentationChanges(updateFunction);
|
|
24
|
+
triggerSegmentationModified(segmentationId);
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
function subscribeToSegmentationChanges(updateFunction) {
|
|
28
|
+
const debouncedUpdateFunction = (event) => {
|
|
29
|
+
_debouncedSegmentationModified(event, updateFunction);
|
|
30
|
+
};
|
|
31
|
+
updateFunction._debouncedUpdateFunction = debouncedUpdateFunction;
|
|
32
|
+
eventTarget.removeEventListener(Events.SEGMENTATION_DATA_MODIFIED, updateFunction._debouncedUpdateFunction);
|
|
33
|
+
eventTarget.addEventListener(Events.SEGMENTATION_DATA_MODIFIED, updateFunction._debouncedUpdateFunction);
|
|
34
|
+
}
|
|
35
|
+
const _debouncedSegmentationModified = debounce((event, updateFunction) => {
|
|
36
|
+
const segmentationId = event.detail.segmentationId;
|
|
37
|
+
const representations = computedRepresentations.get(segmentationId);
|
|
38
|
+
if (!representations || !representations.length) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
updateFunction(segmentationId);
|
|
42
|
+
if (representations.length) {
|
|
43
|
+
triggerSegmentationModified(segmentationId);
|
|
44
|
+
}
|
|
45
|
+
}, 300);
|
|
46
|
+
export { computeAndAddRepresentation };
|
|
47
|
+
//# sourceMappingURL=computeAndAddRepresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeAndAddRepresentation.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/polySeg/computeAndAddRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAA+B,MAAM,gBAAgB,CAAC;AACrE,OAAO,qBAAqB,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAGpC,CAAC;AAYJ,KAAK,UAAU,2BAA2B,CACxC,cAAsB,EACtB,kBAA+C,EAC/C,eAAiC,EACjC,cAA2B;IAG3B,qBAAqB,EAAE,CAAC;IAGxB,MAAM,IAAI,GAAG,MAAM,eAAe,EAAE,CAAC;IAGrC,qBAAqB,CAAC;QACpB,cAAc;QACd,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE;KAClB,CAAC,CAAC;IAGH,IAAI,CA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,GAAG,CAAC,CAAC;AAER,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { computeAndAddSurfaceRepresentation } from './Surface/computeAndAddSurfaceRepresentation';
|
|
2
|
+
import { computeAndAddLabelmapRepresentation } from './Labelmap/computeAndAddLabelmapRepresentation';
|
|
3
|
+
import { computeAndAddContourRepresentation } from './Contour/computeAndAddContourRepresentation';
|
|
4
|
+
import { canComputeRequestedRepresentation } from './canComputeRequestedRepresentation';
|
|
5
|
+
export { canComputeRequestedRepresentation, computeAndAddSurfaceRepresentation, computeAndAddLabelmapRepresentation, computeAndAddContourRepresentation, };
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/polySeg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,mCAAmC,EAAE,MAAM,gDAAgD,CAAC;AACrG,OAAO,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,iCAAiC,EAAE,MAAM,qCAAqC,CAAC;AAExF,OAAO,EACL,iCAAiC,EAEjC,kCAAkC,EAClC,mCAAmC,EACnC,kCAAkC,GACnC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getWebWorkerManager } from '@cornerstonejs/core';
|
|
2
|
+
let registered = false;
|
|
3
|
+
export function registerPolySegWorker() {
|
|
4
|
+
if (registered) {
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
registered = true;
|
|
8
|
+
const workerFn = () => {
|
|
9
|
+
return new Worker(new URL('../../../workers/polySegConverters', import.meta.url), {
|
|
10
|
+
name: 'polySeg',
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
const workerManager = getWebWorkerManager();
|
|
14
|
+
const options = {
|
|
15
|
+
maxWorkerInstances: 1,
|
|
16
|
+
autoTerminateOnIdle: {
|
|
17
|
+
enabled: true,
|
|
18
|
+
idleTimeThreshold: 2000,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
workerManager.registerWorker('polySeg', workerFn, options);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=registerPolySegWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerPolySegWorker.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/polySeg/registerPolySegWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D,IAAI,UAAU,GAAG,KAAK,CAAC;AAEvB,MAAM,UAAU,qBAAqB;IACnC,IAAI,UAAU,EAAE;QACd,OAAO;KACR;IAED,UAAU,GAAG,IAAI,CAAC;IAElB,MAAM,QAAQ,GAAG,GAAG,EAAE;QAEpB,OAAO,IAAI,MAAM,CAEf,IAAI,GAAG,CAAC,oCAAoC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAC9D;YACE,IAAI,EAAE,SAAS;SAChB,CACF,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAC;IAE5C,MAAM,OAAO,GAAG;QACd,kBAAkB,EAAE,CAAC;QACrB,mBAAmB,EAAE;YACnB,OAAO,EAAE,IAAI;YACb,iBAAiB,EAAE,IAAI;SACxB;KACF,CAAC;IAEF,aAAa,CAAC,cAAc,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -3,6 +3,10 @@ import { getSegmentation, getToolGroupIdsWithSegmentation, } from './segmentatio
|
|
|
3
3
|
import { triggerSegmentationModified } from './triggerSegmentationEvents';
|
|
4
4
|
function setActiveSegmentIndex(segmentationId, segmentIndex) {
|
|
5
5
|
const segmentation = getSegmentation(segmentationId);
|
|
6
|
+
if (typeof segmentIndex === 'string') {
|
|
7
|
+
console.warn('segmentIndex is a string, converting to number');
|
|
8
|
+
segmentIndex = Number(segmentIndex);
|
|
9
|
+
}
|
|
6
10
|
if (segmentation?.activeSegmentIndex !== segmentIndex) {
|
|
7
11
|
segmentation.activeSegmentIndex = segmentIndex;
|
|
8
12
|
triggerSegmentationModified(segmentationId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentIndex.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,eAAe,EACf,+BAA+B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAY1E,SAAS,qBAAqB,CAC5B,cAAsB,EACtB,YAAoB;IAEpB,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,IAAI,YAAY,EAAE,kBAAkB,KAAK,YAAY,EAAE;QACrD,YAAY,CAAC,kBAAkB,GAAG,YAAY,CAAC;QAE/C,2BAA2B,CAAC,cAAc,CAAC,CAAC;KAC7C;IAID,MAAM,UAAU,GAAG,+BAA+B,CAAC,cAAc,CAAC,CAAC;IACnE,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QACjC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC;AAOD,SAAS,qBAAqB,CAAC,cAAsB;IACnD,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,IAAI,YAAY,EAAE;QAChB,OAAO,YAAY,CAAC,kBAAkB,CAAC;KACxC;AACH,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"segmentIndex.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/segmentIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EACL,eAAe,EACf,+BAA+B,GAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAY1E,SAAS,qBAAqB,CAC5B,cAAsB,EACtB,YAAoB;IAEpB,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE;QACpC,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;QAC/D,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;KACrC;IAED,IAAI,YAAY,EAAE,kBAAkB,KAAK,YAAY,EAAE;QACrD,YAAY,CAAC,kBAAkB,GAAG,YAAY,CAAC;QAE/C,2BAA2B,CAAC,cAAc,CAAC,CAAC;KAC7C;IAID,MAAM,UAAU,GAAG,+BAA+B,CAAC,cAAc,CAAC,CAAC;IACnE,UAAU,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QACjC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC;AAOD,SAAS,qBAAqB,CAAC,cAAsB;IACnD,MAAM,YAAY,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAErD,IAAI,YAAY,EAAE;QAChB,OAAO,YAAY,CAAC,kBAAkB,CAAC;KACxC;AACH,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAC"}
|