import Annotation from './Annotation'; import Viewer from '../viewer/Viewer'; import ViewState from '../ViewState'; import MprImageSource from '../image-source/MprImageSource'; import RawData from '../../common/RawData'; /** * VoxelCloud is a type of Annotation that can be registered to a Composition. * This represents one voxel cloud annotation (aka voxel label). * An instance of VoxelCloud can be updated manually by the consumer * of CIRCUS RS, or automatically by various cloud manipulation tools. */ export default class VoxelCloud implements Annotation { /** * ShadowCanvas is a background canvas used to perform * various pixel-based composite operations. */ private static shadowCanvas; /** * Displayed color of the cloud, in the form of '#ff00ff' */ color?: string; /** * Alpha value of the cloud, must be between 0.0 and 1.0 */ alpha?: number; /** * Actual volume data. The pixelFormat must be set to Binary. */ volume?: RawData; /** * The position of the origin of this volume data * in the voxel coordinate of ImageSource. * Should be in voxel coordinate (not in mm)! */ origin?: [number, number, number]; /** * Determines whether this VoxelCloud is the target of the * cloud manipulation tools (e.g., BrushTool, EraserTool). */ active: boolean; /** * If set to true, draws some additional marks useful for debugging. */ debugPoint: boolean; private _voxelSize?; private _expanded; readonly expanded: boolean; /** * Prepares a shadow canvas, which is large enough to contain * the given size. The shadow canvas can be used to * perform background image processing. */ private prepareShadowCanvas; private toMillimeter; /** * Removes zero-area along the bounding box. * @returns True if the volume has at least one nonzero voxel * and the minimization succeeded */ shrinkToMinimum(): boolean; /** * Expands this volume so that it covers the entire volume of * the parent volume image source. */ expandToMaximum(source: MprImageSource): void; draw(viewer: Viewer, viewState: ViewState): void; }