@cornerstonejs/tools 1.84.1 → 1.84.3
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/utilities/planarFreehandROITool/smoothAnnotation.d.ts +5 -2
- package/dist/cjs/utilities/planarFreehandROITool/smoothAnnotation.js +44 -27
- package/dist/cjs/utilities/planarFreehandROITool/smoothAnnotation.js.map +1 -1
- package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.js +43 -26
- package/dist/esm/utilities/planarFreehandROITool/smoothAnnotation.js.map +1 -1
- package/dist/types/utilities/planarFreehandROITool/smoothAnnotation.d.ts +5 -2
- package/dist/types/utilities/planarFreehandROITool/smoothAnnotation.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/utilities/planarFreehandROITool/smoothAnnotation.ts +86 -43
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
2
1
|
import { PlanarFreehandROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
3
|
-
export
|
|
2
|
+
export declare type SmoothOptions = {
|
|
3
|
+
knotsRatioPercentage: number;
|
|
4
|
+
loop: number;
|
|
5
|
+
};
|
|
6
|
+
export default function smoothAnnotation(annotation: PlanarFreehandROIAnnotation, options?: SmoothOptions): boolean;
|
|
@@ -3,44 +3,61 @@ 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
|
-
const
|
|
7
|
-
const store_1 = require("../../store");
|
|
6
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
8
7
|
const interpolateSegmentPoints_1 = __importDefault(require("./interpolation/interpolateSegmentPoints"));
|
|
9
|
-
function shouldPreventInterpolation(
|
|
10
|
-
var _a;
|
|
11
|
-
|
|
8
|
+
function shouldPreventInterpolation(annotation, options) {
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
const knotsRatioPercentage = (options === null || options === void 0 ? void 0 : options.knotsRatioPercentage) || 30;
|
|
11
|
+
if (!((_c = (_b = (_a = annotation === null || annotation === void 0 ? void 0 : annotation.data) === null || _a === void 0 ? void 0 : _a.contour) === null || _b === void 0 ? void 0 : _b.polyline) === null || _c === void 0 ? void 0 : _c.length) ||
|
|
12
|
+
knotsRatioPercentage <= 0) {
|
|
12
13
|
return true;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
function rotateMatrix(normal, focal) {
|
|
18
|
+
const mat = gl_matrix_1.mat4.create();
|
|
19
|
+
const eye = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), focal, normal);
|
|
20
|
+
const up = Math.abs(normal[0]) > 0.1
|
|
21
|
+
? gl_matrix_1.vec3.fromValues(-normal[1], normal[0], 0)
|
|
22
|
+
: gl_matrix_1.vec3.fromValues(0, -normal[2], normal[1]);
|
|
23
|
+
gl_matrix_1.mat4.lookAt(mat, focal, eye, up);
|
|
24
|
+
return mat;
|
|
25
|
+
}
|
|
26
|
+
function rotate(list, count = Math.floor(Math.random() * (list.length - 1))) {
|
|
27
|
+
if (count === 0) {
|
|
28
|
+
return 0;
|
|
24
29
|
}
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
const srcList = [...list];
|
|
31
|
+
const { length } = list;
|
|
32
|
+
for (let i = 0; i < length; i++) {
|
|
33
|
+
list[i] = srcList[(i + count + length) % length];
|
|
28
34
|
}
|
|
29
|
-
return
|
|
30
|
-
toolInstance.isEditingOpen ||
|
|
31
|
-
toolInstance.isEditingClosed);
|
|
35
|
+
return count;
|
|
32
36
|
}
|
|
33
|
-
function smoothAnnotation(
|
|
34
|
-
if (shouldPreventInterpolation(
|
|
37
|
+
function smoothAnnotation(annotation, options) {
|
|
38
|
+
if (shouldPreventInterpolation(annotation, options)) {
|
|
35
39
|
return false;
|
|
36
40
|
}
|
|
37
|
-
const {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
41
|
+
const { viewPlaneNormal } = annotation.metadata;
|
|
42
|
+
const { closed, polyline } = annotation.data.contour;
|
|
43
|
+
const rotateMat = rotateMatrix(viewPlaneNormal, annotation.data.contour.polyline[0]);
|
|
44
|
+
const canvasPoints = annotation.data.contour.polyline.map((p) => {
|
|
45
|
+
const planeP = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), p, rotateMat);
|
|
46
|
+
return [planeP[0], planeP[1]];
|
|
47
|
+
});
|
|
48
|
+
let rotation = closed ? rotate(canvasPoints) : 0;
|
|
49
|
+
let interpolatedCanvasPoints = ((0, interpolateSegmentPoints_1.default)(canvasPoints, 0, canvasPoints.length, (options === null || options === void 0 ? void 0 : options.knotsRatioPercentage) || 30));
|
|
40
50
|
if (interpolatedCanvasPoints === canvasPoints) {
|
|
41
51
|
return false;
|
|
42
52
|
}
|
|
43
|
-
|
|
53
|
+
rotate(interpolatedCanvasPoints, -rotation);
|
|
54
|
+
for (let i = 1; i < (options === null || options === void 0 ? void 0 : options.loop); i++) {
|
|
55
|
+
rotation = closed ? rotate(interpolatedCanvasPoints) : 0;
|
|
56
|
+
interpolatedCanvasPoints = ((0, interpolateSegmentPoints_1.default)(interpolatedCanvasPoints, 0, canvasPoints.length, (options === null || options === void 0 ? void 0 : options.knotsRatioPercentage) || 30));
|
|
57
|
+
rotate(interpolatedCanvasPoints, -rotation);
|
|
58
|
+
}
|
|
59
|
+
const unRotate = gl_matrix_1.mat4.invert(gl_matrix_1.mat4.create(), rotateMat);
|
|
60
|
+
annotation.data.contour.polyline = (interpolatedCanvasPoints.map((p) => gl_matrix_1.vec3.transformMat4([0, 0, 0], [...p, 0], unRotate)));
|
|
44
61
|
return true;
|
|
45
62
|
}
|
|
46
63
|
exports.default = smoothAnnotation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoothAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/planarFreehandROITool/smoothAnnotation.ts"],"names":[],"mappings":";;;;;AACA,
|
|
1
|
+
{"version":3,"file":"smoothAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/planarFreehandROITool/smoothAnnotation.ts"],"names":[],"mappings":";;;;;AACA,yCAAuC;AAIvC,wGAAgF;AAOhF,SAAS,0BAA0B,CACjC,UAAuC,EACvC,OAAuB;;IAEvB,MAAM,oBAAoB,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,KAAI,EAAE,CAAC;IACjE,IACE,CAAC,CAAA,MAAA,MAAA,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,0CAAE,OAAO,0CAAE,QAAQ,0CAAE,MAAM,CAAA;QAC5C,oBAAoB,IAAI,CAAC,EACzB;QACA,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,YAAY,CAAC,MAAM,EAAE,KAAK;IACjC,MAAM,GAAG,GAAG,gBAAI,CAAC,MAAM,EAAE,CAAC;IAC1B,MAAM,GAAG,GAAG,gBAAI,CAAC,GAAG,CAAC,gBAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,EAAE,GACN,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;QACvB,CAAC,CAAC,gBAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3C,CAAC,CAAC,gBAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAA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QAAQ,GAAmB,CACjD,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACjC,gBAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CACnD,CACF,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AA7DD,mCA6DC"}
|
|
@@ -1,40 +1,57 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ToolGroupManager } from '../../store';
|
|
1
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
3
2
|
import interpolateSegmentPoints from './interpolation/interpolateSegmentPoints';
|
|
4
|
-
function shouldPreventInterpolation(
|
|
5
|
-
|
|
3
|
+
function shouldPreventInterpolation(annotation, options) {
|
|
4
|
+
const knotsRatioPercentage = options?.knotsRatioPercentage || 30;
|
|
5
|
+
if (!annotation?.data?.contour?.polyline?.length ||
|
|
6
|
+
knotsRatioPercentage <= 0) {
|
|
6
7
|
return true;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
function rotateMatrix(normal, focal) {
|
|
12
|
+
const mat = mat4.create();
|
|
13
|
+
const eye = vec3.add(vec3.create(), focal, normal);
|
|
14
|
+
const up = Math.abs(normal[0]) > 0.1
|
|
15
|
+
? vec3.fromValues(-normal[1], normal[0], 0)
|
|
16
|
+
: vec3.fromValues(0, -normal[2], normal[1]);
|
|
17
|
+
mat4.lookAt(mat, focal, eye, up);
|
|
18
|
+
return mat;
|
|
19
|
+
}
|
|
20
|
+
function rotate(list, count = Math.floor(Math.random() * (list.length - 1))) {
|
|
21
|
+
if (count === 0) {
|
|
22
|
+
return 0;
|
|
18
23
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
const srcList = [...list];
|
|
25
|
+
const { length } = list;
|
|
26
|
+
for (let i = 0; i < length; i++) {
|
|
27
|
+
list[i] = srcList[(i + count + length) % length];
|
|
22
28
|
}
|
|
23
|
-
return
|
|
24
|
-
toolInstance.isEditingOpen ||
|
|
25
|
-
toolInstance.isEditingClosed);
|
|
29
|
+
return count;
|
|
26
30
|
}
|
|
27
|
-
export default function smoothAnnotation(
|
|
28
|
-
if (shouldPreventInterpolation(
|
|
31
|
+
export default function smoothAnnotation(annotation, options) {
|
|
32
|
+
if (shouldPreventInterpolation(annotation, options)) {
|
|
29
33
|
return false;
|
|
30
34
|
}
|
|
31
|
-
const {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
35
|
+
const { viewPlaneNormal } = annotation.metadata;
|
|
36
|
+
const { closed, polyline } = annotation.data.contour;
|
|
37
|
+
const rotateMat = rotateMatrix(viewPlaneNormal, annotation.data.contour.polyline[0]);
|
|
38
|
+
const canvasPoints = annotation.data.contour.polyline.map((p) => {
|
|
39
|
+
const planeP = vec3.transformMat4(vec3.create(), p, rotateMat);
|
|
40
|
+
return [planeP[0], planeP[1]];
|
|
41
|
+
});
|
|
42
|
+
let rotation = closed ? rotate(canvasPoints) : 0;
|
|
43
|
+
let interpolatedCanvasPoints = (interpolateSegmentPoints(canvasPoints, 0, canvasPoints.length, options?.knotsRatioPercentage || 30));
|
|
34
44
|
if (interpolatedCanvasPoints === canvasPoints) {
|
|
35
45
|
return false;
|
|
36
46
|
}
|
|
37
|
-
|
|
47
|
+
rotate(interpolatedCanvasPoints, -rotation);
|
|
48
|
+
for (let i = 1; i < options?.loop; i++) {
|
|
49
|
+
rotation = closed ? rotate(interpolatedCanvasPoints) : 0;
|
|
50
|
+
interpolatedCanvasPoints = (interpolateSegmentPoints(interpolatedCanvasPoints, 0, canvasPoints.length, options?.knotsRatioPercentage || 30));
|
|
51
|
+
rotate(interpolatedCanvasPoints, -rotation);
|
|
52
|
+
}
|
|
53
|
+
const unRotate = mat4.invert(mat4.create(), rotateMat);
|
|
54
|
+
annotation.data.contour.polyline = (interpolatedCanvasPoints.map((p) => vec3.transformMat4([0, 0, 0], [...p, 0], unRotate)));
|
|
38
55
|
return true;
|
|
39
56
|
}
|
|
40
57
|
//# sourceMappingURL=smoothAnnotation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoothAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/planarFreehandROITool/smoothAnnotation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"smoothAnnotation.js","sourceRoot":"","sources":["../../../../src/utilities/planarFreehandROITool/smoothAnnotation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,wBAAwB,MAAM,0CAA0C,CAAC;AAOhF,SAAS,0BAA0B,CACjC,UAAuC,EACvC,OAAuB;IAEvB,MAAM,oBAAoB,GAAG,OAAO,EAAE,oBAAoB,IAAI,EAAE,CAAC;IACjE,IACE,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;QAC5C,oBAAoB,IAAI,CAAC,EACzB;QACA,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,YAAY,CAAC,MAAM,EAAE,KAAK;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,EAAE,GACN,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;QACvB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAA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U,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAmB,CACjD,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACjC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CACnD,CACF,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { Types } from '@cornerstonejs/core';
|
|
2
1
|
import { PlanarFreehandROIAnnotation } from '../../types/ToolSpecificAnnotationTypes';
|
|
3
|
-
export
|
|
2
|
+
export declare type SmoothOptions = {
|
|
3
|
+
knotsRatioPercentage: number;
|
|
4
|
+
loop: number;
|
|
5
|
+
};
|
|
6
|
+
export default function smoothAnnotation(annotation: PlanarFreehandROIAnnotation, options?: SmoothOptions): boolean;
|
|
4
7
|
//# sourceMappingURL=smoothAnnotation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smoothAnnotation.d.ts","sourceRoot":"","sources":["../../../../src/utilities/planarFreehandROITool/smoothAnnotation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"smoothAnnotation.d.ts","sourceRoot":"","sources":["../../../../src/utilities/planarFreehandROITool/smoothAnnotation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAGtF,oBAAY,aAAa,GAAG;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA4DF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACtC,UAAU,EAAE,2BAA2B,EACvC,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CA0DT"}
|