Skip to main content

Volumes

A volume is a 3D data array that has a physical size and orientation in space. It can be built by composing pixel data and metadata of a 3D imaging series, or can be defined from scratch by the application. A volume has a FrameOfReferenceUID, voxelSpacing (x,y,z), voxel dimensions (x,y,z), origin, and orientation vectors which uniquely define its coordinate system with respect to the patient coordinate system.

ImageVolume

In Cornerstone3D we use the ImageVolume base class to represent a 3D image volume. All volumes are derived from this class. For instance the StreamingImageVolume which is used to represent a volume that is being streamed image by image. We will discuss the StreamingImageVolume class in more detail later.

interface IImageVolume {
/** unique identifier of the volume in the cache */
readonly volumeId: string
/** volume dimensions */
dimensions: Point3
/** volume direction */
direction: Float32Array
/** volume metadata */
metadata: Metadata
/** volume origin - set to the imagePositionPatient of the last image in the volume */
origin: Point3
/** volume scalar data */
scalarData: any
/** volume scaling metadata */
scaling?: {
PET?: {
SUVlbmFactor?: number
SUVbsaFactor?: number
suvbwToSuvlbm?: number
suvbwToSuvbsa?: number
}
}
/** volume size in bytes */
sizeInBytes?: number
/** volume spacing */
spacing: Point3
/** number of voxels in the volume */
numVoxels: number
/** volume image data as vtkImageData */
imageData?: vtkImageData
/** openGL texture for the volume */
vtkOpenGLTexture: any
/** loading status object for the volume containing loaded/loading statuses */
loadStatus?: Record<string, any>
/** imageIds of the volume (if it is built of separate imageIds) */
imageIds?: Array<string>
/** volume referencedVolumeId (if it is derived from another volume) */
referencedVolumeId?: string // if volume is derived from another volume
/** method to convert the volume data in the volume cache, to separate images in the image cache */
convertToCornerstoneImage?: (
imageId: string,
imageIdIndex: number
) => IImageLoadObject
}