import DicomVolume from '../../common/DicomVolume'; import ImageSource from './ImageSource'; import Viewer from '../viewer/Viewer'; import ViewState, { TransferFunction } from '../ViewState'; import DicomVolumeLoader from './volume-loader/DicomVolumeLoader'; /** * Container for a WebGL texture. */ interface VolumeTexture { textureSize: [number, number]; sliceGridSize: [number, number]; sliceSize: [number, number]; texture: WebGLTexture; } interface VolumeRenderingImageSourceOptions { volumeLoader: DicomVolumeLoader; vertexShaderSource: string; fragmentShaderSource: string; } export default class VolumeRenderingImageSource extends ImageSource { private metadata; private volume; private glHandler; private volumeTexture; private loadSequence; private transferFunction; private subVolume; private transferFunctionTexture; private baseScale; private vertexShaderSource; private fragmentShaderSource; constructor({ volumeLoader, vertexShaderSource, fragmentShaderSource }: VolumeRenderingImageSourceOptions); ready(): Promise; initialState(viewer: Viewer): ViewState; /** * Performs the main rendering. * @param viewer * @param viewState * @returns {Promise} */ draw(viewer: Viewer, viewState: ViewState): Promise; private createCamera; private baseMatrix; /** * Prepare a color mapping texture from the given transfer function * and send it to GPU. Each texel in the texture corresponds to * each intensity value in the original image represented as a Uint16 value. * The texture size is 256 x 256 x 4bpp (fixed) or 240KiB. */ protected updateTransferFunction(transferFunction: TransferFunction): void; /** * Packs the original volume into a (large) texture and send it to GPU. * Each Z-slice of the volume will be arranged as a tile. * As of WegGL 1.0, there is no straightforward texture format * to store 2-byte integers. * As a workaround, we use gl.LUMINANCE_ALPHA format * which is 16bit per texel. (We absolutely need to disable interpolation!) */ bufferVolumeTexture(gl: WebGLRenderingContext, volume: DicomVolume): VolumeTexture; private glSetup; private updateVolumeBoxBuffer; private glDrawVolumeBox; } export {};