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