Class: ImageVolume
The base class for volume data. It includes the volume metadata and the volume data along with the loading status.
Constructors
new ImageVolume()
new ImageVolume(
props):ImageVolume
Parameters
• props: ImageVolumeProps
Returns
Defined in
packages/core/src/cache/classes/ImageVolume.ts:174
Properties
additionalDetails?
optionaladditionalDetails:Record<string,unknown>
Property to store additional information
Defined in
packages/core/src/cache/classes/ImageVolume.ts:137
cancelLoading()
cancelLoading: () =>
void
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:694
cornerstoneImageMetaData
protectedcornerstoneImageMetaData:any=null
Defined in
packages/core/src/cache/classes/ImageVolume.ts:95
dataType?
optionaldataType:PixelDataTypedArrayString
Defined in
packages/core/src/cache/classes/ImageVolume.ts:150
dimensions
dimensions:
Point3
Dimensions of the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:103
direction
direction:
Mat3
volume direction in world space
Defined in
packages/core/src/cache/classes/ImageVolume.ts:105
hasPixelSpacing
hasPixelSpacing:
boolean
whether the metadata for the pixel spacing is not undefined
Defined in
packages/core/src/cache/classes/ImageVolume.ts:135
imageData?
optionalimageData:vtkImageData
volume image data
Defined in
packages/core/src/cache/classes/ImageVolume.ts:127
isPreScaled
isPreScaled:
boolean=false
Defined in
packages/core/src/cache/classes/ImageVolume.ts:100
loadStatus?
optionalloadStatus:Record<string,unknown>
load status object for the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:129
metadata
metadata:
Metadata
volume metadata
Defined in
packages/core/src/cache/classes/ImageVolume.ts:107
numDimensionGroups
numDimensionGroups:
number
Property to store the number of dimension groups.
Deprecated
Defined in
packages/core/src/cache/classes/ImageVolume.ts:143
numFrames
numFrames:
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:171
numVoxels
numVoxels:
number
volume number of voxels
Defined in
packages/core/src/cache/classes/ImageVolume.ts:125
origin
origin:
Point3
volume origin, Note this is an opinionated origin for the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:109
referencedImageIds?
optionalreferencedImageIds:string[]
optional reference image ids if the volume is derived from a set of images in the image cache
Defined in
packages/core/src/cache/classes/ImageVolume.ts:133
referencedVolumeId?
optionalreferencedVolumeId:string
optional reference volume id if the volume is derived from another volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:131
scaling?
optionalscaling:object
volume scaling parameters if it contains scaled data
PT?
optionalPT:object
PT.SUVbsaFactor?
optionalSUVbsaFactor:number
PT.suvbwToSuvbsa?
optionalsuvbwToSuvbsa:number
PT.suvbwToSuvlbm?
optionalsuvbwToSuvlbm:number
PT.SUVlbmFactor?
optionalSUVlbmFactor:number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:112
spacing
spacing:
Point3
volume spacing in 3d world space
Defined in
packages/core/src/cache/classes/ImageVolume.ts:123
suppressWarnings
suppressWarnings:
boolean
Defined in
packages/core/src/cache/classes/ImageVolume.ts:172
totalNumFrames
protectedtotalNumFrames:number
volume scalar data 3D or 4D
Defined in
packages/core/src/cache/classes/ImageVolume.ts:94
volumeId
readonlyvolumeId:string
Read-only unique identifier for the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:98
voxelManager?
optionalvoxelManager:IVoxelManager<number> |IVoxelManager<RGB>
The new volume model which solely relies on the separate image data and do not cache the volume data at all
Defined in
packages/core/src/cache/classes/ImageVolume.ts:149
Accessors
compositeVoxelManager
getcompositeVoxelManager():CompositeVoxelManager<number|RGB>
The composite of this volume, which holds every representation of the voxel
data. The volume builds it on the first request, and the representation of
voxelManager is the primary one.
voxelManager stays the primary voxel manager, so a read through it reads
the data of this grid alone. A caller that wants the best data for a
region, at a resolution that it states, reads the composite.
The volume discards the composite when a caller assigns a new
voxelManager, because the alternate representations describe the data of
the voxel manager that produced them. volumeLoader.createLocalVolume
assigns a new voxel manager immediately after the construction, and the
discard makes that assignment safe.
sizeInBytes counts the primary voxel manager alone. A derived
representation is extra memory that the cache does not count yet.
Returns
CompositeVoxelManager<number | RGB>
Defined in
packages/core/src/cache/classes/ImageVolume.ts:388
imageIds
getimageIds():string[]
return the image ids for the volume if it is made of separated images
setimageIds(newImageIds):void
updates the image ids
Parameters
• newImageIds: string[]
Returns
string[]
Defined in
packages/core/src/cache/classes/ImageVolume.ts:672
numTimePoints
getnumTimePoints():number
Calculates the number of time points to be the number of dimension groups as a fallback for existing handling.
Deprecated
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:166
reductionStatistic
getreductionStatistic():VoxelStatistic
Statistic used when this volume must be reduced to fit a GPU texture. Intensity volumes use average. Labelmaps use foregroundMajority. Defaults to average.
setreductionStatistic(statistic):void
Set it before a render path provisions a texture. A derived representation keeps the statistic it was built with, but a reduced texture refills each dirty slice with the statistic of the volume at that time, so a later change mixes two statistics in one texture.
Parameters
• statistic: VoxelStatistic
Returns
Defined in
packages/core/src/cache/classes/ImageVolume.ts:330
sizeInBytes
getsizeInBytes():number
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:282
textureSets
gettextureSets():VolumeTextureSet<vtkStreamingOpenGLTexture>[]
The named texture sets of this volume, which the global store holds.
Returns
VolumeTextureSet<vtkStreamingOpenGLTexture>[]
Defined in
packages/core/src/cache/classes/ImageVolume.ts:495
voxelGrid
getvoxelGrid():VoxelGrid
The grid descriptor of the data of this volume.
The grid states the origin, the direction, the spacing and the dimensions that the volume already holds, and it states nothing else. There is no level index: the grid of this volume is the primary representation of the composite, and it carries no ordinal that would make it "level 0".
Each call gives a new record, and the record holds a copy of each array, so
a consumer that stores the grid is not exposed to a later change of
this.origin or of this.dimensions.
Returns
Defined in
packages/core/src/cache/classes/ImageVolume.ts:303
vtkOpenGLTexture
getvtkOpenGLTexture():vtkStreamingOpenGLTexture
The texture of the full-resolution grid, and not every texture of the
volume. The volume holds named sets of textures, and this member names the
one member of the set full-resolution/full-extent.
The value follows the store. It is undefined until something provisions
that set, and it returns to undefined when the store evicts that set. A
render path that draws a reduced grid reads a different set, and this value
stays undefined.
Returns
vtkStreamingOpenGLTexture
Defined in
packages/core/src/cache/classes/ImageVolume.ts:592
textureBudget
getstatictextureBudget():number
The number of bytes that the textures of every volume may take.
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:475
textureBytesUsed
getstatictextureBytesUsed():number
The number of bytes that the textures of every volume take.
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:470
Methods
claimTextureSet()
claimTextureSet(
name):boolean
Adds one holder of a named set, so an eviction cannot take it.
Parameters
• name: string
Returns
boolean
Defined in
packages/core/src/cache/classes/ImageVolume.ts:552
deliveredRegions()
protecteddeliveredRegions():DeliveredRegion[]
The regions of this volume that a loader has already delivered.
A volume of this class holds every voxel from the moment of its construction, and it therefore states nothing: a derivation reads the whole grid. A volume that loads its frames one at a time overrides this member and states which frames arrived, so that a derivation reduces those frames and no others.
Returns
Defined in
packages/core/src/cache/classes/ImageVolume.ts:321
destroy()
destroy():
void
destroy the volume and make it unusable
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:734
getCornerstoneImages()
getCornerstoneImages():
IImage[]
Returns an array of all the volume's images as Cornerstone images. It iterates over all the imageIds and converts them to Cornerstone images.
Returns
IImage[]
An array of Cornerstone images.
Defined in
packages/core/src/cache/classes/ImageVolume.ts:801
getFullResolutionTexture()
getFullResolutionTexture():
vtkStreamingOpenGLTexture
The texture of the full-resolution grid. The member provisions the set
named full-resolution/full-extent when the store does not hold it.
Returns
vtkStreamingOpenGLTexture
the texture, or undefined when the store refuses it
Defined in
packages/core/src/cache/classes/ImageVolume.ts:567
getGridQuality()
getGridQuality(
grid,statistic?):VoxelQualityRecord
The record of the data that a texture of one grid holds. A render path reads it for the grid that it bound. A reduced texture fills by box average straight from the source, so no representation of its grid needs to exist.
Parameters
• grid: VoxelGrid
• statistic?: VoxelStatistic
Returns
Defined in
packages/core/src/cache/classes/ImageVolume.ts:457
getImageIdByIndex()
getImageIdByIndex(
imageIdIndex):string
Parameters
• imageIdIndex: number
Returns
string
Defined in
packages/core/src/cache/classes/ImageVolume.ts:714
getImageIdIndex()
getImageIdIndex(
imageId):number
return the index of a given imageId
Parameters
• imageId: string
imageId
Returns
number
imageId index
Defined in
packages/core/src/cache/classes/ImageVolume.ts:710
getImageQuality()
getImageQuality(
_imageIdIndex):ImageQualityStatus
The quality of the data that the image of one image id index holds. A volume that does not stream holds every image at full resolution, and a streaming volume states the quality that each delivery recorded.
Parameters
• _imageIdIndex: number
Returns
the quality, or undefined when no data of the image has arrived
Defined in
packages/core/src/cache/classes/ImageVolume.ts:665
getImageURIIndex()
getImageURIIndex(
imageURI):number
return the index of a given imageURI
Parameters
• imageURI: string
Returns
number
imageURI index
Defined in
packages/core/src/cache/classes/ImageVolume.ts:723
getScalarDataLength()
getScalarDataLength():
number
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:769
getTextureSet()
getTextureSet(
name):VolumeTextureSet<vtkStreamingOpenGLTexture>
One named texture set of this volume.
Parameters
• name: string
Returns
VolumeTextureSet<vtkStreamingOpenGLTexture>
Defined in
packages/core/src/cache/classes/ImageVolume.ts:502
getVoxelQuality()
getVoxelQuality(
selector):VoxelQualityRecord
The absolute record of the data that a reader would get for a region, under the same three inputs that the selection takes.
The record states no verdict. A reader compares it against its own
requirement with compareVoxelQuality, so two viewports over one volume
can report a different verdict at the same moment.
Parameters
• selector: VoxelRepresentationSelector = {}
Returns
Defined in
packages/core/src/cache/classes/ImageVolume.ts:445
getVoxelRepresentations()
getVoxelRepresentations():
VoxelRepresentation<number|RGB>[]
Every representation of the voxel data, the primary one included.
Many representations can exist at one resolution, each one covering a different part of the volume, because a set of bricks is exactly that. A caller must not assume one representation for each spacing.
Returns
VoxelRepresentation<number | RGB>[]
Defined in
packages/core/src/cache/classes/ImageVolume.ts:419
imageIdIndexToFrameIndex()
protectedimageIdIndexToFrameIndex(imageIdIndex):number
Converts imageIdIndex into frameIndex which will be the same for 3D volumes but different for 4D volumes. The indices are 0 based.
Parameters
• imageIdIndex: number
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:791
invalidate()
invalidate():
void
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:747
isDynamicVolume()
isDynamicVolume():
boolean
return true if it is a 4D volume or false if it is 3D volume
Returns
boolean
Defined in
packages/core/src/cache/classes/ImageVolume.ts:697
load()
load(
callback?):void
Parameters
• callback?
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:727
markAllTexturesDirty()
markAllTexturesDirty():
void
Marks every voxel of every texture of every set for a refill.
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:652
markFrameModified()
markFrameModified(
frameIndex):void
Takes a change of the voxels of one frame at an unchanged quality.
An edit of a labelmap, or a computed volume that writes new values, is such a change. The member marks the textures.
Parameters
• frameIndex: number
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:647
markFrameTexturesDirty()
markFrameTexturesDirty(
frameIndex):void
Marks one frame for a refill in every texture of every set whose grid covers the frame. The member records no quality.
One frame changes several textures, because each texture that covers the frame reads the same voxels. A mark uploads nothing: the refill happens at the next render of each texture.
Parameters
• frameIndex: number
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:608
modified()
modified():
void
Updates the internals of the volume to reflect the changes in the underlying scalar data. This should be called when the scalar data is modified externally
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:758
provisionTextureSet()
provisionTextureSet(
options):VolumeTextureSet<vtkStreamingOpenGLTexture>
Provisions a named texture set. This is the expensive step: it counts the cost, evicts if it must, and allocates the textures.
A set of this name that already exists comes back as it is, so a caller may ask without a test of its own.
Parameters
• options: VolumeProvisionTextureSetOptions
Returns
VolumeTextureSet<vtkStreamingOpenGLTexture>
the set, or undefined when the store refuses it
Defined in
packages/core/src/cache/classes/ImageVolume.ts:520
recordFrameDelivery()
recordFrameDelivery(
frameIndex,quality):void
Records that the data of one frame arrived at a known quality.
The composite records the delivery. Only a caller that knows the quality of the data calls this member, because a lower record never replaces a higher one.
The member marks no texture. A loader calls markFrameTexturesDirty too.
Parameters
• frameIndex: number
• quality: ImageQualityStatus
the quality of the data that arrived
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:630
releaseTextureSet()
releaseTextureSet(
name):boolean
Gives one holder of a named set back.
Parameters
• name: string
Returns
boolean
Defined in
packages/core/src/cache/classes/ImageVolume.ts:557
removeFromCache()
removeFromCache():
void
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:765
resetCompositeVoxelManager()
protectedresetCompositeVoxelManager():void
Discards the composite, so that the next read builds it again from
deliveredRegions. A caller that replaces every voxel of the volume calls
this member, because each record then describes data that the volume no
longer holds.
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:366
selectVoxelRepresentation()
selectVoxelRepresentation(
selector):VoxelRepresentation<number|RGB>
The representation that a reader gets for a region, at a statistic, under a ceiling. The ceiling is the resolution that the caller will use, so a render path that fills a texture at one eighth passes the spacing of that texture, and the selection does not return the full-resolution data.
The selection never creates a representation.
Parameters
• selector: VoxelRepresentationSelector = {}
Returns
VoxelRepresentation<number | RGB>
Defined in
packages/core/src/cache/classes/ImageVolume.ts:431
clearTextureSets()
staticclearTextureSets():void
Removes every texture set of every volume.
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:490
setTextureBudget()
staticsetTextureBudget(bytes):void
States the budget of the texture memory of every volume. An application states it from a capability profile, and a budget that nobody states is no limit, so the behaviour of a viewport does not change.
Parameters
• bytes: number
Returns
void