@cornerstonejs/tools 1.53.0 → 1.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentationVisibility.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"segmentationVisibility.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/config/segmentationVisibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,iBAAiB,MAAM,yDAAyD,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,yDAAyD,CAAC;AAEzG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AAYzF,SAAS,yBAAyB,CAChC,WAAmB,EACnB,6BAAqC,EACrC,UAAmB;IAEnB,MAAM,oCAAoC,GACxC,8BAA8B,CAAC,WAAW,CAAC,CAAC;IAE9C,I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C,YAAY,CAAC,CAAC;AAC7D,CAAC;AAED,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GACrB,CAAC"}
|
|
@@ -1,47 +1,62 @@
|
|
|
1
|
-
import { volumeLoader, utilities as csUtils, eventTarget, } from '@cornerstonejs/core';
|
|
1
|
+
import { volumeLoader, utilities as csUtils, eventTarget, cache, } from '@cornerstonejs/core';
|
|
2
2
|
import { Events, SegmentationRepresentations } from '../../enums';
|
|
3
|
-
import addSegmentations from './addSegmentations';
|
|
4
3
|
import addSegmentationRepresentations from './addSegmentationRepresentations';
|
|
5
4
|
import { triggerSegmentationRender } from '../../utilities/segmentation';
|
|
6
|
-
import { getSegmentation
|
|
5
|
+
import { getSegmentation } from './segmentationState';
|
|
7
6
|
import { triggerSegmentationDataModified } from './triggerSegmentationEvents';
|
|
8
|
-
async function
|
|
9
|
-
const segmentation = getSegmentation(segmentationId);
|
|
10
|
-
const { toolGroupId } = options;
|
|
11
|
-
const data = segmentation.representationData
|
|
12
|
-
.LABELMAP;
|
|
13
|
-
const imageIdReferenceMap = data.imageIdReferenceMap;
|
|
7
|
+
async function computeVolumeSegmentationFromStack({ imageIdReferenceMap, options, }) {
|
|
14
8
|
const segmentationImageIds = Array.from(imageIdReferenceMap.values());
|
|
15
9
|
const additionalDetails = {
|
|
16
10
|
imageIdReferenceMap,
|
|
17
11
|
};
|
|
18
|
-
const volumeId = options?.volumeId;
|
|
12
|
+
const volumeId = options?.volumeId ?? csUtils.uuidv4();
|
|
19
13
|
await volumeLoader.createAndCacheVolumeFromImages(volumeId, segmentationImageIds, {
|
|
20
14
|
additionalDetails,
|
|
21
15
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
return { volumeId };
|
|
17
|
+
}
|
|
18
|
+
async function convertStackToVolumeSegmentation({ segmentationId, options, }) {
|
|
19
|
+
const segmentation = getSegmentation(segmentationId);
|
|
20
|
+
const data = segmentation.representationData
|
|
21
|
+
.LABELMAP;
|
|
22
|
+
const { volumeId } = await computeVolumeSegmentationFromStack({
|
|
23
|
+
imageIdReferenceMap: data.imageIdReferenceMap,
|
|
24
|
+
options,
|
|
25
|
+
});
|
|
26
|
+
await updateSegmentationState({
|
|
27
|
+
segmentationId,
|
|
28
|
+
toolGroupId: options.toolGroupId,
|
|
29
|
+
options,
|
|
30
|
+
volumeId,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async function updateSegmentationState({ segmentationId, toolGroupId, volumeId, options, }) {
|
|
34
|
+
const segmentation = getSegmentation(segmentationId);
|
|
35
|
+
if (options?.removeOriginal) {
|
|
36
|
+
const data = segmentation.representationData
|
|
37
|
+
.LABELMAP;
|
|
38
|
+
const imageIdReferenceMap = data.imageIdReferenceMap;
|
|
39
|
+
Array.from(imageIdReferenceMap.values()).forEach((imageId) => {
|
|
40
|
+
cache.removeImageLoadObject(imageId);
|
|
41
|
+
});
|
|
42
|
+
segmentation.representationData.LABELMAP = {
|
|
43
|
+
volumeId,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
segmentation.representationData.LABELMAP = {
|
|
48
|
+
...segmentation.representationData.LABELMAP,
|
|
49
|
+
volumeId,
|
|
50
|
+
};
|
|
25
51
|
}
|
|
26
|
-
await addSegmentations([
|
|
27
|
-
{
|
|
28
|
-
segmentationId: newSegmentationId,
|
|
29
|
-
representation: {
|
|
30
|
-
type: SegmentationRepresentations.Labelmap,
|
|
31
|
-
data: {
|
|
32
|
-
volumeId,
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
]);
|
|
37
52
|
await addSegmentationRepresentations(toolGroupId, [
|
|
38
53
|
{
|
|
39
|
-
segmentationId
|
|
54
|
+
segmentationId,
|
|
40
55
|
type: SegmentationRepresentations.Labelmap,
|
|
41
56
|
},
|
|
42
57
|
]);
|
|
43
58
|
triggerSegmentationRender(toolGroupId);
|
|
44
|
-
eventTarget.addEventListenerOnce(Events.SEGMENTATION_RENDERED, () => triggerSegmentationDataModified(
|
|
59
|
+
eventTarget.addEventListenerOnce(Events.SEGMENTATION_RENDERED, () => triggerSegmentationDataModified(segmentationId));
|
|
45
60
|
}
|
|
46
|
-
export { convertStackToVolumeSegmentation };
|
|
61
|
+
export { convertStackToVolumeSegmentation, computeVolumeSegmentationFromStack };
|
|
47
62
|
//# sourceMappingURL=convertStackToVolumeSegmentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertStackToVolumeSegmentation.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/convertStackToVolumeSegmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,IAAI,OAAO,EACpB,WAAW,
|
|
1
|
+
{"version":3,"file":"convertStackToVolumeSegmentation.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/convertStackToVolumeSegmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,IAAI,OAAO,EACpB,WAAW,EACX,KAAK,GACN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAE9E,KAAK,UAAU,kCAAkC,CAAC,EAChD,mBAAmB,EACnB,OAAO,GAMR;IACC,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAEtE,MAAM,iBAAiB,GAAG;QACxB,mBAAmB;KACpB,CAAC;IAEF,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,OAAO,CAAC,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CAAC,QAAQ;YAC3C,QAAQ;SACT,CAAC;KACH;IAED,MAAM,8BAA8B,CAAC,WAAW,EAAE;QAChD;YACE,cAAc;YACd,IAAI,EAAE,2BAA2B,CAAC,QAAQ;SAC3C;KACF,CAAC,CAAC;IAEH,yBAAyB,CAAC,WAAW,CAAC,CAAC;IAGvC,WAAW,CAAC,oBAAoB,CAAC,MAAM,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAClE,+BAA+B,CAAC,cAAc,CAAC,CAChD,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,CAAC"}
|
|
@@ -1,50 +1,74 @@
|
|
|
1
|
-
import { cache,
|
|
1
|
+
import { cache, eventTarget, getRenderingEngines, } from '@cornerstonejs/core';
|
|
2
2
|
import { Events, SegmentationRepresentations } from '../../enums';
|
|
3
|
-
import addSegmentations from './addSegmentations';
|
|
4
3
|
import addSegmentationRepresentations from './addSegmentationRepresentations';
|
|
5
4
|
import { triggerSegmentationRender, createImageIdReferenceMap, } from '../../utilities/segmentation';
|
|
6
|
-
import { getSegmentation
|
|
5
|
+
import { getSegmentation } from './segmentationState';
|
|
7
6
|
import { triggerSegmentationDataModified } from './triggerSegmentationEvents';
|
|
7
|
+
export async function computeStackSegmentationFromVolume({ volumeId, }) {
|
|
8
|
+
const segmentationVolume = cache.getVolume(volumeId);
|
|
9
|
+
const hasCachedImages = segmentationVolume.imageCacheOffsetMap.size > 0;
|
|
10
|
+
let isAllImagesCached = false;
|
|
11
|
+
if (hasCachedImages) {
|
|
12
|
+
isAllImagesCached = segmentationVolume.imageIds.every((imageId) => cache.getImage(imageId));
|
|
13
|
+
}
|
|
14
|
+
const renderingEngine = getRenderingEngines()[0];
|
|
15
|
+
const volumeUsedInOtherViewports = renderingEngine
|
|
16
|
+
.getVolumeViewports()
|
|
17
|
+
.find((vp) => vp.hasVolumeId(volumeId));
|
|
18
|
+
segmentationVolume.decache(!volumeUsedInOtherViewports && isAllImagesCached);
|
|
19
|
+
const imageIdReferenceMap = _getImageIdReferenceMapForStackSegmentation(segmentationVolume);
|
|
20
|
+
return { imageIdReferenceMap };
|
|
21
|
+
}
|
|
8
22
|
export async function convertVolumeToStackSegmentation({ segmentationId, options, }) {
|
|
9
23
|
const segmentation = getSegmentation(segmentationId);
|
|
10
|
-
const { toolGroupId } = options;
|
|
11
24
|
const data = segmentation.representationData
|
|
12
25
|
.LABELMAP;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
const { imageIdReferenceMap } = await computeStackSegmentationFromVolume({
|
|
27
|
+
volumeId: data.volumeId,
|
|
28
|
+
});
|
|
29
|
+
await updateStackSegmentationState({
|
|
30
|
+
segmentationId,
|
|
31
|
+
toolGroupId: options.toolGroupId,
|
|
32
|
+
imageIdReferenceMap,
|
|
33
|
+
options,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export async function updateStackSegmentationState({ segmentationId, toolGroupId, imageIdReferenceMap, options, }) {
|
|
37
|
+
const segmentation = getSegmentation(segmentationId);
|
|
38
|
+
if (options?.removeOriginal) {
|
|
39
|
+
const data = segmentation.representationData
|
|
40
|
+
.LABELMAP;
|
|
41
|
+
if (cache.getVolume(data.volumeId)) {
|
|
42
|
+
cache.removeVolumeLoadObject(data.volumeId);
|
|
43
|
+
}
|
|
44
|
+
segmentation.representationData.LABELMAP = {
|
|
45
|
+
imageIdReferenceMap,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
segmentation.representationData.LABELMAP = {
|
|
50
|
+
...segmentation.representationData.LABELMAP,
|
|
51
|
+
imageIdReferenceMap,
|
|
52
|
+
};
|
|
18
53
|
}
|
|
19
|
-
await addSegmentations([
|
|
20
|
-
{
|
|
21
|
-
segmentationId: newSegmentationId,
|
|
22
|
-
representation: {
|
|
23
|
-
type: SegmentationRepresentations.Labelmap,
|
|
24
|
-
data: {
|
|
25
|
-
imageIdReferenceMap,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
]);
|
|
30
54
|
await addSegmentationRepresentations(toolGroupId, [
|
|
31
55
|
{
|
|
32
|
-
segmentationId
|
|
56
|
+
segmentationId,
|
|
33
57
|
type: SegmentationRepresentations.Labelmap,
|
|
34
58
|
},
|
|
35
59
|
]);
|
|
36
60
|
triggerSegmentationRender(toolGroupId);
|
|
37
|
-
eventTarget.addEventListenerOnce(Events.SEGMENTATION_RENDERED, () => triggerSegmentationDataModified(
|
|
61
|
+
eventTarget.addEventListenerOnce(Events.SEGMENTATION_RENDERED, () => triggerSegmentationDataModified(segmentationId));
|
|
38
62
|
}
|
|
39
63
|
function _getImageIdReferenceMapForStackSegmentation(segmentationVolume) {
|
|
40
|
-
const segmentationImageIds = segmentationVolume.imageIds;
|
|
41
64
|
if (segmentationVolume.additionalDetails?.imageIdReferenceMap) {
|
|
42
65
|
return segmentationVolume.additionalDetails.imageIdReferenceMap;
|
|
43
66
|
}
|
|
44
67
|
else if (segmentationVolume.referencedImageIds?.length &&
|
|
45
68
|
!segmentationVolume.referencedImageIds[0].startsWith('derived')) {
|
|
46
69
|
const referencedImageIds = segmentationVolume.referencedImageIds;
|
|
47
|
-
|
|
70
|
+
const segmentationImageIds = segmentationVolume.imageIds;
|
|
71
|
+
return createImageIdReferenceMap(referencedImageIds, [...segmentationImageIds].reverse());
|
|
48
72
|
}
|
|
49
73
|
else {
|
|
50
74
|
const referencedVolumeId = segmentationVolume.referencedVolumeId;
|
|
@@ -66,7 +90,7 @@ function _getImageIdReferenceMapForStackSegmentation(segmentationVolume) {
|
|
|
66
90
|
segmentationImageIdsToUse =
|
|
67
91
|
segmentationVolume.convertToImageSlicesAndCache();
|
|
68
92
|
}
|
|
69
|
-
return createImageIdReferenceMap(referencedImageIds, segmentationImageIdsToUse);
|
|
93
|
+
return createImageIdReferenceMap(referencedImageIds, [...segmentationImageIdsToUse].reverse());
|
|
70
94
|
}
|
|
71
95
|
}
|
|
72
96
|
//# sourceMappingURL=convertVolumeToStackSegmentation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertVolumeToStackSegmentation.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/convertVolumeToStackSegmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"convertVolumeToStackSegmentation.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/convertVolumeToStackSegmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,EACL,WAAW,EACX,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EACL,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAG9E,MAAM,CAAC,KAAK,UAAU,kCAAkC,CAAC,EACvD,QAAQ,GAGT;IACC,MAAM,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAuB,CAAC;IAY3E,MAAM,eAAe,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,CAAC;IAExE,IAAI,iBAAiB,GAAG,KAAK,CAAC;IAE9B,IAAI,eAAe,EAAE;QAEnB,iBAAiB,GAAG,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAChE,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CACxB,CAAC;KACH;IAGD,MAAM,eAAe,GAAG,mBAAmB,EAAE,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,0BAA0B,GAAG,eAAe;SAC/C,kBAAkB,EAAE;SACpB,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AAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YACxD,MAAM,IAAI,KAAK,CACb;;2EAEmE,CACpE,CAAC;SACH;QAID,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,QAAQ,CAAC;QAErD,IAAI,yBAAyB,GAAG,kBAAkB,CAAC,QAAQ,CAAC;QAC5D,IAAI,CAAC,yBAAyB,EAAE,MAAM,EAAE;YAItC,yBAAyB;gBACvB,kBAAkB,CAAC,4BAA4B,EAAE,CAAC;SACrD;QAED,OAAO,yBAAyB,CAC9B,kBAAkB,EAClB,CAAC,GAAG,yBAAyB,CAAC,CAAC,OAAO,EAAE,CACzC,CAAC;KACH;AACH,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as Enums from '../../../enums';
|
|
2
|
-
import
|
|
2
|
+
import { validatePublic as validatePublicLabelmap } from '../../../tools/displayTools/Labelmap/validateLabelmap';
|
|
3
3
|
function validateSegmentationInput(segmentationInputArray) {
|
|
4
|
-
if (!segmentationInputArray ||
|
|
5
|
-
throw new Error('The segmentationInputArray is undefined or empty array');
|
|
4
|
+
if (!segmentationInputArray || segmentationInputArray.length === 0) {
|
|
5
|
+
throw new Error('The segmentationInputArray is undefined or an empty array');
|
|
6
6
|
}
|
|
7
7
|
segmentationInputArray.forEach((segmentationInput) => {
|
|
8
8
|
if (segmentationInput.segmentationId === undefined) {
|
|
9
|
-
throw new Error('
|
|
9
|
+
throw new Error('Undefined segmentationInput.segmentationId. Please provide a valid segmentationId');
|
|
10
10
|
}
|
|
11
11
|
if (segmentationInput.representation === undefined) {
|
|
12
|
-
throw new Error('
|
|
12
|
+
throw new Error('Undefined segmentationInput.representation. Please provide a valid representation');
|
|
13
13
|
}
|
|
14
14
|
if (segmentationInput.representation.type ===
|
|
15
15
|
Enums.SegmentationRepresentations.Labelmap) {
|
|
16
|
-
|
|
16
|
+
validatePublicLabelmap(segmentationInput);
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateSegmentationInput.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/helpers/validateSegmentationInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,
|
|
1
|
+
{"version":3,"file":"validateSegmentationInput.js","sourceRoot":"","sources":["../../../../../src/stateManagement/segmentation/helpers/validateSegmentationInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAYjH,SAAS,yBAAyB,CAChC,sBAAiD;IAEjD,IAAI,CAAC,sBAAsB,IAAI,sBAAsB,CAAC,MAAM,KAAK,CAAC,EAAE;QAClE,MAAM,IAAI,KAAK,CACb,2DAA2D,CAC5D,CAAC;KACH;IAED,sBAAsB,CAAC,OAAO,CAAC,CAAC,iBAAiB,EAAE,EAAE;QACnD,IAAI,iBAAiB,CAAC,cAAc,KAAK,SAAS,EAAE;YAClD,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;SACH;QAED,IAAI,iBAAiB,CAAC,cAAc,KAAK,SAAS,EAAE;YAClD,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;SACH;QAED,IACE,iBAAiB,CAAC,cAAc,CAAC,IAAI;YACrC,KAAK,CAAC,2BAA2B,CAAC,QAAQ,EAC1C;YACA,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import removeSegmentationsFromToolGroup from './removeSegmentationsFromToolGroup';
|
|
2
2
|
import addSegmentations from './addSegmentations';
|
|
3
3
|
import addSegmentationRepresentations from './addSegmentationRepresentations';
|
|
4
|
+
import addRepresentationData from './addRepresentationData';
|
|
4
5
|
import { convertStackToVolumeSegmentation } from './convertStackToVolumeSegmentation';
|
|
5
6
|
import { convertVolumeToStackSegmentation } from './convertVolumeToStackSegmentation';
|
|
6
7
|
import * as activeSegmentation from './activeSegmentation';
|
|
@@ -9,5 +10,6 @@ import * as state from './segmentationState';
|
|
|
9
10
|
import * as config from './config';
|
|
10
11
|
import * as segmentIndex from './segmentIndex';
|
|
11
12
|
import * as triggerSegmentationEvents from './triggerSegmentationEvents';
|
|
12
|
-
|
|
13
|
+
import * as polySegManager from './polySeg';
|
|
14
|
+
export { addSegmentations, addSegmentationRepresentations, removeSegmentationsFromToolGroup, addRepresentationData, state, activeSegmentation, segmentLocking, config, segmentIndex, triggerSegmentationEvents, convertStackToVolumeSegmentation, convertVolumeToStackSegmentation, polySegManager as polySeg, };
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAClF,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/stateManagement/segmentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,MAAM,oCAAoC,CAAC;AAClF,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAGtF,OAAO,KAAK,kBAAkB,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,yBAAyB,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,cAAc,MAAM,WAAW,CAAC;AAE5C,OAAO,EAEL,gBAAgB,EAChB,8BAA8B,EAC9B,gCAAgC,EAChC,qBAAqB,EAErB,KAAK,EACL,kBAAkB,EAClB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,yBAAyB,EACzB,gCAAgC,EAChC,gCAAgC,EAChC,cAAc,IAAI,OAAO,GAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeAndAddContourRepresentation.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,kCAAkC,CAChD,cAAsB,EACtB,UAAoC,EAAE;IAEtC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SegmentationRepresentations } from '../../../../enums';
|
|
2
|
+
import { computeAndAddRepresentation } from '../computeAndAddRepresentation';
|
|
3
|
+
import { computeLabelmapData } from './labelmapComputationStrategies';
|
|
4
|
+
export function computeAndAddLabelmapRepresentation(segmentationId, options = {}) {
|
|
5
|
+
return computeAndAddRepresentation(segmentationId, SegmentationRepresentations.Labelmap, () => computeLabelmapData(segmentationId, options), () => { });
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=computeAndAddLabelmapRepresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeAndAddLabelmapRepresentation.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Labelmap/computeAndAddLabelmapRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAYtE,MAAM,UAAU,mCAAmC,CACjD,cAAsB,EACtB,UAAoC,EAAE;IAEtC,OAAO,2BAA2B,CAChC,cAAc,EACd,2BAA2B,CAAC,QAAQ,EACpC,GAAG,EAAE,CAAC,mBAAmB,CAAC,cAAc,EAAE,OAAO,CAAC,EAClD,GAAG,EAAE,GAAE,CAAC,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { vec3 } from 'gl-matrix';
|
|
2
|
+
import { cache, utilities, getWebWorkerManager, volumeLoader, imageLoader, metaData, Enums, triggerEvent, eventTarget, } from '@cornerstonejs/core';
|
|
3
|
+
import { getAnnotation } from '../../..';
|
|
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_LABELMAP,
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export async function convertContourToVolumeLabelmap(contourRepresentationData, options = {}) {
|
|
13
|
+
const { viewport } = options;
|
|
14
|
+
const imageIds = utilities.getViewportImageIds(viewport);
|
|
15
|
+
if (!imageIds) {
|
|
16
|
+
throw new Error('No imageIds found, labelmap computation from contour requires viewports with imageIds');
|
|
17
|
+
}
|
|
18
|
+
const segmentationVolumeId = utilities.uuidv4();
|
|
19
|
+
const volumeProps = utilities.generateVolumePropsFromImageIds(imageIds, segmentationVolumeId);
|
|
20
|
+
const { metadata, dimensions, origin, direction, spacing, scalarData } = volumeProps;
|
|
21
|
+
const segmentationVolume = await volumeLoader.createLocalSegmentationVolume({
|
|
22
|
+
dimensions,
|
|
23
|
+
origin,
|
|
24
|
+
direction,
|
|
25
|
+
spacing,
|
|
26
|
+
metadata,
|
|
27
|
+
imageIds: imageIds.map((imageId) => `generated://${imageId}`),
|
|
28
|
+
referencedImageIds: imageIds,
|
|
29
|
+
}, segmentationVolumeId);
|
|
30
|
+
const { segmentIndices, annotationUIDsInSegmentMap } = _getAnnotationMapFromSegmentation(contourRepresentationData, options);
|
|
31
|
+
triggerWorkerProgress(eventTarget, 0);
|
|
32
|
+
const newScalarData = await workerManager.executeTask('polySeg', 'convertContourToVolumeLabelmap', {
|
|
33
|
+
segmentIndices,
|
|
34
|
+
dimensions,
|
|
35
|
+
scalarData,
|
|
36
|
+
origin,
|
|
37
|
+
direction,
|
|
38
|
+
spacing,
|
|
39
|
+
annotationUIDsInSegmentMap,
|
|
40
|
+
}, {
|
|
41
|
+
callbacks: [
|
|
42
|
+
(progress) => {
|
|
43
|
+
triggerWorkerProgress(eventTarget, progress);
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
});
|
|
47
|
+
triggerWorkerProgress(eventTarget, 100);
|
|
48
|
+
segmentationVolume.imageData
|
|
49
|
+
.getPointData()
|
|
50
|
+
.getScalars()
|
|
51
|
+
.setData(newScalarData);
|
|
52
|
+
segmentationVolume.imageData.modified();
|
|
53
|
+
segmentationVolume.modified();
|
|
54
|
+
return {
|
|
55
|
+
volumeId: segmentationVolume.volumeId,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export async function convertContourToStackLabelmap(contourRepresentationData, options = {}) {
|
|
59
|
+
if (!options.viewport) {
|
|
60
|
+
throw new Error('No viewport provided, labelmap computation from contour requires viewports');
|
|
61
|
+
}
|
|
62
|
+
const viewport = options.viewport;
|
|
63
|
+
const imageIds = viewport.getImageIds();
|
|
64
|
+
if (!imageIds) {
|
|
65
|
+
throw new Error('No imageIds found, labelmap computation from contour requires viewports with imageIds');
|
|
66
|
+
}
|
|
67
|
+
imageIds.forEach((imageId) => {
|
|
68
|
+
if (!cache.getImageLoadObject(imageId)) {
|
|
69
|
+
throw new Error('ImageIds must be cached before converting contour to labelmap');
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const { imageIds: segmentationImageIds } = await imageLoader.createAndCacheDerivedSegmentationImages(imageIds);
|
|
73
|
+
const { segmentIndices, annotationUIDsInSegmentMap } = _getAnnotationMapFromSegmentation(contourRepresentationData, options);
|
|
74
|
+
const segmentationsInfo = new Map();
|
|
75
|
+
segmentationImageIds.forEach((segImageId, index) => {
|
|
76
|
+
const segImage = cache.getImage(segImageId);
|
|
77
|
+
const imagePlaneModule = metaData.get(Enums.MetadataModules.IMAGE_PLANE, segImageId);
|
|
78
|
+
let { columnCosines, rowCosines, rowPixelSpacing, columnPixelSpacing, imagePositionPatient, } = imagePlaneModule;
|
|
79
|
+
columnCosines = columnCosines ?? [0, 1, 0];
|
|
80
|
+
rowCosines = rowCosines ?? [1, 0, 0];
|
|
81
|
+
rowPixelSpacing = rowPixelSpacing ?? 1;
|
|
82
|
+
columnPixelSpacing = columnPixelSpacing ?? 1;
|
|
83
|
+
imagePositionPatient = imagePositionPatient ?? [0, 0, 0];
|
|
84
|
+
const rowCosineVec = vec3.fromValues(rowCosines[0], rowCosines[1], rowCosines[2]);
|
|
85
|
+
const colCosineVec = vec3.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]);
|
|
86
|
+
const scanAxisNormal = vec3.create();
|
|
87
|
+
vec3.cross(scanAxisNormal, rowCosineVec, colCosineVec);
|
|
88
|
+
const direction = [...rowCosineVec, ...colCosineVec, ...scanAxisNormal];
|
|
89
|
+
const spacing = [rowPixelSpacing, columnPixelSpacing, 1];
|
|
90
|
+
const origin = imagePositionPatient;
|
|
91
|
+
segmentationsInfo.set(imageIds[index], {
|
|
92
|
+
direction,
|
|
93
|
+
spacing,
|
|
94
|
+
origin,
|
|
95
|
+
scalarData: segImage.getPixelData(),
|
|
96
|
+
imageId: segImageId,
|
|
97
|
+
dimensions: [segImage.width, segImage.height, 1],
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
triggerWorkerProgress(eventTarget, 0);
|
|
101
|
+
const newSegmentationsScalarData = await workerManager.executeTask('polySeg', 'convertContourToStackLabelmap', {
|
|
102
|
+
segmentationsInfo,
|
|
103
|
+
annotationUIDsInSegmentMap,
|
|
104
|
+
segmentIndices,
|
|
105
|
+
}, {
|
|
106
|
+
callbacks: [
|
|
107
|
+
(progress) => {
|
|
108
|
+
triggerWorkerProgress(eventTarget, progress);
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
triggerWorkerProgress(eventTarget, 100);
|
|
113
|
+
const imageIdReferenceMap = new Map();
|
|
114
|
+
newSegmentationsScalarData.forEach(({ scalarData }, referencedImageId) => {
|
|
115
|
+
const segmentationInfo = segmentationsInfo.get(referencedImageId);
|
|
116
|
+
const { imageId: segImageId } = segmentationInfo;
|
|
117
|
+
const segImage = cache.getImage(segImageId);
|
|
118
|
+
segImage.getPixelData().set(scalarData);
|
|
119
|
+
segImage.imageFrame?.pixelData?.set(scalarData);
|
|
120
|
+
imageIdReferenceMap.set(referencedImageId, segImageId);
|
|
121
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
imageIdReferenceMap,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function _getAnnotationMapFromSegmentation(contourRepresentationData, options = {}) {
|
|
127
|
+
const annotationMap = contourRepresentationData.annotationUIDsMap;
|
|
128
|
+
const segmentIndices = options.segmentIndices?.length
|
|
129
|
+
? options.segmentIndices
|
|
130
|
+
: Array.from(annotationMap.keys());
|
|
131
|
+
const annotationUIDsInSegmentMap = new Map();
|
|
132
|
+
segmentIndices.forEach((index) => {
|
|
133
|
+
const annotationUIDsInSegment = annotationMap.get(index);
|
|
134
|
+
const annotations = Array.from(annotationUIDsInSegment).map((uid) => {
|
|
135
|
+
const annotation = getAnnotation(uid);
|
|
136
|
+
return annotation;
|
|
137
|
+
});
|
|
138
|
+
annotationUIDsInSegmentMap.set(index, annotations);
|
|
139
|
+
});
|
|
140
|
+
return { segmentIndices, annotationUIDsInSegmentMap };
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=convertContourToLabelmap.js.map
|
package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertContourToLabelmap.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAEL,KAAK,EACL,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,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,2BAA2B;KAC9C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,yBAAkD,EAClD,UAAoC,EAAE;IAEtC,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAE7B,MAAM,QAAQ,GAAG,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CA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E,MAAM;QACnD,CAAC,CAAC,OAAO,CAAC,cAAc;QACxB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC;IAErC,MAAM,0BAA0B,GAAG,IAAI,GAAG,EAAwB,CAAC;IACnE,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/B,MAAM,uBAAuB,GAAG,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEzD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YAClE,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;YAEtC,OAAO,UAAU,CAAC;QACpB,CAAC,CAAC,CAAC;QAEH,0BAA0B,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Enums, cache, eventTarget, getWebWorkerManager, triggerEvent, } from '@cornerstonejs/core';
|
|
2
|
+
import { WorkerTypes } from '../../../../enums';
|
|
3
|
+
const workerManager = getWebWorkerManager();
|
|
4
|
+
const triggerWorkerProgress = (eventTarget, progress) => {
|
|
5
|
+
triggerEvent(eventTarget, Enums.Events.WEB_WORKER_PROGRESS, {
|
|
6
|
+
progress,
|
|
7
|
+
type: WorkerTypes.POLYSEG_SURFACE_TO_LABELMAP,
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export async function convertSurfaceToVolumeLabelmap(surfaceRepresentationData, segmentationVolume) {
|
|
11
|
+
const { geometryIds } = surfaceRepresentationData;
|
|
12
|
+
if (!geometryIds?.size) {
|
|
13
|
+
throw new Error('No geometry IDs found for surface representation');
|
|
14
|
+
}
|
|
15
|
+
const segmentsInfo = new Map();
|
|
16
|
+
geometryIds.forEach((geometryId, segmentIndex) => {
|
|
17
|
+
const geometry = cache.getGeometry(geometryId);
|
|
18
|
+
const geometryData = geometry.data;
|
|
19
|
+
const points = geometryData.getPoints();
|
|
20
|
+
const polys = geometryData.getPolys();
|
|
21
|
+
segmentsInfo.set(segmentIndex, {
|
|
22
|
+
points,
|
|
23
|
+
polys,
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
const { dimensions, direction, origin, spacing } = segmentationVolume;
|
|
27
|
+
triggerWorkerProgress(eventTarget, 0);
|
|
28
|
+
const newScalarData = await workerManager.executeTask('polySeg', 'convertSurfacesToVolumeLabelmap', {
|
|
29
|
+
segmentsInfo,
|
|
30
|
+
dimensions,
|
|
31
|
+
spacing,
|
|
32
|
+
direction,
|
|
33
|
+
origin,
|
|
34
|
+
}, {
|
|
35
|
+
callbacks: [
|
|
36
|
+
(progress) => {
|
|
37
|
+
triggerWorkerProgress(eventTarget, progress);
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
});
|
|
41
|
+
triggerWorkerProgress(eventTarget, 100);
|
|
42
|
+
segmentationVolume.imageData
|
|
43
|
+
.getPointData()
|
|
44
|
+
.getScalars()
|
|
45
|
+
.setData(newScalarData);
|
|
46
|
+
segmentationVolume.imageData.modified();
|
|
47
|
+
segmentationVolume.modified();
|
|
48
|
+
return {
|
|
49
|
+
volumeId: segmentationVolume.volumeId,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export async function convertSurfaceToStackLabelmap() { }
|
|
53
|
+
//# sourceMappingURL=convertSurfaceToLabelmap.js.map
|
package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertSurfaceToLabelmap.js","sourceRoot":"","sources":["../../../../../../src/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK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