@cornerstonejs/tools 1.51.5 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/drawingSvg/drawPath.d.ts +11 -0
- package/dist/cjs/drawingSvg/drawPath.js +55 -0
- package/dist/cjs/drawingSvg/drawPath.js.map +1 -0
- package/dist/cjs/drawingSvg/drawPolyline.d.ts +1 -1
- package/dist/cjs/drawingSvg/drawPolyline.js +3 -11
- package/dist/cjs/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/cjs/drawingSvg/index.d.ts +2 -1
- package/dist/cjs/drawingSvg/index.js +3 -1
- package/dist/cjs/drawingSvg/index.js.map +1 -1
- package/dist/cjs/enums/ChangeTypes.d.ts +2 -1
- package/dist/cjs/enums/ChangeTypes.js +1 -0
- package/dist/cjs/enums/ChangeTypes.js.map +1 -1
- package/dist/cjs/eventDispatchers/keyboardEventHandlers/keyDown.js +1 -1
- package/dist/cjs/eventDispatchers/keyboardEventHandlers/keyDown.js.map +1 -1
- package/dist/cjs/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
- package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +1 -1
- package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +165 -78
- package/dist/cjs/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/annotationState.d.ts +6 -1
- package/dist/cjs/stateManagement/annotation/annotationState.js +49 -1
- package/dist/cjs/stateManagement/annotation/annotationState.js.map +1 -1
- package/dist/cjs/stateManagement/annotation/helpers/state.d.ts +4 -2
- package/dist/cjs/stateManagement/annotation/helpers/state.js +16 -4
- package/dist/cjs/stateManagement/annotation/helpers/state.js.map +1 -1
- package/dist/cjs/stateManagement/index.d.ts +6 -1
- package/dist/cjs/stateManagement/index.js +6 -1
- package/dist/cjs/stateManagement/index.js.map +1 -1
- package/dist/cjs/store/ToolGroupManager/ToolGroup.d.ts +3 -1
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js +3 -2
- package/dist/cjs/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/cjs/tools/SegmentationIntersectionTool.js +1 -1
- package/dist/cjs/tools/SegmentationIntersectionTool.js.map +1 -1
- package/dist/cjs/tools/annotation/LivewireContourSegmentationTool.d.ts +4 -0
- package/dist/cjs/tools/annotation/LivewireContourSegmentationTool.js +82 -0
- package/dist/cjs/tools/annotation/LivewireContourSegmentationTool.js.map +1 -1
- package/dist/cjs/tools/annotation/LivewireContourTool.d.ts +13 -11
- package/dist/cjs/tools/annotation/LivewireContourTool.js +78 -65
- package/dist/cjs/tools/annotation/LivewireContourTool.js.map +1 -1
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js +3 -1
- package/dist/cjs/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/SplineROITool.d.ts +6 -3
- package/dist/cjs/tools/annotation/SplineROITool.js +40 -21
- package/dist/cjs/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +12 -7
- package/dist/cjs/tools/annotation/planarFreehandROITool/closedContourEditLoop.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js +24 -18
- package/dist/cjs/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEditLoop.js +16 -10
- package/dist/cjs/tools/annotation/planarFreehandROITool/openContourEditLoop.js.map +1 -1
- package/dist/cjs/tools/annotation/planarFreehandROITool/renderMethods.js +19 -7
- package/dist/cjs/tools/annotation/planarFreehandROITool/renderMethods.js.map +1 -1
- package/dist/cjs/tools/annotation/splines/LinearSpline.js +1 -1
- package/dist/cjs/tools/annotation/splines/LinearSpline.js.map +1 -1
- package/dist/cjs/tools/annotation/splines/Spline.d.ts +2 -0
- package/dist/cjs/tools/annotation/splines/Spline.js +7 -3
- package/dist/cjs/tools/annotation/splines/Spline.js.map +1 -1
- package/dist/cjs/tools/base/AnnotationTool.js.map +1 -1
- package/dist/cjs/tools/base/ContourBaseTool.d.ts +1 -0
- package/dist/cjs/tools/base/ContourBaseTool.js +18 -1
- package/dist/cjs/tools/base/ContourBaseTool.js.map +1 -1
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.js +4 -0
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Contour/contourConfig.js +1 -0
- package/dist/cjs/tools/displayTools/Contour/contourConfig.js.map +1 -1
- package/dist/cjs/types/AnnotationTypes.d.ts +2 -0
- package/dist/cjs/types/ContourAnnotation.d.ts +6 -0
- package/dist/cjs/types/ContourAnnotation.js +7 -0
- package/dist/cjs/types/ContourAnnotation.js.map +1 -1
- package/dist/cjs/types/ContourSegmentationAnnotation.d.ts +8 -0
- package/dist/cjs/types/ContourTypes.d.ts +1 -0
- package/dist/cjs/types/EventTypes.d.ts +4 -1
- package/dist/cjs/types/ISpline.d.ts +1 -0
- package/dist/cjs/types/InterpolationTypes.d.ts +2 -0
- package/dist/cjs/types/SplineProps.d.ts +1 -0
- package/dist/cjs/types/ToolSpecificAnnotationTypes.d.ts +2 -5
- package/dist/cjs/utilities/contours/getContourHolesDataCanvas.d.ts +3 -0
- package/dist/cjs/utilities/contours/getContourHolesDataCanvas.js +21 -0
- package/dist/cjs/utilities/contours/getContourHolesDataCanvas.js.map +1 -0
- package/dist/cjs/utilities/contours/getContourHolesDataWorld.d.ts +3 -0
- package/dist/cjs/utilities/contours/getContourHolesDataWorld.js +10 -0
- package/dist/cjs/utilities/contours/getContourHolesDataWorld.js.map +1 -0
- package/dist/cjs/utilities/contours/index.d.ts +4 -1
- package/dist/cjs/utilities/contours/index.js +7 -1
- package/dist/cjs/utilities/contours/index.js.map +1 -1
- package/dist/cjs/utilities/contours/interpolation/acceptAutogeneratedInterpolations.js.map +1 -1
- package/dist/cjs/utilities/contours/interpolation/createPolylineToolData.js +2 -1
- package/dist/cjs/utilities/contours/interpolation/createPolylineToolData.js.map +1 -1
- package/dist/cjs/utilities/contours/interpolation/findAnnotationForInterpolation.js +2 -1
- package/dist/cjs/utilities/contours/interpolation/findAnnotationForInterpolation.js.map +1 -1
- package/dist/cjs/utilities/contours/interpolation/getInterpolationData.js +3 -1
- package/dist/cjs/utilities/contours/interpolation/getInterpolationData.js.map +1 -1
- package/dist/cjs/utilities/contours/interpolation/interpolate.d.ts +8 -0
- package/dist/cjs/utilities/contours/interpolation/interpolate.js +56 -42
- package/dist/cjs/utilities/contours/interpolation/interpolate.js.map +1 -1
- package/dist/cjs/utilities/contours/interpolation/selectHandles.d.ts +4 -0
- package/dist/cjs/utilities/contours/interpolation/selectHandles.js +170 -0
- package/dist/cjs/utilities/contours/interpolation/selectHandles.js.map +1 -0
- package/dist/cjs/utilities/contours/updateContourPolyline.d.ts +10 -0
- package/dist/cjs/utilities/contours/updateContourPolyline.js +64 -0
- package/dist/cjs/utilities/contours/updateContourPolyline.js.map +1 -0
- package/dist/cjs/utilities/livewire/LivewireScissors.d.ts +2 -1
- package/dist/cjs/utilities/livewire/LivewireScissors.js +46 -24
- package/dist/cjs/utilities/livewire/LivewireScissors.js.map +1 -1
- package/dist/cjs/utilities/math/polyline/containsPoints.d.ts +2 -0
- package/dist/cjs/utilities/math/polyline/containsPoints.js +16 -0
- package/dist/cjs/utilities/math/polyline/containsPoints.js.map +1 -0
- package/dist/cjs/utilities/math/polyline/getWindingDirection.d.ts +2 -0
- package/dist/cjs/utilities/math/polyline/getWindingDirection.js +12 -0
- package/dist/cjs/utilities/math/polyline/getWindingDirection.js.map +1 -0
- package/dist/cjs/utilities/math/polyline/index.d.ts +3 -1
- package/dist/cjs/utilities/math/polyline/index.js +5 -1
- package/dist/cjs/utilities/math/polyline/index.js.map +1 -1
- package/dist/cjs/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +1 -0
- package/dist/cjs/utilities/segmentation/InterpolationManager/InterpolationManager.js +13 -3
- package/dist/cjs/utilities/segmentation/InterpolationManager/InterpolationManager.js.map +1 -1
- package/dist/esm/drawingSvg/drawPath.js +49 -0
- package/dist/esm/drawingSvg/drawPath.js.map +1 -0
- package/dist/esm/drawingSvg/drawPolyline.js +3 -11
- package/dist/esm/drawingSvg/drawPolyline.js.map +1 -1
- package/dist/esm/drawingSvg/index.js +2 -1
- package/dist/esm/drawingSvg/index.js.map +1 -1
- package/dist/esm/enums/ChangeTypes.js +1 -0
- package/dist/esm/enums/ChangeTypes.js.map +1 -1
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.js +1 -1
- package/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.js.map +1 -1
- package/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js.map +1 -1
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js +106 -32
- package/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js.map +1 -1
- package/dist/esm/stateManagement/annotation/annotationState.js +42 -1
- package/dist/esm/stateManagement/annotation/annotationState.js.map +1 -1
- package/dist/esm/stateManagement/annotation/helpers/state.js +15 -4
- package/dist/esm/stateManagement/annotation/helpers/state.js.map +1 -1
- package/dist/esm/stateManagement/index.js +2 -2
- package/dist/esm/stateManagement/index.js.map +1 -1
- package/dist/esm/store/ToolGroupManager/ToolGroup.js +3 -2
- package/dist/esm/store/ToolGroupManager/ToolGroup.js.map +1 -1
- package/dist/esm/tools/SegmentationIntersectionTool.js +1 -1
- package/dist/esm/tools/SegmentationIntersectionTool.js.map +1 -1
- package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js +81 -0
- package/dist/esm/tools/annotation/LivewireContourSegmentationTool.js.map +1 -1
- package/dist/esm/tools/annotation/LivewireContourTool.js +80 -67
- package/dist/esm/tools/annotation/LivewireContourTool.js.map +1 -1
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js +3 -1
- package/dist/esm/tools/annotation/PlanarFreehandROITool.js.map +1 -1
- package/dist/esm/tools/annotation/SplineROITool.js +40 -22
- package/dist/esm/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js +12 -7
- package/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js +25 -19
- package/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js +16 -10
- package/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js.map +1 -1
- package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js +20 -8
- package/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js.map +1 -1
- package/dist/esm/tools/annotation/splines/LinearSpline.js +1 -1
- package/dist/esm/tools/annotation/splines/LinearSpline.js.map +1 -1
- package/dist/esm/tools/annotation/splines/Spline.js +5 -1
- package/dist/esm/tools/annotation/splines/Spline.js.map +1 -1
- package/dist/esm/tools/base/AnnotationTool.js.map +1 -1
- package/dist/esm/tools/base/ContourBaseTool.js +20 -3
- package/dist/esm/tools/base/ContourBaseTool.js.map +1 -1
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js +4 -0
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Contour/contourConfig.js +1 -0
- package/dist/esm/tools/displayTools/Contour/contourConfig.js.map +1 -1
- package/dist/esm/types/ContourAnnotation.js +6 -1
- package/dist/esm/types/ContourAnnotation.js.map +1 -1
- package/dist/esm/utilities/contours/getContourHolesDataCanvas.js +15 -0
- package/dist/esm/utilities/contours/getContourHolesDataCanvas.js.map +1 -0
- package/dist/esm/utilities/contours/getContourHolesDataWorld.js +6 -0
- package/dist/esm/utilities/contours/getContourHolesDataWorld.js.map +1 -0
- package/dist/esm/utilities/contours/index.js +4 -1
- package/dist/esm/utilities/contours/index.js.map +1 -1
- package/dist/esm/utilities/contours/interpolation/acceptAutogeneratedInterpolations.js.map +1 -1
- package/dist/esm/utilities/contours/interpolation/createPolylineToolData.js +2 -1
- package/dist/esm/utilities/contours/interpolation/createPolylineToolData.js.map +1 -1
- package/dist/esm/utilities/contours/interpolation/findAnnotationForInterpolation.js +2 -1
- package/dist/esm/utilities/contours/interpolation/findAnnotationForInterpolation.js.map +1 -1
- package/dist/esm/utilities/contours/interpolation/getInterpolationData.js +3 -1
- package/dist/esm/utilities/contours/interpolation/getInterpolationData.js.map +1 -1
- package/dist/esm/utilities/contours/interpolation/interpolate.js +57 -43
- package/dist/esm/utilities/contours/interpolation/interpolate.js.map +1 -1
- package/dist/esm/utilities/contours/interpolation/selectHandles.js +164 -0
- package/dist/esm/utilities/contours/interpolation/selectHandles.js.map +1 -0
- package/dist/esm/utilities/contours/updateContourPolyline.js +38 -0
- package/dist/esm/utilities/contours/updateContourPolyline.js.map +1 -0
- package/dist/esm/utilities/livewire/LivewireScissors.js +46 -24
- package/dist/esm/utilities/livewire/LivewireScissors.js.map +1 -1
- package/dist/esm/utilities/math/polyline/containsPoints.js +10 -0
- package/dist/esm/utilities/math/polyline/containsPoints.js.map +1 -0
- package/dist/esm/utilities/math/polyline/getWindingDirection.js +6 -0
- package/dist/esm/utilities/math/polyline/getWindingDirection.js.map +1 -0
- package/dist/esm/utilities/math/polyline/index.js +3 -1
- package/dist/esm/utilities/math/polyline/index.js.map +1 -1
- package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.js +13 -3
- package/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.js.map +1 -1
- package/dist/types/drawingSvg/drawPath.d.ts +12 -0
- package/dist/types/drawingSvg/drawPath.d.ts.map +1 -0
- package/dist/types/drawingSvg/drawPolyline.d.ts +1 -1
- package/dist/types/drawingSvg/drawPolyline.d.ts.map +1 -1
- package/dist/types/drawingSvg/index.d.ts +2 -1
- package/dist/types/drawingSvg/index.d.ts.map +1 -1
- package/dist/types/enums/ChangeTypes.d.ts +2 -1
- package/dist/types/enums/ChangeTypes.d.ts.map +1 -1
- package/dist/types/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts +1 -1
- package/dist/types/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.d.ts.map +1 -1
- package/dist/types/stateManagement/annotation/annotationState.d.ts +6 -1
- package/dist/types/stateManagement/annotation/annotationState.d.ts.map +1 -1
- package/dist/types/stateManagement/annotation/helpers/state.d.ts +4 -2
- package/dist/types/stateManagement/annotation/helpers/state.d.ts.map +1 -1
- package/dist/types/stateManagement/index.d.ts +6 -1
- package/dist/types/store/ToolGroupManager/ToolGroup.d.ts +3 -1
- package/dist/types/store/ToolGroupManager/ToolGroup.d.ts.map +1 -1
- package/dist/types/tools/annotation/LivewireContourSegmentationTool.d.ts +4 -0
- package/dist/types/tools/annotation/LivewireContourSegmentationTool.d.ts.map +1 -1
- package/dist/types/tools/annotation/LivewireContourTool.d.ts +13 -11
- package/dist/types/tools/annotation/LivewireContourTool.d.ts.map +1 -1
- package/dist/types/tools/annotation/PlanarFreehandROITool.d.ts.map +1 -1
- package/dist/types/tools/annotation/SplineROITool.d.ts +6 -3
- package/dist/types/tools/annotation/SplineROITool.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/closedContourEditLoop.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/drawLoop.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/openContourEditLoop.d.ts.map +1 -1
- package/dist/types/tools/annotation/planarFreehandROITool/renderMethods.d.ts.map +1 -1
- package/dist/types/tools/annotation/splines/Spline.d.ts +2 -0
- package/dist/types/tools/annotation/splines/Spline.d.ts.map +1 -1
- package/dist/types/tools/base/AnnotationTool.d.ts.map +1 -1
- package/dist/types/tools/base/ContourBaseTool.d.ts +1 -0
- package/dist/types/tools/base/ContourBaseTool.d.ts.map +1 -1
- package/dist/types/tools/base/ContourSegmentationBaseTool.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Contour/contourConfig.d.ts.map +1 -1
- package/dist/types/types/AnnotationTypes.d.ts +2 -0
- package/dist/types/types/AnnotationTypes.d.ts.map +1 -1
- package/dist/types/types/ContourAnnotation.d.ts +6 -0
- package/dist/types/types/ContourAnnotation.d.ts.map +1 -1
- package/dist/types/types/ContourSegmentationAnnotation.d.ts +8 -0
- package/dist/types/types/ContourSegmentationAnnotation.d.ts.map +1 -1
- package/dist/types/types/ContourTypes.d.ts +1 -0
- package/dist/types/types/ContourTypes.d.ts.map +1 -1
- package/dist/types/types/EventTypes.d.ts +4 -1
- package/dist/types/types/EventTypes.d.ts.map +1 -1
- package/dist/types/types/ISpline.d.ts +1 -0
- package/dist/types/types/ISpline.d.ts.map +1 -1
- package/dist/types/types/InterpolationTypes.d.ts +2 -0
- package/dist/types/types/InterpolationTypes.d.ts.map +1 -1
- package/dist/types/types/SplineProps.d.ts +1 -0
- package/dist/types/types/SplineProps.d.ts.map +1 -1
- package/dist/types/types/ToolSpecificAnnotationTypes.d.ts +2 -5
- package/dist/types/types/ToolSpecificAnnotationTypes.d.ts.map +1 -1
- package/dist/types/utilities/contours/getContourHolesDataCanvas.d.ts +4 -0
- package/dist/types/utilities/contours/getContourHolesDataCanvas.d.ts.map +1 -0
- package/dist/types/utilities/contours/getContourHolesDataWorld.d.ts +4 -0
- package/dist/types/utilities/contours/getContourHolesDataWorld.d.ts.map +1 -0
- package/dist/types/utilities/contours/index.d.ts +4 -1
- package/dist/types/utilities/contours/index.d.ts.map +1 -1
- package/dist/types/utilities/contours/interpolation/acceptAutogeneratedInterpolations.d.ts.map +1 -1
- package/dist/types/utilities/contours/interpolation/createPolylineToolData.d.ts.map +1 -1
- package/dist/types/utilities/contours/interpolation/findAnnotationForInterpolation.d.ts.map +1 -1
- package/dist/types/utilities/contours/interpolation/getInterpolationData.d.ts.map +1 -1
- package/dist/types/utilities/contours/interpolation/interpolate.d.ts +8 -0
- package/dist/types/utilities/contours/interpolation/interpolate.d.ts.map +1 -1
- package/dist/types/utilities/contours/interpolation/selectHandles.d.ts +5 -0
- package/dist/types/utilities/contours/interpolation/selectHandles.d.ts.map +1 -0
- package/dist/types/utilities/contours/updateContourPolyline.d.ts +11 -0
- package/dist/types/utilities/contours/updateContourPolyline.d.ts.map +1 -0
- package/dist/types/utilities/livewire/LivewireScissors.d.ts +2 -1
- package/dist/types/utilities/livewire/LivewireScissors.d.ts.map +1 -1
- package/dist/types/utilities/math/polyline/containsPoints.d.ts +3 -0
- package/dist/types/utilities/math/polyline/containsPoints.d.ts.map +1 -0
- package/dist/types/utilities/math/polyline/getWindingDirection.d.ts +3 -0
- package/dist/types/utilities/math/polyline/getWindingDirection.d.ts.map +1 -0
- package/dist/types/utilities/math/polyline/index.d.ts +3 -1
- package/dist/types/utilities/math/polyline/index.d.ts.map +1 -1
- package/dist/types/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts +1 -0
- package/dist/types/utilities/math/polyline/planarFreehandROIInternalTypes.d.ts.map +1 -1
- package/dist/types/utilities/segmentation/InterpolationManager/InterpolationManager.d.ts.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
- package/src/drawingSvg/drawPath.ts +96 -0
- package/src/drawingSvg/drawPolyline.ts +13 -17
- package/src/drawingSvg/index.ts +2 -0
- package/src/enums/ChangeTypes.ts +4 -0
- package/src/eventDispatchers/keyboardEventHandlers/keyDown.ts +1 -1
- package/src/eventDispatchers/shared/getActiveToolForMouseEvent.ts +1 -1
- package/src/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.ts +194 -58
- package/src/stateManagement/annotation/annotationState.ts +101 -0
- package/src/stateManagement/annotation/helpers/state.ts +33 -3
- package/src/stateManagement/index.js +10 -0
- package/src/store/ToolGroupManager/ToolGroup.ts +9 -2
- package/src/tools/SegmentationIntersectionTool.ts +1 -1
- package/src/tools/annotation/LivewireContourSegmentationTool.ts +151 -0
- package/src/tools/annotation/LivewireContourTool.ts +172 -114
- package/src/tools/annotation/PlanarFreehandROITool.ts +13 -3
- package/src/tools/annotation/SplineROITool.ts +78 -31
- package/src/tools/annotation/planarFreehandROITool/closedContourEditLoop.ts +20 -11
- package/src/tools/annotation/planarFreehandROITool/drawLoop.ts +40 -21
- package/src/tools/annotation/planarFreehandROITool/openContourEditLoop.ts +28 -13
- package/src/tools/annotation/planarFreehandROITool/renderMethods.ts +28 -10
- package/src/tools/annotation/splines/LinearSpline.ts +1 -1
- package/src/tools/annotation/splines/Spline.ts +13 -1
- package/src/tools/base/AnnotationTool.ts +1 -0
- package/src/tools/base/ContourBaseTool.ts +45 -3
- package/src/tools/base/ContourSegmentationBaseTool.ts +6 -0
- package/src/tools/displayTools/Contour/contourConfig.ts +1 -0
- package/src/types/AnnotationTypes.ts +14 -0
- package/src/types/ContourAnnotation.ts +13 -0
- package/src/types/ContourSegmentationAnnotation.ts +38 -0
- package/src/types/ContourTypes.ts +3 -0
- package/src/types/EventTypes.ts +9 -0
- package/src/types/ISpline.ts +3 -0
- package/src/types/InterpolationTypes.ts +6 -0
- package/src/types/SplineProps.ts +10 -0
- package/src/types/ToolSpecificAnnotationTypes.ts +7 -5
- package/src/utilities/contours/getContourHolesDataCanvas.ts +33 -0
- package/src/utilities/contours/getContourHolesDataWorld.ts +19 -0
- package/src/utilities/contours/index.ts +6 -0
- package/src/utilities/contours/interpolation/acceptAutogeneratedInterpolations.ts +3 -1
- package/src/utilities/contours/interpolation/createPolylineToolData.ts +7 -1
- package/src/utilities/contours/interpolation/findAnnotationForInterpolation.ts +2 -1
- package/src/utilities/contours/interpolation/getInterpolationData.ts +3 -1
- package/src/utilities/contours/interpolation/interpolate.ts +94 -75
- package/src/utilities/contours/interpolation/selectHandles.ts +240 -0
- package/src/utilities/contours/updateContourPolyline.ts +74 -0
- package/src/utilities/livewire/LivewireScissors.ts +65 -53
- package/src/utilities/math/polyline/containsPoint.ts +1 -1
- package/src/utilities/math/polyline/containsPoints.ts +22 -0
- package/src/utilities/math/polyline/getWindingDirection.ts +14 -0
- package/src/utilities/math/polyline/index.ts +4 -0
- package/src/utilities/math/polyline/planarFreehandROIInternalTypes.ts +1 -0
- package/src/utilities/segmentation/InterpolationManager/InterpolationManager.ts +39 -4
- package/dist/cjs/utilities/contours/PointsArray.d.ts +0 -29
- package/dist/cjs/utilities/contours/PointsArray.js +0 -104
- package/dist/cjs/utilities/contours/PointsArray.js.map +0 -1
- package/dist/esm/utilities/contours/PointsArray.js +0 -98
- package/dist/esm/utilities/contours/PointsArray.js.map +0 -1
- package/dist/types/utilities/contours/PointsArray.d.ts +0 -30
- package/dist/types/utilities/contours/PointsArray.d.ts.map +0 -1
- package/src/utilities/contours/PointsArray.ts +0 -165
|
@@ -105,45 +105,47 @@ export class LivewireScissors {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
109
|
-
* This will remove points, up to count which have a high gradient, up to
|
|
110
|
-
* count of them where the clip value is larger than that provided.
|
|
108
|
+
* Finds a nearby point with a minimum cost nearby
|
|
111
109
|
*
|
|
112
|
-
* @
|
|
110
|
+
* @param testPoint - to look nearby
|
|
111
|
+
* @param delta - how long a distance to look
|
|
112
|
+
* @returns A point having the minimum weighted distance from the testPoint
|
|
113
113
|
*/
|
|
114
|
-
public
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
114
|
+
public findMinNearby(testPoint: Types.Point2, delta = 2) {
|
|
115
|
+
const [x, y] = testPoint;
|
|
116
|
+
const { costs } = this;
|
|
117
|
+
|
|
118
|
+
const xRange = [
|
|
119
|
+
Math.max(0, x - delta),
|
|
120
|
+
Math.min(x + delta + 1, this.width),
|
|
121
|
+
];
|
|
122
|
+
const yRange = [
|
|
123
|
+
Math.max(0, y - delta),
|
|
124
|
+
Math.min(y + delta + 1, this.height),
|
|
125
|
+
];
|
|
126
|
+
let minValue = costs[this._getPointIndex(y, x)] * 0.8;
|
|
127
|
+
|
|
128
|
+
let minPoint = testPoint;
|
|
129
|
+
for (let xTest = xRange[0]; xTest < xRange[1]; xTest++) {
|
|
130
|
+
for (let yTest = yRange[0]; yTest < yRange[1]; yTest++) {
|
|
131
|
+
// Cost values are 0...1, with 1 being a poor choice for the
|
|
132
|
+
// livewire fitting - thus, we want to minimize our value, so the
|
|
133
|
+
// distance cost should be low for the center point.
|
|
134
|
+
const distanceCost =
|
|
135
|
+
1 -
|
|
136
|
+
(Math.abs(xTest - testPoint[0]) + Math.abs(yTest - testPoint[1])) /
|
|
137
|
+
delta /
|
|
138
|
+
2;
|
|
139
|
+
const weightCost = costs[this._getPointIndex(yTest, xTest)];
|
|
140
|
+
|
|
141
|
+
const weight = weightCost * 0.8 + distanceCost * 0.2;
|
|
142
|
+
if (weight < minValue) {
|
|
143
|
+
minPoint = [xTest, yTest];
|
|
144
|
+
minValue = weight;
|
|
145
|
+
}
|
|
141
146
|
}
|
|
142
|
-
removeCount++;
|
|
143
147
|
}
|
|
144
|
-
|
|
145
|
-
// along a high gradient.
|
|
146
|
-
return 0;
|
|
148
|
+
return minPoint;
|
|
147
149
|
}
|
|
148
150
|
|
|
149
151
|
/**
|
|
@@ -281,7 +283,7 @@ export class LivewireScissors {
|
|
|
281
283
|
|
|
282
284
|
// If it is at the end, back up one
|
|
283
285
|
if (y + 1 === height) {
|
|
284
|
-
index -=
|
|
286
|
+
index -= width;
|
|
285
287
|
}
|
|
286
288
|
|
|
287
289
|
return data[index] - data[index + width];
|
|
@@ -420,14 +422,9 @@ export class LivewireScissors {
|
|
|
420
422
|
let pixelIndex = 0;
|
|
421
423
|
|
|
422
424
|
for (let y = 0; y < height; y++) {
|
|
423
|
-
for (let x = 0; x < width
|
|
425
|
+
for (let x = 0; x < width; x++) {
|
|
424
426
|
gradX[pixelIndex++] = this._getDeltaX(x, y);
|
|
425
427
|
}
|
|
426
|
-
|
|
427
|
-
// Make the last column the same as the previous one because there is
|
|
428
|
-
// no way to calculate `dx` since x+1 gets out of bounds
|
|
429
|
-
gradX[pixelIndex] = gradX[pixelIndex - 1];
|
|
430
|
-
pixelIndex++;
|
|
431
428
|
}
|
|
432
429
|
|
|
433
430
|
return gradX;
|
|
@@ -444,18 +441,12 @@ export class LivewireScissors {
|
|
|
444
441
|
const gradY = new Float32Array(width * height);
|
|
445
442
|
let pixelIndex = 0;
|
|
446
443
|
|
|
447
|
-
for (let y = 0; y < height
|
|
444
|
+
for (let y = 0; y < height; y++) {
|
|
448
445
|
for (let x = 0; x < width; x++) {
|
|
449
446
|
gradY[pixelIndex++] = this._getDeltaY(x, y);
|
|
450
447
|
}
|
|
451
448
|
}
|
|
452
449
|
|
|
453
|
-
// Make the last row the same as the previous one because there is
|
|
454
|
-
// no way to calculate `dy` since y+1 gets out of bounds
|
|
455
|
-
for (let len = gradY.length; pixelIndex < len; pixelIndex++) {
|
|
456
|
-
gradY[pixelIndex] = gradY[pixelIndex - width];
|
|
457
|
-
}
|
|
458
|
-
|
|
459
450
|
return gradY;
|
|
460
451
|
}
|
|
461
452
|
|
|
@@ -481,7 +472,7 @@ export class LivewireScissors {
|
|
|
481
472
|
}
|
|
482
473
|
|
|
483
474
|
/**
|
|
484
|
-
* Compute the
|
|
475
|
+
* Compute the gradient direction, in radians, between two points
|
|
485
476
|
*
|
|
486
477
|
* @param px - Point `p` x-coordinate of point p.
|
|
487
478
|
* @param py - Point `p` y-coordinate of point p.
|
|
@@ -506,23 +497,44 @@ export class LivewireScissors {
|
|
|
506
497
|
dp = -dp;
|
|
507
498
|
dq = -dq;
|
|
508
499
|
}
|
|
509
|
-
|
|
510
500
|
if (px !== qx && py !== qy) {
|
|
511
501
|
// It's going diagonally between pixels
|
|
512
502
|
dp *= Math.SQRT1_2;
|
|
513
503
|
dq *= Math.SQRT1_2;
|
|
514
504
|
}
|
|
505
|
+
dq = Math.min(Math.max(dq, -1), 1);
|
|
506
|
+
|
|
507
|
+
const direction =
|
|
508
|
+
TWO_THIRD_PI * (Math.acos(Math.min(dp, 1)) + Math.acos(dq));
|
|
509
|
+
if (isNaN(direction) || !isFinite(direction)) {
|
|
510
|
+
console.warn('Found non-direction:', px, py, qx, qy, dp, dq, direction);
|
|
511
|
+
return 1;
|
|
512
|
+
}
|
|
513
|
+
return direction;
|
|
514
|
+
}
|
|
515
515
|
|
|
516
|
-
|
|
516
|
+
/** Gets the cost to go from A to B */
|
|
517
|
+
public getCost(pointA, pointB): number {
|
|
518
|
+
return this._getWeightedDistance(pointA, pointB);
|
|
517
519
|
}
|
|
518
520
|
|
|
519
521
|
/**
|
|
520
522
|
* Return a weighted distance between two points
|
|
521
523
|
*/
|
|
522
524
|
private _getWeightedDistance(pointA: Types.Point2, pointB: Types.Point2) {
|
|
523
|
-
const { _getPointIndex: index } = this;
|
|
525
|
+
const { _getPointIndex: index, width, height } = this;
|
|
524
526
|
const [aX, aY] = pointA;
|
|
525
527
|
const [bX, bY] = pointB;
|
|
528
|
+
// Assign a cost of 1 to any points outside the image, prevents using invalid
|
|
529
|
+
// points
|
|
530
|
+
if (bX < 0 || bX >= width || bY < 0 || bY >= height) {
|
|
531
|
+
return 1;
|
|
532
|
+
}
|
|
533
|
+
// Use a cost of 0 if the point was outside and is now going inside
|
|
534
|
+
if (aX < 0 || aY < 0 || aX >= width || aY >= height) {
|
|
535
|
+
return 0;
|
|
536
|
+
}
|
|
537
|
+
|
|
526
538
|
const bIndex = index(bY, bX);
|
|
527
539
|
|
|
528
540
|
// Weighted distance function
|
|
@@ -10,7 +10,7 @@ import isClosed from './isClosed';
|
|
|
10
10
|
*
|
|
11
11
|
* @param polyline - Polyline points (2D)
|
|
12
12
|
* @param point - 2D Point
|
|
13
|
-
* @returns True
|
|
13
|
+
* @returns True if the point is inside the polyline or false otherwise
|
|
14
14
|
*/
|
|
15
15
|
export default function containsPoint(
|
|
16
16
|
polyline: Types.Point2[],
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import containsPoint from './containsPoint';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Checks if a polyline contains a set of points.
|
|
6
|
+
*
|
|
7
|
+
* @param polyline - Polyline points (2D)
|
|
8
|
+
* @param points - 2D points to verify
|
|
9
|
+
* @returns True if all points are inside the polyline or false otherwise
|
|
10
|
+
*/
|
|
11
|
+
export default function containsPoints(
|
|
12
|
+
polyline: Types.Point2[],
|
|
13
|
+
points: Types.Point2[]
|
|
14
|
+
): boolean {
|
|
15
|
+
for (let i = 0, numPoint = points.length; i < numPoint; i++) {
|
|
16
|
+
if (!containsPoint(polyline, points[i])) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Types } from '@cornerstonejs/core';
|
|
2
|
+
import getSignedArea from './getSignedArea';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Calculate the winding direction (CW or CCW) of a polyline
|
|
6
|
+
* @param polyline - Polyline (2D)
|
|
7
|
+
* @returns 1 for CW or -1 for CCW polylines
|
|
8
|
+
*/
|
|
9
|
+
export default function getWindingDirection(polyline: Types.Point2[]): number {
|
|
10
|
+
const signedArea = getSignedArea(polyline);
|
|
11
|
+
|
|
12
|
+
// Return 1 or -1 which is also possible to convert into ContourOrientation
|
|
13
|
+
return signedArea >= 0 ? 1 : -1;
|
|
14
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import isClosed from './isClosed';
|
|
2
2
|
import containsPoint from './containsPoint';
|
|
3
|
+
import containsPoints from './containsPoints';
|
|
3
4
|
import getAABB from './getAABB';
|
|
4
5
|
import getArea from './getArea';
|
|
5
6
|
import getSignedArea from './getSignedArea';
|
|
7
|
+
import getWindingDirection from './getWindingDirection';
|
|
6
8
|
import getNormal3 from './getNormal3';
|
|
7
9
|
import getNormal2 from './getNormal2';
|
|
8
10
|
import { mergePolylines, subtractPolylines } from './combinePolyline';
|
|
@@ -19,9 +21,11 @@ import pointCanProjectOnLine from './pointCanProjectOnLine';
|
|
|
19
21
|
export {
|
|
20
22
|
isClosed,
|
|
21
23
|
containsPoint,
|
|
24
|
+
containsPoints,
|
|
22
25
|
getAABB,
|
|
23
26
|
getArea,
|
|
24
27
|
getSignedArea,
|
|
28
|
+
getWindingDirection,
|
|
25
29
|
getNormal3,
|
|
26
30
|
getNormal2,
|
|
27
31
|
intersectPolyline,
|
|
@@ -20,6 +20,11 @@ import getViewportForAnnotation from '../../getViewportForAnnotation';
|
|
|
20
20
|
|
|
21
21
|
const { uuidv4 } = csUtils;
|
|
22
22
|
|
|
23
|
+
const ChangeTypesForInterpolation = [
|
|
24
|
+
ChangeTypes.HandlesUpdated,
|
|
25
|
+
ChangeTypes.InterpolationUpdated,
|
|
26
|
+
];
|
|
27
|
+
|
|
23
28
|
export default class InterpolationManager {
|
|
24
29
|
static toolNames = [];
|
|
25
30
|
|
|
@@ -31,13 +36,35 @@ export default class InterpolationManager {
|
|
|
31
36
|
|
|
32
37
|
/**
|
|
33
38
|
* Accepts the autogenerated interpolations, marking them as non-autogenerated.
|
|
34
|
-
* Can provide a selector to choose which ones to accept
|
|
39
|
+
* Can provide a selector to choose which ones to accept.
|
|
40
|
+
*
|
|
41
|
+
* Rules for which items to select:
|
|
42
|
+
* 1. Only choose annotations having the same segment index and segmentationID
|
|
43
|
+
* 2. Exclude all contours having the same interpolation UID as any other contours
|
|
44
|
+
* on the same slice.
|
|
45
|
+
* 3. Exclude autogenerated annotations
|
|
46
|
+
* 4. Exclude any reset interpolationUIDs (this is a manual operation to allow
|
|
47
|
+
* creating a new interpolation)
|
|
48
|
+
* 5. Find the set of interpolationUID's remaining
|
|
49
|
+
* a. If the set is of size 0, assign a new interpolationUID
|
|
50
|
+
* b. If the set is of size 1, assign that interpolationUID
|
|
51
|
+
* c. Otherwise (optional, otherwise do b for size>1 randomly),
|
|
52
|
+
* for every remaining annotation, find the one whose center
|
|
53
|
+
* point is closest to the center point of the new annotation.
|
|
54
|
+
* Choose that interpolationUID
|
|
55
|
+
*
|
|
56
|
+
* To allow creating new interpolated groups, the idea is to just use a new
|
|
57
|
+
* segment index, then have an operation to update the segment index of an
|
|
58
|
+
* interpolation set. That way the user can easily draw/see the difference,
|
|
59
|
+
* and then merge them as required.
|
|
60
|
+
* However, the base rules allow creating two contours on a single image to
|
|
61
|
+
* create a separate set.
|
|
35
62
|
*/
|
|
36
63
|
static acceptAutoGenerated(
|
|
37
64
|
annotationGroupSelector: AnnotationGroupSelector,
|
|
38
65
|
selector: AcceptInterpolationSelector = {}
|
|
39
66
|
) {
|
|
40
|
-
const { toolNames, segmentationId, segmentIndex } = selector;
|
|
67
|
+
const { toolNames, segmentationId, segmentIndex, sliceIndex } = selector;
|
|
41
68
|
for (const toolName of toolNames || InterpolationManager.toolNames) {
|
|
42
69
|
const annotations = annotationState.getAnnotations(
|
|
43
70
|
toolName,
|
|
@@ -47,13 +74,20 @@ export default class InterpolationManager {
|
|
|
47
74
|
continue;
|
|
48
75
|
}
|
|
49
76
|
for (const annotation of annotations) {
|
|
50
|
-
const { data, autoGenerated } = annotation;
|
|
77
|
+
const { data, autoGenerated, metadata } = annotation;
|
|
51
78
|
if (!autoGenerated) {
|
|
52
79
|
continue;
|
|
53
80
|
}
|
|
54
81
|
if (segmentIndex && segmentIndex !== data.segmentation.segmentIndex) {
|
|
55
82
|
continue;
|
|
56
83
|
}
|
|
84
|
+
if (
|
|
85
|
+
sliceIndex !== undefined &&
|
|
86
|
+
metadata &&
|
|
87
|
+
sliceIndex !== (metadata as any).referencedSliceIndex
|
|
88
|
+
) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
57
91
|
if (
|
|
58
92
|
segmentationId &&
|
|
59
93
|
segmentationId !== data.segmentation.segmentationId
|
|
@@ -141,7 +175,7 @@ export default class InterpolationManager {
|
|
|
141
175
|
|
|
142
176
|
if (
|
|
143
177
|
!this.toolNames.includes(toolName) ||
|
|
144
|
-
changeType
|
|
178
|
+
!ChangeTypesForInterpolation.includes(changeType)
|
|
145
179
|
) {
|
|
146
180
|
return;
|
|
147
181
|
}
|
|
@@ -162,6 +196,7 @@ export default class InterpolationManager {
|
|
|
162
196
|
sliceData,
|
|
163
197
|
annotation,
|
|
164
198
|
interpolationUID: annotation.interpolationUID,
|
|
199
|
+
isInterpolationUpdate: changeType === ChangeTypes.InterpolationUpdated,
|
|
165
200
|
};
|
|
166
201
|
interpolate(viewportData);
|
|
167
202
|
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { Types } from '@cornerstonejs/core';
|
|
2
|
-
export declare type PolyDataPointConfiguration = {
|
|
3
|
-
dimensions?: 2 | 3;
|
|
4
|
-
initialSize?: number;
|
|
5
|
-
};
|
|
6
|
-
export declare abstract class PointsArray<T> {
|
|
7
|
-
data: Float32Array;
|
|
8
|
-
dimensions: number;
|
|
9
|
-
length: number;
|
|
10
|
-
constructor(configuration?: PolyDataPointConfiguration);
|
|
11
|
-
protected forEach(func: (value: T, index: number) => void, point: T): void;
|
|
12
|
-
abstract getPoint(index: number, point: T): T;
|
|
13
|
-
reverse(): void;
|
|
14
|
-
protected map(f: (value: any, index: number) => T, factory: (index: number) => T): any[];
|
|
15
|
-
static fromXYZ({ x, y, z }: Types.PointsXYZ): PointsArray3;
|
|
16
|
-
}
|
|
17
|
-
export declare class PointsArray2 extends PointsArray<Types.Point2> {
|
|
18
|
-
constructor(configuration?: {});
|
|
19
|
-
forEach(func: (value: Types.Point2, index: number) => void, point?: Types.Point2): void;
|
|
20
|
-
getPoint(index: number, point?: Types.Point2): Types.Point2;
|
|
21
|
-
get points(): any[];
|
|
22
|
-
}
|
|
23
|
-
export declare class PointsArray3 extends PointsArray<Types.Point3> {
|
|
24
|
-
constructor(configuration?: {});
|
|
25
|
-
forEach(func: (value: Types.Point3, index: number) => void, point?: Types.Point3): void;
|
|
26
|
-
getPoint(index: number, point?: Types.Point3): Types.Point3;
|
|
27
|
-
get points(): any[];
|
|
28
|
-
getXYZ(): Types.PointsXYZ;
|
|
29
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PointsArray3 = exports.PointsArray2 = exports.PointsArray = void 0;
|
|
4
|
-
const gl_matrix_1 = require("gl-matrix");
|
|
5
|
-
class PointsArray {
|
|
6
|
-
constructor(configuration = {}) {
|
|
7
|
-
this.dimensions = 3;
|
|
8
|
-
this.length = 0;
|
|
9
|
-
const { initialSize = 1024, dimensions = 3 } = configuration;
|
|
10
|
-
this.data = new Float32Array(initialSize * dimensions);
|
|
11
|
-
this.dimensions = dimensions;
|
|
12
|
-
}
|
|
13
|
-
forEach(func, point) {
|
|
14
|
-
for (let i = 0; i < this.length; i++) {
|
|
15
|
-
func(this.getPoint(i, point), i);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
reverse() {
|
|
19
|
-
const midLength = Math.floor(this.length / 2);
|
|
20
|
-
for (let i = 0; i < midLength; i++) {
|
|
21
|
-
const indexStart = i * this.dimensions;
|
|
22
|
-
const indexEnd = (this.length - 1 - i) * this.dimensions;
|
|
23
|
-
for (let dimension = 0; dimension < this.dimensions; dimension++) {
|
|
24
|
-
const valueStart = this.data[indexStart + dimension];
|
|
25
|
-
this.data[indexStart + dimension] = this.data[indexEnd + dimension];
|
|
26
|
-
this.data[indexEnd + dimension] = valueStart;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
map(f, factory) {
|
|
31
|
-
const mapData = [];
|
|
32
|
-
for (let i = 0; i < this.length; i++) {
|
|
33
|
-
mapData.push(f(this.getPoint(i, factory(i)), i));
|
|
34
|
-
}
|
|
35
|
-
return mapData;
|
|
36
|
-
}
|
|
37
|
-
static fromXYZ({ x, y, z }) {
|
|
38
|
-
const array = new PointsArray3({ initialSize: x.length });
|
|
39
|
-
let offset = 0;
|
|
40
|
-
for (let i = 0; i < x.length; i++) {
|
|
41
|
-
array.data[offset++] = x[i];
|
|
42
|
-
array.data[offset++] = y[i];
|
|
43
|
-
array.data[offset++] = z[i];
|
|
44
|
-
}
|
|
45
|
-
array.length = x.length;
|
|
46
|
-
return array;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.PointsArray = PointsArray;
|
|
50
|
-
class PointsArray2 extends PointsArray {
|
|
51
|
-
constructor(configuration = {}) {
|
|
52
|
-
super(Object.assign(Object.assign({}, configuration), { dimensions: 2 }));
|
|
53
|
-
}
|
|
54
|
-
forEach(func, point = gl_matrix_1.vec2.create()) {
|
|
55
|
-
super.forEach(func, point);
|
|
56
|
-
}
|
|
57
|
-
getPoint(index, point = gl_matrix_1.vec2.create()) {
|
|
58
|
-
if (index >= this.length) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const index2 = index * 2;
|
|
62
|
-
point[0] = this.data[index2];
|
|
63
|
-
point[1] = this.data[index2 + 1];
|
|
64
|
-
return point;
|
|
65
|
-
}
|
|
66
|
-
get points() {
|
|
67
|
-
return this.map((point) => point, () => gl_matrix_1.vec2.create());
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.PointsArray2 = PointsArray2;
|
|
71
|
-
class PointsArray3 extends PointsArray {
|
|
72
|
-
constructor(configuration = {}) {
|
|
73
|
-
super(Object.assign(Object.assign({}, configuration), { dimensions: 3 }));
|
|
74
|
-
}
|
|
75
|
-
forEach(func, point = gl_matrix_1.vec3.create()) {
|
|
76
|
-
super.forEach(func, point);
|
|
77
|
-
}
|
|
78
|
-
getPoint(index, point = gl_matrix_1.vec3.create()) {
|
|
79
|
-
if (index >= this.length) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const index2 = index * 3;
|
|
83
|
-
point[0] = this.data[index2];
|
|
84
|
-
point[1] = this.data[index2 + 1];
|
|
85
|
-
point[2] = this.data[index2 + 2];
|
|
86
|
-
return point;
|
|
87
|
-
}
|
|
88
|
-
get points() {
|
|
89
|
-
return this.map((point) => point, () => gl_matrix_1.vec3.create());
|
|
90
|
-
}
|
|
91
|
-
getXYZ() {
|
|
92
|
-
const x = [];
|
|
93
|
-
const y = [];
|
|
94
|
-
const z = [];
|
|
95
|
-
this.forEach((point) => {
|
|
96
|
-
x.push(point[0]);
|
|
97
|
-
y.push(point[1]);
|
|
98
|
-
z.push(point[2]);
|
|
99
|
-
});
|
|
100
|
-
return { x, y, z };
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
exports.PointsArray3 = PointsArray3;
|
|
104
|
-
//# sourceMappingURL=PointsArray.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PointsArray.js","sourceRoot":"","sources":["../../../../src/utilities/contours/PointsArray.ts"],"names":[],"mappings":";;;AACA,yCAAuC;AAevC,MAAsB,WAAW;IAK/B,YAAY,gBAA4C,EAAE;QAH1D,eAAU,GAAG,CAAC,CAAC;QACR,WAAM,GAAG,CAAC,CAAC;QAGhB,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,aAAa,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAES,OAAO,CAAC,IAAuC,EAAE,KAAQ;QACjE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC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AAE,CAAC;QACb,MAAM,CAAC,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACrB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACrB,CAAC;CACF;AAzCD,oCAyCC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { vec2, vec3 } from 'gl-matrix';
|
|
2
|
-
export class PointsArray {
|
|
3
|
-
constructor(configuration = {}) {
|
|
4
|
-
this.dimensions = 3;
|
|
5
|
-
this.length = 0;
|
|
6
|
-
const { initialSize = 1024, dimensions = 3 } = configuration;
|
|
7
|
-
this.data = new Float32Array(initialSize * dimensions);
|
|
8
|
-
this.dimensions = dimensions;
|
|
9
|
-
}
|
|
10
|
-
forEach(func, point) {
|
|
11
|
-
for (let i = 0; i < this.length; i++) {
|
|
12
|
-
func(this.getPoint(i, point), i);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
reverse() {
|
|
16
|
-
const midLength = Math.floor(this.length / 2);
|
|
17
|
-
for (let i = 0; i < midLength; i++) {
|
|
18
|
-
const indexStart = i * this.dimensions;
|
|
19
|
-
const indexEnd = (this.length - 1 - i) * this.dimensions;
|
|
20
|
-
for (let dimension = 0; dimension < this.dimensions; dimension++) {
|
|
21
|
-
const valueStart = this.data[indexStart + dimension];
|
|
22
|
-
this.data[indexStart + dimension] = this.data[indexEnd + dimension];
|
|
23
|
-
this.data[indexEnd + dimension] = valueStart;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
map(f, factory) {
|
|
28
|
-
const mapData = [];
|
|
29
|
-
for (let i = 0; i < this.length; i++) {
|
|
30
|
-
mapData.push(f(this.getPoint(i, factory(i)), i));
|
|
31
|
-
}
|
|
32
|
-
return mapData;
|
|
33
|
-
}
|
|
34
|
-
static fromXYZ({ x, y, z }) {
|
|
35
|
-
const array = new PointsArray3({ initialSize: x.length });
|
|
36
|
-
let offset = 0;
|
|
37
|
-
for (let i = 0; i < x.length; i++) {
|
|
38
|
-
array.data[offset++] = x[i];
|
|
39
|
-
array.data[offset++] = y[i];
|
|
40
|
-
array.data[offset++] = z[i];
|
|
41
|
-
}
|
|
42
|
-
array.length = x.length;
|
|
43
|
-
return array;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export class PointsArray2 extends PointsArray {
|
|
47
|
-
constructor(configuration = {}) {
|
|
48
|
-
super({ ...configuration, dimensions: 2 });
|
|
49
|
-
}
|
|
50
|
-
forEach(func, point = vec2.create()) {
|
|
51
|
-
super.forEach(func, point);
|
|
52
|
-
}
|
|
53
|
-
getPoint(index, point = vec2.create()) {
|
|
54
|
-
if (index >= this.length) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const index2 = index * 2;
|
|
58
|
-
point[0] = this.data[index2];
|
|
59
|
-
point[1] = this.data[index2 + 1];
|
|
60
|
-
return point;
|
|
61
|
-
}
|
|
62
|
-
get points() {
|
|
63
|
-
return this.map((point) => point, () => vec2.create());
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
export class PointsArray3 extends PointsArray {
|
|
67
|
-
constructor(configuration = {}) {
|
|
68
|
-
super({ ...configuration, dimensions: 3 });
|
|
69
|
-
}
|
|
70
|
-
forEach(func, point = vec3.create()) {
|
|
71
|
-
super.forEach(func, point);
|
|
72
|
-
}
|
|
73
|
-
getPoint(index, point = vec3.create()) {
|
|
74
|
-
if (index >= this.length) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const index2 = index * 3;
|
|
78
|
-
point[0] = this.data[index2];
|
|
79
|
-
point[1] = this.data[index2 + 1];
|
|
80
|
-
point[2] = this.data[index2 + 2];
|
|
81
|
-
return point;
|
|
82
|
-
}
|
|
83
|
-
get points() {
|
|
84
|
-
return this.map((point) => point, () => vec3.create());
|
|
85
|
-
}
|
|
86
|
-
getXYZ() {
|
|
87
|
-
const x = [];
|
|
88
|
-
const y = [];
|
|
89
|
-
const z = [];
|
|
90
|
-
this.forEach((point) => {
|
|
91
|
-
x.push(point[0]);
|
|
92
|
-
y.push(point[1]);
|
|
93
|
-
z.push(point[2]);
|
|
94
|
-
});
|
|
95
|
-
return { x, y, z };
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=PointsArray.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PointsArray.js","sourceRoot":"","sources":["../../../../src/utilities/contours/PointsArray.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAevC,MAAM,OAAgB,WAAW;IAK/B,YAAY,gBAA4C,EAAE;QAH1D,eAAU,GAAG,CAAC,CAAC;QACR,WAAM,GAAG,CAAC,CAAC;QAGhB,MAAM,EAAE,WAAW,GAAG,IAAI,EAAE,UAAU,GAAG,CAAC,EAAE,GAAG,aAAa,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,IAAI,YAAY,CAAC,WAAW,GAAG,UAAU,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAES,OAAO,CAAC,IAAuC,EAAE,KAAQ;QACjE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;SAClC;IACH,CAAC;IAOM,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,CA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AC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACjB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Types } from '@cornerstonejs/core';
|
|
2
|
-
export declare type PolyDataPointConfiguration = {
|
|
3
|
-
dimensions?: 2 | 3;
|
|
4
|
-
initialSize?: number;
|
|
5
|
-
};
|
|
6
|
-
export declare abstract class PointsArray<T> {
|
|
7
|
-
data: Float32Array;
|
|
8
|
-
dimensions: number;
|
|
9
|
-
length: number;
|
|
10
|
-
constructor(configuration?: PolyDataPointConfiguration);
|
|
11
|
-
protected forEach(func: (value: T, index: number) => void, point: T): void;
|
|
12
|
-
abstract getPoint(index: number, point: T): T;
|
|
13
|
-
reverse(): void;
|
|
14
|
-
protected map(f: (value: any, index: number) => T, factory: (index: number) => T): any[];
|
|
15
|
-
static fromXYZ({ x, y, z }: Types.PointsXYZ): PointsArray3;
|
|
16
|
-
}
|
|
17
|
-
export declare class PointsArray2 extends PointsArray<Types.Point2> {
|
|
18
|
-
constructor(configuration?: {});
|
|
19
|
-
forEach(func: (value: Types.Point2, index: number) => void, point?: Types.Point2): void;
|
|
20
|
-
getPoint(index: number, point?: Types.Point2): Types.Point2;
|
|
21
|
-
get points(): any[];
|
|
22
|
-
}
|
|
23
|
-
export declare class PointsArray3 extends PointsArray<Types.Point3> {
|
|
24
|
-
constructor(configuration?: {});
|
|
25
|
-
forEach(func: (value: Types.Point3, index: number) => void, point?: Types.Point3): void;
|
|
26
|
-
getPoint(index: number, point?: Types.Point3): Types.Point3;
|
|
27
|
-
get points(): any[];
|
|
28
|
-
getXYZ(): Types.PointsXYZ;
|
|
29
|
-
}
|
|
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