import { Enums } from '@cornerstonejs/core'; import type { Types } from '@cornerstonejs/core'; import { AnnotationTool } from './base/index.js'; import type { Plane, WorldLine } from '../utilities/spatial/index.js'; import type { Annotation, Annotations, EventTypes, InteractionTypes, PublicToolProps, SVGDrawingHelper, ToolHandle, ToolProps } from '../types/index.js'; export type MprPlaneFamily = 'axial' | 'sagittal' | 'coronal'; export type SliceIntersectionOperation = 'translate' | 'rotate' | 'slabThickness'; export type SliceIntersectionPlaneGroup = { id: string; family: MprPlaneFamily; frameOfReferenceUID: string; viewportIds: string[]; leaderViewportId: string; }; export type SliceIntersectionState = { toolGroupId: string; activeGroupId?: string; activeTargetViewportId?: string; activeOperation?: SliceIntersectionOperation | null; }; export type SliceIntersectionRotationPivotPolicy = 'currentIntersection' | 'viewportCenter' | 'worldCrosshairPointIfAvailable'; export type SliceIntersectionToolConfiguration = { showCurrentSliceLine: boolean; showSlabThickness: boolean; showBoundaryLines: boolean; showIntermediateLines: boolean; draggable: boolean; rotatable: boolean; slabThicknessControls: boolean; lineWidth: number; activeLineWidth: number; handleRadius: number; alignGroupsOnEnable: boolean; rotationPivotPolicy: SliceIntersectionRotationPivotPolicy; familyColors: Record; getLineColor?: (family: MprPlaneFamily, groupId: string, targetViewportId: string) => string; setWorldCrosshairOnIntersectionDoubleClick: boolean; jumpToIntersectionOnDoubleClick: boolean; slabThicknessBlendMode: Enums.BlendModes; perViewportLines: boolean; }; export type SliceIntersectionManipulationEventDetail = { toolGroupId: string; groupId: string; family?: MprPlaneFamily; viewportIds: string[]; targetViewportId: string; operation: SliceIntersectionOperation; }; export type SliceIntersectionLineSelectedEventDetail = { toolGroupId: string; groupId: string; targetViewportId: string; }; export type SliceIntersectionAnnotation = Annotation & { data: { viewportId: string; handles: { points: Types.Point3[]; }; }; }; export type RenderedIntersectionLine = { groupId: string; family: MprPlaneFamily; leaderViewportId: string; memberViewportIds: string[]; targetViewportId: string; line: WorldLine; leaderPlane: Plane; canvasPoints: [Types.Point2, Types.Point2]; slabLineSegments: Array<[Types.Point2, Types.Point2]>; boundaryLineSegments: Array<[Types.Point2, Types.Point2]>; rotateHandles: Types.Point2[]; slabHandles: Types.Point2[]; color: string; isActive: boolean; }; declare class SliceIntersectionTool extends AnnotationTool { static toolName: any; static toolLabel: string; private _activeGroupId?; private _activeTargetViewportId?; private _activeOperation; private _renderedLines; private _pendingHandle; private _editData; private _mprFamilyByViewportId; private _passViewportsById; private _passPlaneGroups; private _passCacheClearScheduled; constructor(toolProps?: PublicToolProps, defaultToolProps?: ToolProps); getState(): SliceIntersectionState; getPlaneGroups(): SliceIntersectionPlaneGroup[]; refreshPlaneFamilies(): void; onSetToolEnabled(): void; onSetToolActive(): void; onSetToolPassive(): void; onSetToolDisabled(): void; onCameraModified: (evt: Types.EventTypes.CameraModifiedEvent) => void; protected _getMprFamily(viewport: Types.IViewport): MprPlaneFamily | null; protected _getPlaneGroups(): SliceIntersectionPlaneGroup[]; private _computePlaneGroups; protected _alignPlaneGroups(): void; renderAnnotation: (enabledElement: Types.IEnabledElement, svgDrawingHelper: SVGDrawingHelper) => boolean; protected _computeLinesForTarget(targetViewport: Types.IViewport): RenderedIntersectionLine[]; private _computeLineForGroup; private _clipOffsetPlaneIntersection; private _appendSlabGeometry; private _appendBoundaryGeometry; private _getSourceExtentAlongNormal; private _appendHandles; private _computeSlabHandles; addNewAnnotation: (evt: EventTypes.InteractionEventType) => SliceIntersectionAnnotation; isPointNearTool: (element: HTMLDivElement, _annotation: SliceIntersectionAnnotation, canvasCoords: Types.Point2, _proximity: number, _interactionType?: string) => boolean; getHandleNearImagePoint(element: HTMLDivElement, _annotation: Annotation, canvasCoords: Types.Point2, proximity: number): ToolHandle | undefined; toolSelectedCallback: (evt: EventTypes.InteractionEventType, _annotation: Annotation) => void; handleSelectedCallback: (evt: EventTypes.InteractionEventType, _annotation: Annotation, _handle: ToolHandle, _interactionType?: InteractionTypes) => void; doubleClickCallback: (evt: EventTypes.MouseDoubleClickEventType) => void; mouseMoveCallback: (evt: EventTypes.MouseMoveEventType, _filteredToolAnnotations?: Annotations) => boolean; filterInteractableAnnotationsForElement: (element: HTMLDivElement, annotations: Annotations) => Annotations; cancel: (element: HTMLDivElement) => void; private _startManipulation; private _endManipulation; _endCallback: (evt: EventTypes.InteractionEventType) => void; _dragCallback: (evt: EventTypes.InteractionEventType) => void; private _applyTranslate; private _applyRotate; private _applySlabThickness; private _setViewportSlabThickness; private _isPlanarViewport; private _isVolumeModeViewport; private _getSourceDataId; private _getSourceSlabThickness; private _resolveRotationPivot; private _closestPointOnLine; private _centerViewportOnPoint; private _selectLine; private _findLineNear; protected _getViewportsInfo(): Types.IViewportId[]; protected _getToolGroupViewports(): Types.IViewport[]; private _getViewportById; private _clearPassCaches; private _schedulePassCacheClear; private _renderToolViewports; private _getOrCreateViewportAnnotation; private _createDetachedAnnotation; private _getManipulationDetail; } export default SliceIntersectionTool;