@cornerstonejs/tools 4.18.2 → 4.18.4
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/esm/tools/VolumeCroppingControlTool.d.ts +10 -35
- package/dist/esm/tools/VolumeCroppingControlTool.js +179 -699
- package/dist/esm/tools/VolumeCroppingTool.d.ts +32 -32
- package/dist/esm/tools/VolumeCroppingTool.js +775 -525
- package/dist/esm/utilities/draw3D/addLine3DBetweenPoints.d.ts +7 -0
- package/dist/esm/utilities/draw3D/addLine3DBetweenPoints.js +34 -0
- package/dist/esm/utilities/draw3D/calculateAdaptiveSphereRadius.d.ts +6 -0
- package/dist/esm/utilities/draw3D/calculateAdaptiveSphereRadius.js +7 -0
- package/dist/esm/utilities/draw3D/index.d.ts +2 -0
- package/dist/esm/utilities/draw3D/index.js +2 -0
- package/dist/esm/utilities/index.d.ts +2 -1
- package/dist/esm/utilities/index.js +2 -1
- package/dist/esm/utilities/volumeCropping/computePlanePlaneIntersection.d.ts +6 -0
- package/dist/esm/utilities/volumeCropping/computePlanePlaneIntersection.js +37 -0
- package/dist/esm/utilities/volumeCropping/constants.d.ts +31 -0
- package/dist/esm/utilities/volumeCropping/constants.js +31 -0
- package/dist/esm/utilities/volumeCropping/copyClippingPlanes.d.ts +2 -0
- package/dist/esm/utilities/volumeCropping/copyClippingPlanes.js +6 -0
- package/dist/esm/utilities/volumeCropping/extractVolumeDirectionVectors.d.ts +9 -0
- package/dist/esm/utilities/volumeCropping/extractVolumeDirectionVectors.js +9 -0
- package/dist/esm/utilities/volumeCropping/findLineBoundsIntersection.d.ts +5 -0
- package/dist/esm/utilities/volumeCropping/findLineBoundsIntersection.js +50 -0
- package/dist/esm/utilities/volumeCropping/getColorKeyForPlaneIndex.d.ts +1 -0
- package/dist/esm/utilities/volumeCropping/getColorKeyForPlaneIndex.js +13 -0
- package/dist/esm/utilities/volumeCropping/getOrientationFromNormal.d.ts +2 -0
- package/dist/esm/utilities/volumeCropping/getOrientationFromNormal.js +19 -0
- package/dist/esm/utilities/volumeCropping/index.d.ts +9 -0
- package/dist/esm/utilities/volumeCropping/index.js +9 -0
- package/dist/esm/utilities/volumeCropping/parseCornerKey.d.ts +8 -0
- package/dist/esm/utilities/volumeCropping/parseCornerKey.js +11 -0
- package/dist/esm/utilities/volumeCropping/types.d.ts +5 -0
- package/dist/esm/utilities/volumeCropping/types.js +0 -0
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import vtkPolyData from '@kitware/vtk.js/Common/DataModel/PolyData';
|
|
2
2
|
import vtkActor from '@kitware/vtk.js/Rendering/Core/Actor';
|
|
3
|
+
import type vtkVolumeMapper from '@kitware/vtk.js/Rendering/Core/VolumeMapper';
|
|
3
4
|
import { BaseTool } from './base';
|
|
4
5
|
import type { Types } from '@cornerstonejs/core';
|
|
5
6
|
import type { EventTypes, PublicToolProps, ToolProps } from '../types';
|
|
7
|
+
import { type ClippingPlane } from '../utilities/volumeCropping';
|
|
6
8
|
declare class VolumeCroppingTool extends BaseTool {
|
|
7
9
|
static toolName: any;
|
|
8
10
|
seriesInstanceUID?: string;
|
|
@@ -12,14 +14,16 @@ declare class VolumeCroppingTool extends BaseTool {
|
|
|
12
14
|
_resizeObservers: Map<any, any>;
|
|
13
15
|
_viewportAddedListener: (evt: any) => void;
|
|
14
16
|
_hasResolutionChanged: boolean;
|
|
15
|
-
originalClippingPlanes:
|
|
16
|
-
origin: number[];
|
|
17
|
-
normal: number[];
|
|
18
|
-
}[];
|
|
17
|
+
originalClippingPlanes: ClippingPlane[];
|
|
19
18
|
draggingSphereIndex: number | null;
|
|
20
|
-
|
|
19
|
+
rotatePlanesOnDrag: boolean;
|
|
21
20
|
cornerDragOffset: [number, number, number] | null;
|
|
22
21
|
faceDragOffset: number | null;
|
|
22
|
+
volumeDirectionVectors: {
|
|
23
|
+
xDir: Types.Point3;
|
|
24
|
+
yDir: Types.Point3;
|
|
25
|
+
zDir: Types.Point3;
|
|
26
|
+
} | null;
|
|
23
27
|
sphereStates: {
|
|
24
28
|
point: Types.Point3;
|
|
25
29
|
axis: string;
|
|
@@ -48,42 +52,25 @@ declare class VolumeCroppingTool extends BaseTool {
|
|
|
48
52
|
getHandlesVisible(): any;
|
|
49
53
|
getClippingPlanesVisible(): any;
|
|
50
54
|
setClippingPlanesVisible(visible: boolean): void;
|
|
55
|
+
getRotatePlanesOnDrag(): boolean;
|
|
56
|
+
setRotatePlanesOnDrag(enable: boolean): void;
|
|
51
57
|
_dragCallback(evt: EventTypes.InteractionEventType): void;
|
|
52
58
|
_onMouseMoveSphere: (evt: any) => boolean;
|
|
53
59
|
_onControlToolChange: (evt: any) => void;
|
|
54
60
|
_updateClippingPlanes(viewport: any): void;
|
|
55
61
|
_updateHandlesVisibility(): void;
|
|
56
|
-
_addLine3DBetweenPoints(viewport: any, point1: any, point2: any, color?: [number, number, number], uid?: string): {
|
|
57
|
-
actor: vtkActor;
|
|
58
|
-
source: vtkPolyData;
|
|
59
|
-
};
|
|
60
62
|
_getViewportsInfo: () => any[];
|
|
61
|
-
_addSphere(viewport:
|
|
62
|
-
|
|
63
|
-
_initialize3DViewports: (viewportsInfo:
|
|
63
|
+
_addSphere(viewport: Types.IVolumeViewport, point: Types.Point3, axis: string, position: string, cornerKey: string | null, adaptiveRadius: number): void;
|
|
64
|
+
_getDirectionVectorForAxis(axis: string): Types.Point3;
|
|
65
|
+
_initialize3DViewports: (viewportsInfo: Types.IViewportId[]) => void;
|
|
64
66
|
_getViewportAndWorldCoords: (evt: any) => {
|
|
65
|
-
viewport: import("@cornerstonejs/core").
|
|
67
|
+
viewport: import("@cornerstonejs/core").VolumeViewport;
|
|
66
68
|
world: Types.Point3;
|
|
67
69
|
};
|
|
68
|
-
_getViewport: () =>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
_parseCornerKey: (uid: any) => {
|
|
73
|
-
isXMin: any;
|
|
74
|
-
isXMax: any;
|
|
75
|
-
isYMin: any;
|
|
76
|
-
isYMax: any;
|
|
77
|
-
isZMin: any;
|
|
78
|
-
isZMax: any;
|
|
79
|
-
};
|
|
80
|
-
_updateSpherePosition: (sphereState: any, newPosition: any) => void;
|
|
81
|
-
_updateRelatedCorners: (draggedSphere: any, newCorner: any, axisFlags: any) => void;
|
|
82
|
-
_shouldUpdateCorner: (cornerKey: any, axisFlags: any) => any;
|
|
83
|
-
_updateCornerCoordinates: (state: any, newCorner: any, cornerKey: any, axisFlags: any) => void;
|
|
84
|
-
_updateAfterCornerMovement: (viewport: any) => void;
|
|
85
|
-
_updateAfterFaceMovement: (viewport: any) => void;
|
|
86
|
-
_triggerToolChangedEvent: (sphereState: any) => void;
|
|
70
|
+
_getViewport: () => Types.IVolumeViewport | null;
|
|
71
|
+
_getVolumeActor(viewport?: Types.IVolumeViewport): Types.VolumeActor | undefined;
|
|
72
|
+
_getVolumeMapper(viewport?: Types.IVolumeViewport): vtkVolumeMapper | undefined;
|
|
73
|
+
_applyClippingPlanesToMapper(mapper: vtkVolumeMapper): void;
|
|
87
74
|
_updateClippingPlanesFromFaceSpheres(viewport: any): void;
|
|
88
75
|
_updateCornerSpheresFromFaces(): void;
|
|
89
76
|
_updateFaceSpheresFromCorners(): void;
|
|
@@ -91,6 +78,19 @@ declare class VolumeCroppingTool extends BaseTool {
|
|
|
91
78
|
_onNewVolume: () => void;
|
|
92
79
|
_unsubscribeToViewportNewVolumeSet(viewportsInfo: any): void;
|
|
93
80
|
_subscribeToViewportNewVolumeSet(viewports: any): void;
|
|
81
|
+
_rotateClippingPlanes: (evt: EventTypes.InteractionEventType) => void;
|
|
82
|
+
_getDirectionVectors(): {
|
|
83
|
+
xDir: Types.Point3;
|
|
84
|
+
yDir: Types.Point3;
|
|
85
|
+
zDir: Types.Point3;
|
|
86
|
+
};
|
|
87
|
+
_updateSpherePosition(sphereIndex: number, newPoint: Types.Point3): void;
|
|
88
|
+
_updateFaceSpheresFromClippingPlanes(): void;
|
|
89
|
+
_averagePoints(points: Types.Point3[]): Types.Point3;
|
|
90
|
+
_notifyClippingPlanesChanged(viewport?: any): void;
|
|
91
|
+
_calculateCornerFromFaces(faceX: Types.Point3, faceY: Types.Point3, faceZ: Types.Point3, xDir: Types.Point3, yDir: Types.Point3, zDir: Types.Point3): Types.Point3;
|
|
92
|
+
_calculateCornerFromProjection(faceX: Types.Point3, faceY: Types.Point3, faceZ: Types.Point3, xDir: Types.Point3, yDir: Types.Point3, zDir: Types.Point3): Types.Point3;
|
|
93
|
+
_updateEdgeLines(): void;
|
|
94
94
|
_rotateCamera: (viewport: any, centerWorld: any, axis: any, angle: any) => void;
|
|
95
95
|
}
|
|
96
96
|
export default VolumeCroppingTool;
|