import { BaseTool } from "./BaseTool"; import type { ToolContext } from "./BaseTool"; import type { SliceRenderHostDeps } from "./ToolHost"; /** * Manages slice rendering pipeline: slice setup, canvas rendering, and view helpers. * * Extracted from NrrdTools.ts to reduce its size. * Follows the same BaseTool + ToolContext + Callbacks pattern as other tools. */ export declare class SliceRenderPipeline extends BaseTool { private callbacks; private initState; constructor(ctx: ToolContext, callbacks: SliceRenderHostDeps); /** * Reset initState to true (called from NrrdTools.reset() when switching datasets). */ resetInitState(): void; /****************************Slice Setup****************************************************/ setDisplaySlicesBaseOnAxis(): void; private loadDisplaySlicesArray; resetDisplaySlicesStatus(): void; /** * Swap slice data for register/origin switching without resetting * slice index, zoom (sizeFactor), or pan position. */ switchPreservingView(): void; private setupConfigs; private setMainPreSlice; private setOriginCanvasAndPre; afterLoadSlice(): void; private updateMaxIndex; /****************************Rendering****************************************************/ /** * Phase 3: Reload all mask layers from MaskVolume using buffer reuse * Replaces the old reloadMaskToLayer approach */ reloadMasksFromVolume(): void; /******************************** redraw display canvas ***************************************/ /** * Redraw current contrast image to display canvas. * It is more related to change the contrast slice image's window width or center. */ redrawDisplayCanvas(): void; redrawMianPreOnDisplayCanvas(): void; /** * flip the canvas to a correct position. * This is because the slice canvas from threejs is not in a correct 2D postion. * Thus, everytime when we redraw the display canvas, we need to flip to draw the origin canvas from threejs. * Under different axis(sagittal, Axial, Coronal), the flip orientation is different. */ flipDisplayImageByAxis(): void; /** * Set the empty canvas width and height based on the axis (pixel distance not the mm), to reduce duplicate codes. * * @param axis */ setEmptyCanvasSize(axis?: "x" | "y" | "z"): void; /** * Clear masks on drawingCanvas layers. */ resetLayerCanvas(): void; /****************************View/Canvas Helpers****************************************************/ /** * Resize the draw and display canvas size based on the input size factor number. * @param factor number */ resizePaintArea(factor: number): void; /** * Reset the draw and display canvases layout after mouse pan. * If no params in, then center the draw and display canvases. * @param l number, Offset to the left * @param t number, Offset to the top */ resetPaintAreaUIPosition(l?: number, t?: number): void; /** * Update the original canvas size, allow set to threejs load one (pixel distance not the mm). * Then update the changedWidth and changedHeight based on the sizeFactor. */ updateOriginAndChangedWH(): void; /** * Keep all contrast slice index to same. * Synchronize the slice indexes of all the contrasts so that they are consistent with the main slice's index. */ setSyncsliceNum(): void; }