import type { Types } from '@cornerstonejs/core'; import { StrategyCallbacks } from '../../../enums'; import type { LabelmapToolOperationDataAny } from '../../../types/LabelmapToolOperationData'; import type vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData'; import type { LabelmapMemo } from '../../../utilities/segmentation/createLabelmapMemo'; export type InitializedOperationData = LabelmapToolOperationDataAny & { operationName?: string; centerSegmentIndexInfo: { segmentIndex: number; hasSegmentIndex: boolean; hasPreviewIndex: boolean; changedIndices: number[]; }; enabledElement: Types.IEnabledElement; centerIJK?: Types.Point3; centerWorld: Types.Point3; isInObject: (point: Types.Point3) => boolean; isInObjectBoundsIJK: Types.BoundsIJK; viewport: Types.IViewport; imageVoxelManager: Types.IVoxelManager | Types.IVoxelManager; segmentationVoxelManager: Types.IVoxelManager; segmentationImageData: vtkImageData; previewSegmentIndex?: number; previewColor?: [number, number, number, number]; brushStrategy: BrushStrategy; activeStrategy: string; configuration?: { [key: string]: unknown; brushSize: number; centerSegmentIndex?: { segmentIndex: number; }; threshold?: { range?: number[]; isDynamic: boolean; dynamicRadius: number; dynamicRadiusInCanvas?: number; }; }; hoverData?: { brushCursor: any; segmentationId: string; segmentIndex: number; segmentColor: [number, number, number, number]; viewportIdsToRender: string[]; centerCanvas?: Array; viewport: Types.IViewport; }; memo?: LabelmapMemo; modified?: boolean; }; export type StrategyFunction = (operationData: InitializedOperationData, ...args: any[]) => unknown; export type CompositionInstance = { [callback in StrategyCallbacks]?: StrategyFunction; }; export type CompositionFunction = () => CompositionInstance; export type Composition = CompositionFunction | CompositionInstance; export default class BrushStrategy { static COMPOSITIONS: { determineSegmentIndex: { onInteractionStart: (operationData: InitializedOperationData) => void; }; dynamicThreshold: { initialize: (operationData: InitializedOperationData) => void; onInteractionStart: (operationData: InitializedOperationData) => void; computeInnerCircleRadius: (operationData: InitializedOperationData) => void; }; erase: { initialize: (operationData: InitializedOperationData) => void; }; islandRemoval: { onInteractionEnd: (operationData: InitializedOperationData) => void; }; preview: { preview: (operationData: InitializedOperationData) => any; initialize: (operationData: InitializedOperationData) => void; acceptPreview: (operationData: InitializedOperationData) => void; rejectPreview: (operationData: InitializedOperationData) => void; }; regionFill: { fill: (operationData: InitializedOperationData) => void; }; setValue: { setValue: (operationData: InitializedOperationData, { value, index }: { value: any; index: any; }) => void; }; threshold: { createIsInThreshold: (operationData: InitializedOperationData) => (index: any) => boolean; }; labelmapStatistics: { getStatistics: (enabledElement: any, operationData: InitializedOperationData, options?: { indices?: number | number[]; }) => void; }; ensureSegmentationVolumeFor3DManipulation: { ensureSegmentationVolumeFor3DManipulation: (data: any) => void; }; ensureImageVolumeFor3DManipulation: { ensureImageVolumeFor3DManipulation: (data: any) => void; }; circularCursor: { calculateCursorGeometry: (enabledElement: any, operationData: InitializedOperationData) => void; renderCursor: (enabledElement: any, operationData: InitializedOperationData, svgDrawingHelper: import("../../../types").SVGDrawingHelper) => void; }; }; protected static childFunctions: { onInteractionStart: (brushStrategy: any, func: any) => void; onInteractionEnd: (brushStrategy: any, func: any) => void; fill: (brushStrategy: any, func: any) => void; initialize: (brushStrategy: any, func: any) => void; createIsInThreshold: (brushStrategy: any, func: any) => void; interpolate: (brushStrategy: any, func: any) => void; acceptPreview: (brushStrategy: any, func: any) => void; rejectPreview: (brushStrategy: any, func: any) => void; setValue: (brushStrategy: any, func: any) => void; preview: (brushStrategy: any, func: any) => void; computeInnerCircleRadius: (brushStrategy: any, func: any) => void; ensureSegmentationVolumeFor3DManipulation: (brushStrategy: any, func: any) => void; ensureImageVolumeFor3DManipulation: (brushStrategy: any, func: any) => void; addPreview: (brushStrategy: any, func: any) => void; getStatistics: (brushStrategy: any, func: any) => void; calculateCursorGeometry: (brushStrategy: any, func: any) => void; renderCursor: (brushStrategy: any, func: any) => void; compositions: any; }; compositions: Composition[]; strategyFunction: (enabledElement: any, operationData: any) => unknown; protected configurationName: string; protected _initialize: any[]; protected _fill: any[]; protected _acceptPreview: []; protected _onInteractionStart: any[]; constructor(name: any, ...initializers: Composition[]); fill: (enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny) => InitializedOperationData; protected initialize(enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny, operationName?: string): InitializedOperationData; onInteractionStart: (enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny) => void; onInteractionEnd: (enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny) => void; rejectPreview: (enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny) => void; addPreview: (enabledElement: any, operationData: LabelmapToolOperationDataAny) => InitializedOperationData; acceptPreview: (enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny) => void; preview: (enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny) => unknown; interpolate: (enabledElement: Types.IEnabledElement, operationData: LabelmapToolOperationDataAny) => unknown; setValue: (operationData: InitializedOperationData, data: any) => void; createIsInThreshold: (operationData: InitializedOperationData) => any; calculateCursorGeometry: (enabledElement: Types.IEnabledElement, operationData: InitializedOperationData) => void; }