@cornerstonejs/tools 4.18.4 → 5.0.0-beta.1
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 +35 -10
- package/dist/esm/tools/VolumeCroppingControlTool.js +699 -179
- package/dist/esm/tools/VolumeCroppingTool.d.ts +32 -32
- package/dist/esm/tools/VolumeCroppingTool.js +525 -775
- package/dist/esm/utilities/index.d.ts +1 -2
- package/dist/esm/utilities/index.js +1 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +3 -3
- package/dist/esm/utilities/draw3D/addLine3DBetweenPoints.d.ts +0 -7
- package/dist/esm/utilities/draw3D/addLine3DBetweenPoints.js +0 -34
- package/dist/esm/utilities/draw3D/calculateAdaptiveSphereRadius.d.ts +0 -6
- package/dist/esm/utilities/draw3D/calculateAdaptiveSphereRadius.js +0 -7
- package/dist/esm/utilities/draw3D/index.d.ts +0 -2
- package/dist/esm/utilities/draw3D/index.js +0 -2
- package/dist/esm/utilities/volumeCropping/computePlanePlaneIntersection.d.ts +0 -6
- package/dist/esm/utilities/volumeCropping/computePlanePlaneIntersection.js +0 -37
- package/dist/esm/utilities/volumeCropping/constants.d.ts +0 -31
- package/dist/esm/utilities/volumeCropping/constants.js +0 -31
- package/dist/esm/utilities/volumeCropping/copyClippingPlanes.d.ts +0 -2
- package/dist/esm/utilities/volumeCropping/copyClippingPlanes.js +0 -6
- package/dist/esm/utilities/volumeCropping/extractVolumeDirectionVectors.d.ts +0 -9
- package/dist/esm/utilities/volumeCropping/extractVolumeDirectionVectors.js +0 -9
- package/dist/esm/utilities/volumeCropping/findLineBoundsIntersection.d.ts +0 -5
- package/dist/esm/utilities/volumeCropping/findLineBoundsIntersection.js +0 -50
- package/dist/esm/utilities/volumeCropping/getColorKeyForPlaneIndex.d.ts +0 -1
- package/dist/esm/utilities/volumeCropping/getColorKeyForPlaneIndex.js +0 -13
- package/dist/esm/utilities/volumeCropping/getOrientationFromNormal.d.ts +0 -2
- package/dist/esm/utilities/volumeCropping/getOrientationFromNormal.js +0 -19
- package/dist/esm/utilities/volumeCropping/index.d.ts +0 -9
- package/dist/esm/utilities/volumeCropping/index.js +0 -9
- package/dist/esm/utilities/volumeCropping/parseCornerKey.d.ts +0 -8
- package/dist/esm/utilities/volumeCropping/parseCornerKey.js +0 -11
- package/dist/esm/utilities/volumeCropping/types.d.ts +0 -5
- package/dist/esm/utilities/volumeCropping/types.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
|
|
1
2
|
import { AnnotationTool } from './base';
|
|
2
3
|
import type { Types } from '@cornerstonejs/core';
|
|
3
4
|
import type { Annotation, Annotations, EventTypes, ToolHandle, PublicToolProps, ToolProps, InteractionTypes, SVGDrawingHelper } from '../types';
|
|
4
|
-
import { type ClippingPlane } from '../utilities/volumeCropping';
|
|
5
5
|
type ReferenceLine = [
|
|
6
6
|
viewport: {
|
|
7
7
|
id: string;
|
|
@@ -10,39 +10,60 @@ type ReferenceLine = [
|
|
|
10
10
|
},
|
|
11
11
|
startPoint: Types.Point2,
|
|
12
12
|
endPoint: Types.Point2,
|
|
13
|
-
type: 'min' | 'max'
|
|
14
|
-
planeIndex?: number
|
|
13
|
+
type: 'min' | 'max'
|
|
15
14
|
];
|
|
16
15
|
interface VolumeCroppingAnnotation extends Annotation {
|
|
17
16
|
data: {
|
|
18
17
|
handles: {
|
|
19
18
|
activeOperation: number | null;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
toolCenter: Types.Point3;
|
|
20
|
+
toolCenterMin: Types.Point3;
|
|
21
|
+
toolCenterMax: Types.Point3;
|
|
23
22
|
};
|
|
24
23
|
activeViewportIds: string[];
|
|
25
24
|
viewportId: string;
|
|
26
25
|
referenceLines: ReferenceLine[];
|
|
26
|
+
clippingPlanes?: vtkPlane[];
|
|
27
|
+
clippingPlaneReferenceLines?: ReferenceLine[];
|
|
27
28
|
orientation?: string;
|
|
28
29
|
};
|
|
30
|
+
isVirtual?: boolean;
|
|
31
|
+
virtualNormal?: Types.Point3;
|
|
29
32
|
}
|
|
30
33
|
declare class VolumeCroppingControlTool extends AnnotationTool {
|
|
34
|
+
_virtualAnnotations: VolumeCroppingAnnotation[];
|
|
31
35
|
static toolName: any;
|
|
32
36
|
seriesInstanceUID?: string;
|
|
33
|
-
|
|
37
|
+
sphereStates: {
|
|
38
|
+
point: Types.Point3;
|
|
39
|
+
axis: string;
|
|
40
|
+
uid: string;
|
|
41
|
+
sphereSource: any;
|
|
42
|
+
sphereActor: any;
|
|
43
|
+
}[];
|
|
44
|
+
draggingSphereIndex: number | null;
|
|
45
|
+
toolCenter: Types.Point3;
|
|
46
|
+
toolCenterMin: Types.Point3;
|
|
47
|
+
toolCenterMax: Types.Point3;
|
|
34
48
|
_getReferenceLineColor?: (viewportId: string) => string;
|
|
35
49
|
_getReferenceLineControllable?: (viewportId: string) => boolean;
|
|
36
50
|
constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps);
|
|
37
|
-
|
|
51
|
+
_updateToolCentersFromViewport(viewport: any): void;
|
|
52
|
+
initializeViewport: ({ renderingEngineId, viewportId, }: Types.IViewportId) => {
|
|
53
|
+
normal: Types.Point3;
|
|
54
|
+
point: Types.Point3;
|
|
55
|
+
};
|
|
38
56
|
_getViewportsInfo: () => any[];
|
|
39
57
|
onSetToolInactive(): void;
|
|
40
58
|
onSetToolActive(): void;
|
|
41
59
|
onSetToolEnabled(): void;
|
|
42
60
|
onSetToolDisabled(): void;
|
|
43
61
|
resetCroppingSpheres: () => void;
|
|
44
|
-
|
|
45
|
-
|
|
62
|
+
computeToolCenter: () => void;
|
|
63
|
+
_computeToolCenter: (viewportsInfo: any) => void;
|
|
64
|
+
_getOrientationFromNormal(normal: Types.Point3): string | null;
|
|
65
|
+
_syncWithVolumeCroppingTool(originalClippingPlanes: any): void;
|
|
66
|
+
setToolCenter(toolCenter: Types.Point3, handleType: any): void;
|
|
46
67
|
addNewAnnotation(evt: EventTypes.InteractionEventType): VolumeCroppingAnnotation;
|
|
47
68
|
cancel: () => void;
|
|
48
69
|
isPointNearTool: (element: HTMLDivElement, annotation: VolumeCroppingAnnotation, canvasCoords: Types.Point2, proximity: number) => boolean;
|
|
@@ -57,10 +78,14 @@ declare class VolumeCroppingControlTool extends AnnotationTool {
|
|
|
57
78
|
_onNewVolume: () => void;
|
|
58
79
|
_unsubscribeToViewportNewVolumeSet(viewportsInfo: any): void;
|
|
59
80
|
_subscribeToViewportNewVolumeSet(viewports: any): void;
|
|
81
|
+
_getAnnotationsForViewportsWithDifferentCameras: (enabledElement: any, annotations: any) => any;
|
|
82
|
+
_filterViewportWithSameOrientation: (enabledElement: any, referenceAnnotation: any, annotations: any) => any;
|
|
60
83
|
_activateModify: (element: any) => void;
|
|
61
84
|
_deactivateModify: (element: any) => void;
|
|
62
85
|
_endCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
63
86
|
_dragCallback: (evt: EventTypes.InteractionEventType) => void;
|
|
87
|
+
_applyDeltaShiftToSelectedViewportCameras(renderingEngine: any, viewportsAnnotationsToUpdate: any, delta: any): void;
|
|
88
|
+
_applyDeltaShiftToViewportCamera(renderingEngine: Types.IRenderingEngine, annotation: any, delta: any): void;
|
|
64
89
|
_pointNearTool(element: any, annotation: any, canvasCoords: any, proximity: any): boolean;
|
|
65
90
|
}
|
|
66
91
|
export default VolumeCroppingControlTool;
|