import { Vector2, Vector3 } from 'three'; import { Section, Vector2D, Vector3D } from '../common/geometry'; export declare type OrientationString = 'axial' | 'sagittal' | 'coronal' | 'oblique'; /** * Converts 3D point in volume coordinate space to 2D point in screen space * using the given section. * @param section * @param resolution * @param volumePoint * @returns {Vector2} */ export declare function convertVolumeCoordinateToScreenCoordinate(section: Section, resolution: Vector2, volumePoint: Vector3): Vector2; /** * Converts 2D point in screen coordinate to 3D point in volume coordinate space. */ export declare function convertScreenCoordinateToVolumeCoordinate(section: Section, resolution: Vector2, screenPoint: Vector2): Vector3; /** * Investigates the section orientation and detects if the section * is (almost) orthogonal to one of the three axes. * @return One of 'axial', 'sagittal', 'coronal' or 'oblique' */ export declare function detectOrthogonalSection(section: Section): OrientationString; export declare function parallelToX(vec: Vector3): boolean; export declare function parallelToY(vec: Vector3): boolean; export declare function parallelToZ(vec: Vector3): boolean; /** * Converts the given section from index-coordinate to mm-coordinate. * @param indexSection The section to convert. * @param voxelSize Millimeter per voxel. */ export declare function convertSectionToMm(indexSection: Section, voxelSize: Vector3): Section; /** * Converts the given section from mm-coordinate to index-coordinate * @param mmSection The section to convert. * @param voxelSize Millimeter per voxel. */ export declare function convertSectionToIndex(mmSection: Section, voxelSize: Vector3): Section; export declare function convertPointToMm(indexPoint: Vector3, voxelSize: Vector3): Vector3; export declare function convertPointToIndex(mmPoint: Vector3, voxelSize: Vector3): Vector3; /** * Performs a parallel translation orthogonal to the screen (aka paging). * The sliding amount is determined according to the current section orientation. * When the section seems to be orthogonal to one of the axes, this performs a * voxel-by-voxel sliding. Otherwise, the sliding is done by a millimeter resolution. */ export declare function orientationAwareTranslation(section: Section, voxelSize: Vector3D, step?: number): Section; /** * Calculates the scale factor relative to the screen pixel * @returns The calculated scale factor, where 1 = pixel by pixel, 2 = 200%, 0.5 = 50% */ export declare function calculateScaleFactor(section: Section, mmDim: Vector3): number; /** * Calculates the "fit-to-the-viewer" initial view state section. * @param resolution The target viewer size in screen pixels * @param volumeSize The target volume size in millimeters * @param orientation The orthogonal section * @param position The position in the axis orthogonal to the screen * @returns {Section} */ export declare function createOrthogonalMprSection(resolution: Vector2D, volumeSize: Vector3D, orientation?: OrientationString, position?: number): Section; /** * Calculates the "fit-to-the-viewer" state section on resized. * * @param section * @param oldResolution * @param newResolution * @returns {Section} */ export declare function adjustOnResized(section: Section, oldResolution: Vector2D, newResolution: Vector2D): Section; /** * Returns true if the given section overlaps the volume. * @param mmSection The section in millimeters * @param resolution The viewer size in screen pixels * @param volumeSize The volume size in millimeters * @param voxelCount The voxel count */ export declare function sectionOverlapsVolume(mmSection: Section, resolution: Vector2, voxelSize: Vector3, voxelCount: Vector3): boolean;