@cornerstonejs/tools 1.57.1 → 1.58.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.js +1 -1
- package/dist/cjs/drawingSvg/drawPath.js.map +1 -1
- package/dist/cjs/enums/WorkerTypes.d.ts +1 -1
- package/dist/cjs/enums/WorkerTypes.js +1 -1
- package/dist/cjs/enums/WorkerTypes.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.d.ts +17 -0
- package/dist/cjs/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.js +112 -0
- package/dist/cjs/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +3 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +4 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.d.ts +8 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js +121 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts +3 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js +73 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.d.ts +3 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.js +25 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.d.ts +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.js +41 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.js.map +1 -0
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +2 -2
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +1 -1
- package/dist/cjs/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -1
- package/dist/cjs/stateManagement/segmentation/triggerSegmentationEvents.js +2 -0
- package/dist/cjs/stateManagement/segmentation/triggerSegmentationEvents.js.map +1 -1
- package/dist/cjs/store/ToolGroupManager/getToolGroupForViewport.d.ts +1 -1
- package/dist/cjs/store/ToolGroupManager/getToolGroupForViewport.js +5 -0
- package/dist/cjs/store/ToolGroupManager/getToolGroupForViewport.js.map +1 -1
- package/dist/cjs/tools/annotation/SplineROITool.js +25 -20
- package/dist/cjs/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/cjs/tools/base/BaseTool.js +3 -0
- package/dist/cjs/tools/base/BaseTool.js.map +1 -1
- package/dist/cjs/tools/base/ContourSegmentationBaseTool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Contour/contourDisplay.js +13 -5
- package/dist/cjs/tools/displayTools/Contour/contourDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js +1 -1
- package/dist/cjs/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.d.ts +1 -0
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js +17 -0
- package/dist/cjs/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +4 -47
- package/dist/cjs/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -1
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.d.ts +3 -9
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js +7 -148
- package/dist/cjs/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
- package/dist/cjs/types/PolySeg.d.ts +1 -1
- package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js +4 -1
- package/dist/cjs/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -1
- package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +3 -0
- package/dist/cjs/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -1
- package/dist/cjs/utilities/math/polyline/getAABB.d.ts +3 -1
- package/dist/cjs/utilities/math/polyline/getAABB.js +30 -4
- package/dist/cjs/utilities/math/polyline/getAABB.js.map +1 -1
- package/dist/cjs/utilities/planar/index.d.ts +3 -1
- package/dist/cjs/utilities/planar/index.js +4 -1
- package/dist/cjs/utilities/planar/index.js.map +1 -1
- package/dist/cjs/utilities/planar/isPlaneIntersectingAABB.d.ts +1 -0
- package/dist/cjs/utilities/planar/isPlaneIntersectingAABB.js +32 -0
- package/dist/cjs/utilities/planar/isPlaneIntersectingAABB.js.map +1 -0
- package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.d.ts +3 -1
- package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js +97 -47
- package/dist/cjs/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -1
- package/dist/cjs/workers/polySegConverters.js +73 -0
- package/dist/cjs/workers/polySegConverters.js.map +1 -1
- package/dist/esm/drawingSvg/drawPath.js +1 -1
- package/dist/esm/drawingSvg/drawPath.js.map +1 -1
- package/dist/esm/enums/WorkerTypes.js +1 -1
- package/dist/esm/enums/WorkerTypes.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.js +91 -0
- package/dist/esm/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js +4 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js +105 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js +72 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.js +21 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.js +26 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.js.map +1 -0
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js +2 -2
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js +1 -1
- package/dist/esm/stateManagement/segmentation/polySeg/computeAndAddRepresentation.js.map +1 -1
- package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.js +2 -0
- package/dist/esm/stateManagement/segmentation/triggerSegmentationEvents.js.map +1 -1
- package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.js +4 -0
- package/dist/esm/store/ToolGroupManager/getToolGroupForViewport.js.map +1 -1
- package/dist/esm/tools/annotation/SplineROITool.js +25 -20
- package/dist/esm/tools/annotation/SplineROITool.js.map +1 -1
- package/dist/esm/tools/base/BaseTool.js +3 -0
- package/dist/esm/tools/base/BaseTool.js.map +1 -1
- package/dist/esm/tools/base/ContourSegmentationBaseTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js +13 -5
- package/dist/esm/tools/displayTools/Contour/contourDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js +1 -1
- package/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js.map +1 -1
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js +17 -0
- package/dist/esm/tools/displayTools/SegmentationDisplayTool.js.map +1 -1
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js +3 -46
- package/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js.map +1 -1
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js +8 -139
- package/dist/esm/tools/displayTools/Surface/surfaceDisplay.js.map +1 -1
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js +4 -1
- package/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js.map +1 -1
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js +3 -0
- package/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js.map +1 -1
- package/dist/esm/utilities/math/polyline/getAABB.js +30 -4
- package/dist/esm/utilities/math/polyline/getAABB.js.map +1 -1
- package/dist/esm/utilities/planar/index.js +3 -1
- package/dist/esm/utilities/planar/index.js.map +1 -1
- package/dist/esm/utilities/planar/isPlaneIntersectingAABB.js +28 -0
- package/dist/esm/utilities/planar/isPlaneIntersectingAABB.js.map +1 -0
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js +92 -44
- package/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js.map +1 -1
- package/dist/esm/workers/polySegConverters.js +74 -1
- package/dist/esm/workers/polySegConverters.js.map +1 -1
- package/dist/types/drawingSvg/drawPath.d.ts.map +1 -1
- package/dist/types/enums/WorkerTypes.d.ts +1 -1
- package/dist/types/enums/WorkerTypes.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.d.ts +18 -0
- package/dist/types/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts +3 -1
- package/dist/types/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.d.ts +9 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts +4 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.d.ts +4 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.d.ts +2 -0
- package/dist/types/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.d.ts.map +1 -0
- package/dist/types/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.d.ts.map +1 -1
- package/dist/types/stateManagement/segmentation/triggerSegmentationEvents.d.ts.map +1 -1
- package/dist/types/store/ToolGroupManager/getToolGroupForViewport.d.ts +1 -1
- package/dist/types/store/ToolGroupManager/getToolGroupForViewport.d.ts.map +1 -1
- package/dist/types/tools/annotation/SplineROITool.d.ts.map +1 -1
- package/dist/types/tools/base/BaseTool.d.ts.map +1 -1
- 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/SegmentationDisplayTool.d.ts +1 -0
- package/dist/types/tools/displayTools/SegmentationDisplayTool.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Surface/addOrUpdateSurfaceToElement.d.ts.map +1 -1
- package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts +3 -9
- package/dist/types/tools/displayTools/Surface/surfaceDisplay.d.ts.map +1 -1
- package/dist/types/types/PolySeg.d.ts +1 -1
- package/dist/types/types/PolySeg.d.ts.map +1 -1
- package/dist/types/utilities/contourSegmentation/addContourSegmentationAnnotation.d.ts.map +1 -1
- package/dist/types/utilities/contourSegmentation/removeContourSegmentationAnnotation.d.ts.map +1 -1
- package/dist/types/utilities/math/polyline/getAABB.d.ts +3 -1
- package/dist/types/utilities/math/polyline/getAABB.d.ts.map +1 -1
- package/dist/types/utilities/planar/index.d.ts +3 -1
- package/dist/types/utilities/planar/index.d.ts.map +1 -1
- package/dist/types/utilities/planar/isPlaneIntersectingAABB.d.ts +2 -0
- package/dist/types/utilities/planar/isPlaneIntersectingAABB.d.ts.map +1 -0
- package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts +3 -1
- package/dist/types/utilities/segmentation/getUniqueSegmentIndices.d.ts.map +1 -1
- package/dist/umd/985.index.js +1 -1
- package/dist/umd/985.index.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +4 -4
- package/src/drawingSvg/drawPath.ts +3 -1
- package/src/enums/WorkerTypes.ts +1 -1
- package/src/stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport.ts +203 -0
- package/src/stateManagement/segmentation/polySeg/Contour/computeAndAddContourRepresentation.ts +9 -2
- package/src/stateManagement/segmentation/polySeg/Contour/contourComputationStrategies.ts +201 -0
- package/src/stateManagement/segmentation/polySeg/Contour/utils/createAndAddContourSegmentationsFromClippedSurfaces.ts +103 -0
- package/src/stateManagement/segmentation/polySeg/Contour/utils/extractContourData.ts +38 -0
- package/src/stateManagement/segmentation/polySeg/Contour/utils/updateContoursOnCameraModified.ts +58 -0
- package/src/stateManagement/segmentation/polySeg/Labelmap/convertContourToLabelmap.ts +2 -2
- package/src/stateManagement/segmentation/polySeg/Labelmap/convertSurfaceToLabelmap.ts +1 -1
- package/src/stateManagement/segmentation/polySeg/Labelmap/labelmapComputationStrategies.ts +3 -8
- package/src/stateManagement/segmentation/polySeg/Surface/convertContourToSurface.ts +1 -1
- package/src/stateManagement/segmentation/polySeg/Surface/convertLabelmapToSurface.ts +1 -1
- package/src/stateManagement/segmentation/polySeg/computeAndAddRepresentation.ts +1 -1
- package/src/stateManagement/segmentation/triggerSegmentationEvents.ts +5 -0
- package/src/store/ToolGroupManager/getToolGroupForViewport.ts +8 -1
- package/src/tools/annotation/SplineROITool.ts +34 -27
- package/src/tools/base/BaseTool.ts +7 -0
- package/src/tools/base/ContourSegmentationBaseTool.ts +5 -0
- package/src/tools/displayTools/Contour/contourDisplay.ts +29 -11
- package/src/tools/displayTools/Labelmap/labelmapDisplay.ts +1 -1
- package/src/tools/displayTools/SegmentationDisplayTool.ts +26 -0
- package/src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts +3 -65
- package/src/tools/displayTools/Surface/surfaceDisplay.ts +12 -247
- package/src/types/PolySeg.ts +1 -1
- package/src/utilities/contourSegmentation/addContourSegmentationAnnotation.ts +9 -1
- package/src/utilities/contourSegmentation/removeContourSegmentationAnnotation.ts +4 -0
- package/src/utilities/math/polyline/getAABB.ts +58 -4
- package/src/utilities/planar/index.ts +3 -0
- package/src/utilities/planar/isPlaneIntersectingAABB.ts +56 -0
- package/src/utilities/segmentation/getUniqueSegmentIndices.ts +115 -49
- package/src/workers/polySegConverters.js +117 -1
- package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.d.ts +0 -1
- package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js +0 -27
- package/dist/cjs/tools/displayTools/registerDisplayToolsWorker.js.map +0 -1
- package/dist/cjs/workers/clippingPlaneWorker.d.ts +0 -1
- package/dist/cjs/workers/clippingPlaneWorker.js +0 -63
- package/dist/cjs/workers/clippingPlaneWorker.js.map +0 -1
- package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js +0 -23
- package/dist/esm/tools/displayTools/registerDisplayToolsWorker.js.map +0 -1
- package/dist/esm/workers/clippingPlaneWorker.js +0 -58
- package/dist/esm/workers/clippingPlaneWorker.js.map +0 -1
- package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts +0 -2
- package/dist/types/tools/displayTools/registerDisplayToolsWorker.d.ts.map +0 -1
- package/dist/types/workers/clippingPlaneWorker.d.ts +0 -2
- package/dist/types/workers/clippingPlaneWorker.d.ts.map +0 -1
- package/dist/umd/444.index.js +0 -3
- package/dist/umd/444.index.js.LICENSE.txt +0 -5
- package/dist/umd/444.index.js.map +0 -1
- package/src/tools/displayTools/registerDisplayToolsWorker.ts +0 -34
- package/src/workers/clippingPlaneWorker.js +0 -87
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const core_1 = require("@cornerstonejs/core");
|
|
7
7
|
const Mapper_1 = __importDefault(require("@kitware/vtk.js/Rendering/Core/Mapper"));
|
|
8
8
|
const Actor_1 = __importDefault(require("@kitware/vtk.js/Rendering/Core/Actor"));
|
|
9
|
-
const ClipClosedSurface_1 = __importDefault(require("@kitware/vtk.js/Filters/General/ClipClosedSurface"));
|
|
10
9
|
const PolyData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/PolyData"));
|
|
11
10
|
const CellArray_1 = __importDefault(require("@kitware/vtk.js/Common/Core/CellArray"));
|
|
12
|
-
const
|
|
11
|
+
const clipAndCacheSurfacesForViewport_1 = require("../../../stateManagement/segmentation/helpers/clipAndCacheSurfacesForViewport");
|
|
13
12
|
function addOrUpdateSurfaceToElement(element, surface, segmentationRepresentationUID) {
|
|
14
|
-
var _a
|
|
15
|
-
const actorUID = (0,
|
|
13
|
+
var _a;
|
|
14
|
+
const actorUID = (0, clipAndCacheSurfacesForViewport_1.getSurfaceActorUID)(segmentationRepresentationUID, surface.id);
|
|
16
15
|
const enabledElement = (0, core_1.getEnabledElement)(element);
|
|
17
16
|
const { viewport } = enabledElement;
|
|
18
17
|
const surfaceActor = (_a = viewport.getActor(actorUID)) === null || _a === void 0 ? void 0 : _a.actor;
|
|
@@ -51,37 +50,7 @@ function addOrUpdateSurfaceToElement(element, surface, segmentationRepresentatio
|
|
|
51
50
|
surfacePolyData.setPolys(triangles);
|
|
52
51
|
const mapper = Mapper_1.default.newInstance({});
|
|
53
52
|
let clippingFilter;
|
|
54
|
-
|
|
55
|
-
clippingFilter = ClipClosedSurface_1.default.newInstance({
|
|
56
|
-
clippingPlanes: [],
|
|
57
|
-
activePlaneId: 2,
|
|
58
|
-
passPointData: false,
|
|
59
|
-
});
|
|
60
|
-
clippingFilter.setInputData(surfacePolyData);
|
|
61
|
-
clippingFilter.setGenerateOutline(true);
|
|
62
|
-
clippingFilter.setGenerateFaces(false);
|
|
63
|
-
clippingFilter.update();
|
|
64
|
-
const filteredData = clippingFilter.getOutputData();
|
|
65
|
-
mapper.setInputData(filteredData);
|
|
66
|
-
const viewportPlanes = (_b = viewport.getClippingPlanesForActor) === null || _b === void 0 ? void 0 : _b.call(viewport);
|
|
67
|
-
const evt = {
|
|
68
|
-
detail: {
|
|
69
|
-
actorEntry: {
|
|
70
|
-
actor: {
|
|
71
|
-
getMapper: () => mapper,
|
|
72
|
-
},
|
|
73
|
-
clippingFilter,
|
|
74
|
-
uid: actorUID,
|
|
75
|
-
},
|
|
76
|
-
vtkPlanes: viewportPlanes,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
updateSurfacePlanes(evt);
|
|
80
|
-
element.addEventListener(core_1.Enums.Events.CLIPPING_PLANES_UPDATED, updateSurfacePlanes);
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
mapper.setInputData(surfacePolyData);
|
|
84
|
-
}
|
|
53
|
+
mapper.setInputData(surfacePolyData);
|
|
85
54
|
const actor = Actor_1.default.newInstance();
|
|
86
55
|
actor.setMapper(mapper);
|
|
87
56
|
actor.getProperty().setColor(color[0] / 255, color[1] / 255, color[2] / 255);
|
|
@@ -97,17 +66,5 @@ function addOrUpdateSurfaceToElement(element, surface, segmentationRepresentatio
|
|
|
97
66
|
viewport.getRenderer().resetCameraClippingRange();
|
|
98
67
|
}, 0);
|
|
99
68
|
}
|
|
100
|
-
function updateSurfacePlanes(evt) {
|
|
101
|
-
const { actorEntry, vtkPlanes, viewport } = evt.detail;
|
|
102
|
-
if (!(actorEntry === null || actorEntry === void 0 ? void 0 : actorEntry.clippingFilter) || vtkPlanes.length === 0) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const sliceIndex = viewport.getSliceIndex();
|
|
106
|
-
const mapper = actorEntry.actor.getMapper();
|
|
107
|
-
const { viewPlaneNormal } = viewport.getCamera();
|
|
108
|
-
const cacheId = (0, surfaceDisplay_1.generateCacheId)(viewport, viewPlaneNormal, sliceIndex);
|
|
109
|
-
const polyData = (0, surfaceDisplay_1.getOrCreatePolyData)(actorEntry, cacheId, vtkPlanes);
|
|
110
|
-
mapper.setInputData(polyData);
|
|
111
|
-
}
|
|
112
69
|
exports.default = addOrUpdateSurfaceToElement;
|
|
113
70
|
//# sourceMappingURL=addOrUpdateSurfaceToElement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addOrUpdateSurfaceToElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"addOrUpdateSurfaceToElement.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/addOrUpdateSurfaceToElement.ts"],"names":[],"mappings":";;;;;AAAA,8CAAwD;AAExD,mFAA8D;AAC9D,iFAA4D;AAC5D,yFAAoE;AACpE,sFAAiE;AACjE,mIAAmH;AAEnH,SAAS,2BAA2B,CAClC,OAAuB,EACvB,OAAuB,EACvB,6BAAqC;;IAErC,MAAM,QAAQ,GAAG,IAAA,oDAAkB,EACjC,6BAA6B,EAC7B,OAAO,CAAC,EAAE,CACX,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,wBAAiB,EAAC,OAAO,CAAC,CAAC;IAClD,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC;IACpC,MAAM,YAAY,GAAG,MAAA,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,0CAAE,KAAoB,CAAC;IAEvE,IAAI,YAAY,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+
import { ToolGroupSpecificRepresentation } from '../../../types/SegmentationStateTypes';
|
|
4
3
|
declare function removeSegmentationRepresentation(toolGroupId: string, segmentationRepresentationUID: string, renderImmediate?: boolean): void;
|
|
5
|
-
declare function render(viewport: Types.IVolumeViewport, representation: ToolGroupSpecificRepresentation
|
|
6
|
-
export declare function getSurfaceActorUID(segmentationRepresentationUID: string, surfaceId: string): string;
|
|
7
|
-
export declare function generateCacheId(viewport: any, viewPlaneNormal: any, sliceIndex: any): string;
|
|
8
|
-
export declare function getOrCreatePolyData(actorEntry: any, cacheId: any, vtkPlanes: any): any;
|
|
9
|
-
export declare function updatePolyDataCache(actorUID: any, cacheId: any, polyDataResult: any): void;
|
|
10
|
-
export declare function getSortedPlanesInfo(viewport: any): any;
|
|
4
|
+
declare function render(viewport: Types.IVolumeViewport, representation: ToolGroupSpecificRepresentation): Promise<void>;
|
|
11
5
|
declare const _default: {
|
|
12
6
|
render: typeof render;
|
|
13
7
|
removeSegmentationRepresentation: typeof removeSegmentationRepresentation;
|
|
14
8
|
};
|
|
15
9
|
export default _default;
|
|
16
|
-
export { render, removeSegmentationRepresentation
|
|
10
|
+
export { render, removeSegmentationRepresentation };
|
|
@@ -35,29 +35,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
39
|
-
const PolyData_1 = __importDefault(require("@kitware/vtk.js/Common/DataModel/PolyData"));
|
|
40
|
-
const CellArray_1 = __importDefault(require("@kitware/vtk.js/Common/Core/CellArray"));
|
|
38
|
+
exports.removeSegmentationRepresentation = exports.render = void 0;
|
|
41
39
|
const core_1 = require("@cornerstonejs/core");
|
|
42
40
|
const SegmentationState = __importStar(require("../../../stateManagement/segmentation/segmentationState"));
|
|
43
41
|
const SegmentationRepresentations_1 = __importDefault(require("../../../enums/SegmentationRepresentations"));
|
|
44
42
|
const ToolGroupManager_1 = require("../../../store/ToolGroupManager");
|
|
45
|
-
const registerDisplayToolsWorker_1 = require("../registerDisplayToolsWorker");
|
|
46
43
|
const removeSurfaceFromElement_1 = __importDefault(require("./removeSurfaceFromElement"));
|
|
47
44
|
const addOrUpdateSurfaceToElement_1 = __importDefault(require("./addOrUpdateSurfaceToElement"));
|
|
48
45
|
const segmentation_1 = require("../../../stateManagement/segmentation");
|
|
49
|
-
const utilities_1 = require("../../../utilities");
|
|
50
|
-
const enums_1 = require("../../../enums");
|
|
51
|
-
const workerManager = (0, core_1.getWebWorkerManager)();
|
|
52
|
-
const polyDataCache = new Map();
|
|
53
|
-
exports.polyDataCache = polyDataCache;
|
|
54
|
-
const currentViewportNormal = new Map();
|
|
55
|
-
const triggerWorkerProgress = (eventTarget, progress) => {
|
|
56
|
-
(0, core_1.triggerEvent)(eventTarget, core_1.Enums.Events.WEB_WORKER_PROGRESS, {
|
|
57
|
-
progress,
|
|
58
|
-
type: enums_1.WorkerTypes.DISPLAY_TOOL_CLIP_SURFACE,
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
46
|
function removeSegmentationRepresentation(toolGroupId, segmentationRepresentationUID, renderImmediate = false) {
|
|
62
47
|
_removeSurfaceFromToolGroupViewports(toolGroupId, segmentationRepresentationUID);
|
|
63
48
|
SegmentationState.removeSegmentationRepresentation(toolGroupId, segmentationRepresentationUID);
|
|
@@ -70,13 +55,16 @@ function removeSegmentationRepresentation(toolGroupId, segmentationRepresentatio
|
|
|
70
55
|
}
|
|
71
56
|
}
|
|
72
57
|
exports.removeSegmentationRepresentation = removeSegmentationRepresentation;
|
|
73
|
-
function render(viewport, representation
|
|
58
|
+
function render(viewport, representation) {
|
|
74
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
const { colorLUTIndex,
|
|
60
|
+
const { colorLUTIndex, segmentationId, segmentationRepresentationUID } = representation;
|
|
76
61
|
const segmentation = SegmentationState.getSegmentation(segmentationId);
|
|
77
62
|
if (!segmentation) {
|
|
78
63
|
return;
|
|
79
64
|
}
|
|
65
|
+
if (!(viewport instanceof core_1.VolumeViewport3D)) {
|
|
66
|
+
throw new Error('Surface rendering is only supported in 3D viewports, if you need to visualize the surface cuts in 2D viewports, you can use the Contour representation, see polySeg converters');
|
|
67
|
+
}
|
|
80
68
|
let SurfaceData = segmentation.representationData[SegmentationRepresentations_1.default.Surface];
|
|
81
69
|
if (!SurfaceData &&
|
|
82
70
|
segmentation_1.polySeg.canComputeRequestedRepresentation(segmentationRepresentationUID)) {
|
|
@@ -95,13 +83,7 @@ function render(viewport, representation, toolGroupConfig) {
|
|
|
95
83
|
const surfaces = [];
|
|
96
84
|
geometryIds.forEach((geometryId, segmentIndex) => {
|
|
97
85
|
const geometry = core_1.cache.getGeometry(geometryId);
|
|
98
|
-
if (!geometry) {
|
|
99
|
-
throw new Error(`No Surfaces found for geometryId ${geometryId}`);
|
|
100
|
-
}
|
|
101
|
-
if (geometry.type !== core_1.Enums.GeometryType.SURFACE) {
|
|
102
|
-
throw new Error(`Geometry type ${geometry.type} not supported for rendering.`);
|
|
103
|
-
}
|
|
104
|
-
if (!geometry.data) {
|
|
86
|
+
if (!(geometry === null || geometry === void 0 ? void 0 : geometry.data)) {
|
|
105
87
|
console.warn(`No Surfaces found for geometryId ${geometryId}. Skipping render.`);
|
|
106
88
|
return;
|
|
107
89
|
}
|
|
@@ -111,9 +93,6 @@ function render(viewport, representation, toolGroupConfig) {
|
|
|
111
93
|
(0, addOrUpdateSurfaceToElement_1.default)(viewport.element, surface, segmentationRepresentationUID);
|
|
112
94
|
surfaces.push(surface);
|
|
113
95
|
});
|
|
114
|
-
if (!(viewport instanceof core_1.VolumeViewport3D)) {
|
|
115
|
-
generateAndCacheClippedSurfaces(surfaces, viewport, segmentationRepresentationUID);
|
|
116
|
-
}
|
|
117
96
|
viewport.render();
|
|
118
97
|
});
|
|
119
98
|
}
|
|
@@ -130,126 +109,6 @@ function _removeSurfaceFromToolGroupViewports(toolGroupId, segmentationRepresent
|
|
|
130
109
|
(0, removeSurfaceFromElement_1.default)(enabledElement.viewport.element, segmentationRepresentationUID);
|
|
131
110
|
}
|
|
132
111
|
}
|
|
133
|
-
function generateAndCacheClippedSurfaces(surfaces, viewport, segmentationRepresentationUID) {
|
|
134
|
-
var _a;
|
|
135
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
-
(0, registerDisplayToolsWorker_1.registerDisplayToolsWorker)();
|
|
137
|
-
const planesInfo = (_a = viewport.getSlicesClippingPlanes) === null || _a === void 0 ? void 0 : _a.call(viewport);
|
|
138
|
-
if (!planesInfo) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
const currentSliceIndex = viewport.getSliceIndex();
|
|
142
|
-
planesInfo.sort((a, b) => {
|
|
143
|
-
const diffA = Math.abs(a.sliceIndex - currentSliceIndex);
|
|
144
|
-
const diffB = Math.abs(b.sliceIndex - currentSliceIndex);
|
|
145
|
-
return diffA - diffB;
|
|
146
|
-
});
|
|
147
|
-
const pointsAndPolys = surfaces.map((surface) => {
|
|
148
|
-
const id = surface.id;
|
|
149
|
-
const points = surface.getPoints();
|
|
150
|
-
const polys = surface.getPolys();
|
|
151
|
-
return { id, points, polys };
|
|
152
|
-
});
|
|
153
|
-
const camera = viewport.getCamera();
|
|
154
|
-
function cameraModifiedCallback(evt) {
|
|
155
|
-
const { camera } = evt.detail;
|
|
156
|
-
const { viewPlaneNormal } = camera;
|
|
157
|
-
const surface1 = surfaces[0];
|
|
158
|
-
if (core_1.utilities.isEqual(viewPlaneNormal, currentViewportNormal.get(surface1.id))) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
currentViewportNormal.set(surface1.id, viewPlaneNormal);
|
|
162
|
-
workerManager.terminate('displayTools');
|
|
163
|
-
setTimeout(() => {
|
|
164
|
-
generateAndCacheClippedSurfaces(surfaces, viewport, segmentationRepresentationUID);
|
|
165
|
-
}, 0);
|
|
166
|
-
viewport.render();
|
|
167
|
-
}
|
|
168
|
-
viewport.element.removeEventListener(core_1.Enums.Events.CAMERA_MODIFIED, cameraModifiedCallback);
|
|
169
|
-
viewport.element.addEventListener(core_1.Enums.Events.CAMERA_MODIFIED, cameraModifiedCallback);
|
|
170
|
-
triggerWorkerProgress(core_1.eventTarget, 0);
|
|
171
|
-
yield workerManager
|
|
172
|
-
.executeTask('displayTools', 'clipSurfaceWithPlanes', {
|
|
173
|
-
planesInfo,
|
|
174
|
-
pointsAndPolys,
|
|
175
|
-
}, {
|
|
176
|
-
callbacks: [
|
|
177
|
-
({ progress }) => {
|
|
178
|
-
triggerWorkerProgress(core_1.eventTarget, progress);
|
|
179
|
-
},
|
|
180
|
-
({ sliceIndex, polyDataResults }) => {
|
|
181
|
-
polyDataResults.forEach((polyDataResult, surfaceId) => {
|
|
182
|
-
const actorUID = `${segmentationRepresentationUID}_${surfaceId}`;
|
|
183
|
-
const cacheId = generateCacheId(viewport, camera.viewPlaneNormal, sliceIndex);
|
|
184
|
-
updatePolyDataCache(actorUID, cacheId, polyDataResult);
|
|
185
|
-
});
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
})
|
|
189
|
-
.catch((error) => {
|
|
190
|
-
console.error(error);
|
|
191
|
-
});
|
|
192
|
-
triggerWorkerProgress(core_1.eventTarget, 100);
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
function getSurfaceActorUID(segmentationRepresentationUID, surfaceId) {
|
|
196
|
-
return `${segmentationRepresentationUID}_${surfaceId}`;
|
|
197
|
-
}
|
|
198
|
-
exports.getSurfaceActorUID = getSurfaceActorUID;
|
|
199
|
-
function generateCacheId(viewport, viewPlaneNormal, sliceIndex) {
|
|
200
|
-
return `${viewport.id}-${(0, utilities_1.pointToString)(viewPlaneNormal)}-${sliceIndex}`;
|
|
201
|
-
}
|
|
202
|
-
exports.generateCacheId = generateCacheId;
|
|
203
|
-
function getOrCreatePolyData(actorEntry, cacheId, vtkPlanes) {
|
|
204
|
-
let actorCache = polyDataCache.get(actorEntry.uid);
|
|
205
|
-
if (!actorCache) {
|
|
206
|
-
actorCache = new Map();
|
|
207
|
-
polyDataCache.set(actorEntry.uid, actorCache);
|
|
208
|
-
}
|
|
209
|
-
let polyData = actorCache.get(cacheId);
|
|
210
|
-
if (!polyData) {
|
|
211
|
-
const clippingFilter = actorEntry.clippingFilter;
|
|
212
|
-
clippingFilter.setClippingPlanes(vtkPlanes);
|
|
213
|
-
try {
|
|
214
|
-
clippingFilter.update();
|
|
215
|
-
polyData = clippingFilter.getOutputData();
|
|
216
|
-
actorCache.set(cacheId, polyData);
|
|
217
|
-
}
|
|
218
|
-
catch (e) {
|
|
219
|
-
console.error('Error clipping surface', e);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
return polyData;
|
|
223
|
-
}
|
|
224
|
-
exports.getOrCreatePolyData = getOrCreatePolyData;
|
|
225
|
-
function updatePolyDataCache(actorUID, cacheId, polyDataResult) {
|
|
226
|
-
const { points, lines } = polyDataResult;
|
|
227
|
-
const polyData = PolyData_1.default.newInstance();
|
|
228
|
-
polyData.getPoints().setData(points, 3);
|
|
229
|
-
const linesArray = CellArray_1.default.newInstance({
|
|
230
|
-
values: Int16Array.from(lines),
|
|
231
|
-
});
|
|
232
|
-
polyData.setLines(linesArray);
|
|
233
|
-
let actorCache = polyDataCache.get(actorUID);
|
|
234
|
-
if (!actorCache) {
|
|
235
|
-
actorCache = new Map();
|
|
236
|
-
polyDataCache.set(actorUID, actorCache);
|
|
237
|
-
}
|
|
238
|
-
actorCache.set(cacheId, polyData);
|
|
239
|
-
}
|
|
240
|
-
exports.updatePolyDataCache = updatePolyDataCache;
|
|
241
|
-
function getSortedPlanesInfo(viewport) {
|
|
242
|
-
var _a;
|
|
243
|
-
const planesInfo = (_a = viewport.getSlicesClippingPlanes) === null || _a === void 0 ? void 0 : _a.call(viewport);
|
|
244
|
-
const currentSliceIndex = viewport.getSliceIndex();
|
|
245
|
-
planesInfo.sort((a, b) => {
|
|
246
|
-
const diffA = Math.abs(a.sliceIndex - currentSliceIndex);
|
|
247
|
-
const diffB = Math.abs(b.sliceIndex - currentSliceIndex);
|
|
248
|
-
return diffA - diffB;
|
|
249
|
-
});
|
|
250
|
-
return planesInfo;
|
|
251
|
-
}
|
|
252
|
-
exports.getSortedPlanesInfo = getSortedPlanesInfo;
|
|
253
112
|
exports.default = {
|
|
254
113
|
render,
|
|
255
114
|
removeSegmentationRepresentation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surfaceDisplay.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/surfaceDisplay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"surfaceDisplay.js","sourceRoot":"","sources":["../../../../../src/tools/displayTools/Surface/surfaceDisplay.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAK6B;AAE7B,2GAA6F;AAC7F,6GAAyE;AACzE,sEAA+D;AAG/D,0FAAkE;AAClE,gGAAwE;AACxE,wEAAgE;AAYhE,SAAS,gCAAgC,CACvC,WAAmB,EACnB,6BAAqC,EACrC,eAAe,GAAG,KAAK;IAEvB,oCAAoC,CAClC,WAAW,EACX,6BAA6B,CAC9B,CAAC;IACF,iBAAiB,CAAC,gCAAgC,CAChD,WAAW,EACX,6BAA6B,CAC9B,CAAC;IAEF,IAAI,eAAe,EAAE;QACnB,MAAM,aAAa,GAAG,IAAA,+BAAY,EAAC,WAAW,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACnE,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,EAAE;YAC1D,MAAM,cAAc,GAAG,IAAA,6BAAsB,EAC3C,UAAU,EACV,iBAAiB,CAClB,CAAC;YACF,cAAc,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACnC,CAAC,CAAC,CAA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9
|
const { segmentationId, segmentIndex } = annotation.data.segmentation;
|
|
10
10
|
const segmentation = (0, segmentationState_1.getSegmentation)(segmentationId);
|
|
11
|
+
if (!segmentation.representationData.CONTOUR) {
|
|
12
|
+
segmentation.representationData.CONTOUR = { annotationUIDsMap: new Map() };
|
|
13
|
+
}
|
|
11
14
|
const { annotationUIDsMap } = segmentation.representationData.CONTOUR;
|
|
12
15
|
let annotationsUIDsSet = annotationUIDsMap.get(segmentIndex);
|
|
13
16
|
if (!annotationsUIDsSet) {
|
|
14
17
|
annotationsUIDsSet = new Set();
|
|
15
18
|
annotationUIDsMap.set(segmentIndex, annotationsUIDsSet);
|
|
16
19
|
}
|
|
17
|
-
annotationsUIDsSet.add(annotation.annotationUID);
|
|
20
|
+
annotationUIDsMap.set(segmentIndex, annotationsUIDsSet.add(annotation.annotationUID));
|
|
18
21
|
}
|
|
19
22
|
exports.addContourSegmentationAnnotation = addContourSegmentationAnnotation;
|
|
20
23
|
//# sourceMappingURL=addContourSegmentationAnnotation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addContourSegmentationAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/addContourSegmentationAnnotation.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAOvF,SAAgB,gCAAgC,CAC9C,UAAyC;IAEzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;KACH;IAED,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;IACtE,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC,cAAc,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"addContourSegmentationAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/addContourSegmentationAnnotation.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAOvF,SAAgB,gCAAgC,CAC9C,UAAyC;IAEzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;KACH;IAED,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;IACtE,MAAM,YAAY,GAAG,IAAA,mCAAe,EAAC,cAAc,CAAC,CAAC;IAErD,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE;QAC5C,YAAY,CAAC,kBAAkB,CAAC,OAAO,GAAG,EAAE,iBAAiB,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;KAC5E;IAED,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC;IAEtE,IAAI,kBAAkB,GAAG,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE7D,IAAI,CAAC,kBAAkB,EAAE;QACvB,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAC;QAC/B,iBAAiB,CAAC,GAAG,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAC;KACzD;IAED,iBAAiB,CAAC,GAAG,CACnB,YAAY,EACZ,kBAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,CACjD,CAAC;AACJ,CAAC;AA7BD,4EA6BC"}
|
|
@@ -10,6 +10,9 @@ function removeContourSegmentationAnnotation(annotation) {
|
|
|
10
10
|
const segmentation = segmentation_1.state.getSegmentation(segmentationId);
|
|
11
11
|
const { annotationUIDsMap } = segmentation.representationData.CONTOUR;
|
|
12
12
|
const annotationsUIDsSet = annotationUIDsMap.get(segmentIndex);
|
|
13
|
+
if (!annotationsUIDsSet) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
13
16
|
annotationsUIDsSet.delete(annotation.annotationUID);
|
|
14
17
|
if (!annotationsUIDsSet.size) {
|
|
15
18
|
annotationUIDsMap.delete(segmentIndex);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeContourSegmentationAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/removeContourSegmentationAnnotation.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAS3D,SAAgB,mCAAmC,CACjD,UAAyC;IAEzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;KACH;IAED,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;IACtE,MAAM,YAAY,GAAG,oBAAK,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3D,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC;IACtE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE/D,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAGpD,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE;QAC5B,iBAAiB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;KACxC;AACH,CAAC;
|
|
1
|
+
{"version":3,"file":"removeContourSegmentationAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/contourSegmentation/removeContourSegmentationAnnotation.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAS3D,SAAgB,mCAAmC,CACjD,UAAyC;IAEzC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;KACH;IAED,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC;IACtE,MAAM,YAAY,GAAG,oBAAK,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3D,MAAM,EAAE,iBAAiB,EAAE,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,CAAC;IACtE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAE/D,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO;KACR;IAED,kBAAkB,CAAC,MAAM,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IAGpD,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE;QAC5B,iBAAiB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;KACxC;AACH,CAAC;AAxBD,kFAwBC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { Types } from '@cornerstonejs/core';
|
|
2
|
-
export default function getAABB(polyline: Types.Point2[]
|
|
2
|
+
export default function getAABB(polyline: Types.Point2[] | Types.Point3[] | number[], options?: {
|
|
3
|
+
numDimensions: number;
|
|
4
|
+
}): Types.AABB2 | Types.AABB3;
|
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function getAABB(polyline) {
|
|
3
|
+
function getAABB(polyline, options) {
|
|
4
|
+
let polylineToUse = polyline;
|
|
5
|
+
const numDimensions = (options === null || options === void 0 ? void 0 : options.numDimensions) || 2;
|
|
6
|
+
const is3D = numDimensions === 3;
|
|
7
|
+
if (!Array.isArray(polyline[0])) {
|
|
8
|
+
const currentPolyline = polyline;
|
|
9
|
+
const totalPoints = currentPolyline.length / numDimensions;
|
|
10
|
+
polylineToUse = new Array(currentPolyline.length / numDimensions);
|
|
11
|
+
for (let i = 0, len = totalPoints; i < len; i++) {
|
|
12
|
+
polylineToUse[i] = [
|
|
13
|
+
currentPolyline[i * numDimensions],
|
|
14
|
+
currentPolyline[i * numDimensions + 1],
|
|
15
|
+
];
|
|
16
|
+
if (is3D) {
|
|
17
|
+
polylineToUse[i].push(currentPolyline[i * numDimensions + 2]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
4
21
|
let minX = Infinity;
|
|
5
22
|
let minY = Infinity;
|
|
6
23
|
let maxX = -Infinity;
|
|
7
24
|
let maxY = -Infinity;
|
|
8
|
-
|
|
9
|
-
|
|
25
|
+
let minZ = Infinity;
|
|
26
|
+
let maxZ = -Infinity;
|
|
27
|
+
polylineToUse = polylineToUse;
|
|
28
|
+
for (let i = 0, len = polylineToUse.length; i < len; i++) {
|
|
29
|
+
const [x, y, z] = polylineToUse[i];
|
|
10
30
|
minX = minX < x ? minX : x;
|
|
11
31
|
minY = minY < y ? minY : y;
|
|
12
32
|
maxX = maxX > x ? maxX : x;
|
|
13
33
|
maxY = maxY > y ? maxY : y;
|
|
34
|
+
if (is3D) {
|
|
35
|
+
minZ = minZ < z ? minZ : z;
|
|
36
|
+
maxZ = maxZ > z ? maxZ : z;
|
|
37
|
+
}
|
|
14
38
|
}
|
|
15
|
-
return
|
|
39
|
+
return is3D
|
|
40
|
+
? { minX, maxX, minY, maxY, minZ, maxZ }
|
|
41
|
+
: { minX, maxX, minY, maxY };
|
|
16
42
|
}
|
|
17
43
|
exports.default = getAABB;
|
|
18
44
|
//# sourceMappingURL=getAABB.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAABB.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/getAABB.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"getAABB.js","sourceRoot":"","sources":["../../../../../src/utilities/math/polyline/getAABB.ts"],"names":[],"mappings":";;AAWA,SAAwB,OAAO,CAC7B,QAAoD,EACpD,OAEC;IAID,IAAI,aAAa,GAAG,QAAQ,CAAC;IAC7B,MAAM,aAAa,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,KAAI,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,aAAa,KAAK,CAAC,CAAC;IAEjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QA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C,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3B,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3B,IAAI,IAAI,EAAE;YACR,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3B,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5B;KACF;IAED,OAAO,IAAI;QACT,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;QACxC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACjC,CAAC;AA9DD,0BA8DC"}
|
|
@@ -2,11 +2,13 @@ import filterAnnotationsWithinSlice from './filterAnnotationsWithinSlice';
|
|
|
2
2
|
import getWorldWidthAndHeightFromCorners from './getWorldWidthAndHeightFromCorners';
|
|
3
3
|
import filterAnnotationsForDisplay from './filterAnnotationsForDisplay';
|
|
4
4
|
import getPointInLineOfSightWithCriteria from './getPointInLineOfSightWithCriteria';
|
|
5
|
+
import { isPlaneIntersectingAABB } from './isPlaneIntersectingAABB';
|
|
5
6
|
declare const _default: {
|
|
6
7
|
filterAnnotationsWithinSlice: typeof filterAnnotationsWithinSlice;
|
|
7
8
|
getWorldWidthAndHeightFromCorners: typeof getWorldWidthAndHeightFromCorners;
|
|
8
9
|
filterAnnotationsForDisplay: typeof filterAnnotationsForDisplay;
|
|
9
10
|
getPointInLineOfSightWithCriteria: typeof getPointInLineOfSightWithCriteria;
|
|
11
|
+
isPlaneIntersectingAABB: (origin: any, normal: any, minX: any, minY: any, minZ: any, maxX: any, maxY: any, maxZ: any) => boolean;
|
|
10
12
|
};
|
|
11
13
|
export default _default;
|
|
12
|
-
export { filterAnnotationsWithinSlice, getWorldWidthAndHeightFromCorners, filterAnnotationsForDisplay, getPointInLineOfSightWithCriteria, };
|
|
14
|
+
export { filterAnnotationsWithinSlice, getWorldWidthAndHeightFromCorners, filterAnnotationsForDisplay, getPointInLineOfSightWithCriteria, isPlaneIntersectingAABB, };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getPointInLineOfSightWithCriteria = exports.filterAnnotationsForDisplay = exports.getWorldWidthAndHeightFromCorners = exports.filterAnnotationsWithinSlice = void 0;
|
|
6
|
+
exports.isPlaneIntersectingAABB = exports.getPointInLineOfSightWithCriteria = exports.filterAnnotationsForDisplay = exports.getWorldWidthAndHeightFromCorners = exports.filterAnnotationsWithinSlice = void 0;
|
|
7
7
|
const filterAnnotationsWithinSlice_1 = __importDefault(require("./filterAnnotationsWithinSlice"));
|
|
8
8
|
exports.filterAnnotationsWithinSlice = filterAnnotationsWithinSlice_1.default;
|
|
9
9
|
const getWorldWidthAndHeightFromCorners_1 = __importDefault(require("./getWorldWidthAndHeightFromCorners"));
|
|
@@ -12,10 +12,13 @@ const filterAnnotationsForDisplay_1 = __importDefault(require("./filterAnnotatio
|
|
|
12
12
|
exports.filterAnnotationsForDisplay = filterAnnotationsForDisplay_1.default;
|
|
13
13
|
const getPointInLineOfSightWithCriteria_1 = __importDefault(require("./getPointInLineOfSightWithCriteria"));
|
|
14
14
|
exports.getPointInLineOfSightWithCriteria = getPointInLineOfSightWithCriteria_1.default;
|
|
15
|
+
const isPlaneIntersectingAABB_1 = require("./isPlaneIntersectingAABB");
|
|
16
|
+
Object.defineProperty(exports, "isPlaneIntersectingAABB", { enumerable: true, get: function () { return isPlaneIntersectingAABB_1.isPlaneIntersectingAABB; } });
|
|
15
17
|
exports.default = {
|
|
16
18
|
filterAnnotationsWithinSlice: filterAnnotationsWithinSlice_1.default,
|
|
17
19
|
getWorldWidthAndHeightFromCorners: getWorldWidthAndHeightFromCorners_1.default,
|
|
18
20
|
filterAnnotationsForDisplay: filterAnnotationsForDisplay_1.default,
|
|
19
21
|
getPointInLineOfSightWithCriteria: getPointInLineOfSightWithCriteria_1.default,
|
|
22
|
+
isPlaneIntersectingAABB: isPlaneIntersectingAABB_1.isPlaneIntersectingAABB,
|
|
20
23
|
};
|
|
21
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/planar/index.ts"],"names":[],"mappings":";;;;;;AAAA,kGAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/utilities/planar/index.ts"],"names":[],"mappings":";;;;;;AAAA,kGAA0E;AAexE,uCAfK,sCAA4B,CAeL;AAd9B,4GAAoF;AAelF,4CAfK,2CAAiC,CAeL;AAdnC,gGAAwE;AAetE,sCAfK,qCAA2B,CAeL;AAd7B,4GAAoF;AAelF,4CAfK,2CAAiC,CAeL;AAdnC,uEAAoE;AAelE,wGAfO,iDAAuB,OAeP;AAbzB,kBAAe;IACb,4BAA4B,EAA5B,sCAA4B;IAC5B,iCAAiC,EAAjC,2CAAiC;IACjC,2BAA2B,EAA3B,qCAA2B;IAC3B,iCAAiC,EAAjC,2CAAiC;IACjC,uBAAuB,EAAvB,iDAAuB;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isPlaneIntersectingAABB: (origin: any, normal: any, minX: any, minY: any, minZ: any, maxX: any, maxY: any, maxZ: any) => boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPlaneIntersectingAABB = void 0;
|
|
4
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
5
|
+
const isPlaneIntersectingAABB = (origin, normal, minX, minY, minZ, maxX, maxY, maxZ) => {
|
|
6
|
+
const vertices = [
|
|
7
|
+
gl_matrix_1.vec3.fromValues(minX, minY, minZ),
|
|
8
|
+
gl_matrix_1.vec3.fromValues(maxX, minY, minZ),
|
|
9
|
+
gl_matrix_1.vec3.fromValues(minX, maxY, minZ),
|
|
10
|
+
gl_matrix_1.vec3.fromValues(maxX, maxY, minZ),
|
|
11
|
+
gl_matrix_1.vec3.fromValues(minX, minY, maxZ),
|
|
12
|
+
gl_matrix_1.vec3.fromValues(maxX, minY, maxZ),
|
|
13
|
+
gl_matrix_1.vec3.fromValues(minX, maxY, maxZ),
|
|
14
|
+
gl_matrix_1.vec3.fromValues(maxX, maxY, maxZ),
|
|
15
|
+
];
|
|
16
|
+
const normalVec = gl_matrix_1.vec3.fromValues(normal[0], normal[1], normal[2]);
|
|
17
|
+
const originVec = gl_matrix_1.vec3.fromValues(origin[0], origin[1], origin[2]);
|
|
18
|
+
const planeDistance = -gl_matrix_1.vec3.dot(normalVec, originVec);
|
|
19
|
+
let initialSign = null;
|
|
20
|
+
for (const vertex of vertices) {
|
|
21
|
+
const distance = gl_matrix_1.vec3.dot(normalVec, vertex) + planeDistance;
|
|
22
|
+
if (initialSign === null) {
|
|
23
|
+
initialSign = Math.sign(distance);
|
|
24
|
+
}
|
|
25
|
+
else if (Math.sign(distance) !== initialSign) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
31
|
+
exports.isPlaneIntersectingAABB = isPlaneIntersectingAABB;
|
|
32
|
+
//# sourceMappingURL=isPlaneIntersectingAABB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPlaneIntersectingAABB.js","sourceRoot":"","sources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AE;QAE7B,MAAM,QAAQ,GAAG,gBAAI,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC;QAC7D,IAAI,WAAW,KAAK,IAAI,EAAE;YACxB,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACnC;aAAM,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,WAAW,EAAE;YAC9C,OAAO,IAAI,CAAC;SACb;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAxCW,QAAA,uBAAuB,2BAwClC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare
|
|
1
|
+
export declare const setSegmentationDirty: (segmentationId: string) => void;
|
|
2
|
+
export declare const setSegmentationClean: (segmentationId: string) => void;
|
|
3
|
+
declare function getUniqueSegmentIndices(segmentationId: any): any;
|
|
2
4
|
export { getUniqueSegmentIndices };
|