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:180
Properties
additionalDetails?
optionaladditionalDetails:Record<string,unknown>
Property to store additional information
Defined in
packages/core/src/cache/classes/ImageVolume.ts:143
cancelLoading()
cancelLoading: () =>
void
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:816
cornerstoneImageMetaData
protectedcornerstoneImageMetaData:any=null
Defined in
packages/core/src/cache/classes/ImageVolume.ts:101
dataType?
optionaldataType:PixelDataTypedArrayString
Defined in
packages/core/src/cache/classes/ImageVolume.ts:156
dimensions
dimensions:
Point3
Dimensions of the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:109
direction
direction:
Mat3
volume direction in world space
Defined in
packages/core/src/cache/classes/ImageVolume.ts:111
hasPixelSpacing
hasPixelSpacing:
boolean
whether the metadata for the pixel spacing is not undefined
Defined in
packages/core/src/cache/classes/ImageVolume.ts:141
imageData?
optionalimageData:vtkImageData
volume image data
Defined in
packages/core/src/cache/classes/ImageVolume.ts:133
isPreScaled
isPreScaled:
boolean=false
Defined in
packages/core/src/cache/classes/ImageVolume.ts:106
loadStatus?
optionalloadStatus:Record<string,unknown>
load status object for the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:135
metadata
metadata:
Metadata
volume metadata
Defined in
packages/core/src/cache/classes/ImageVolume.ts:113
numDimensionGroups
numDimensionGroups:
number
Property to store the number of dimension groups.
Deprecated
Defined in
packages/core/src/cache/classes/ImageVolume.ts:149
numFrames
numFrames:
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:177
numVoxels
numVoxels:
number
volume number of voxels
Defined in
packages/core/src/cache/classes/ImageVolume.ts:131
origin
origin:
Point3
volume origin, Note this is an opinionated origin for the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:115
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:139
referencedVolumeId?
optionalreferencedVolumeId:string
optional reference volume id if the volume is derived from another volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:137
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:118
spacing
spacing:
Point3
volume spacing in 3d world space
Defined in
packages/core/src/cache/classes/ImageVolume.ts:129
suppressWarnings
suppressWarnings:
boolean
Defined in
packages/core/src/cache/classes/ImageVolume.ts:178
totalNumFrames
protectedtotalNumFrames:number
volume scalar data 3D or 4D
Defined in
packages/core/src/cache/classes/ImageVolume.ts:100
volumeId
readonlyvolumeId:string
Read-only unique identifier for the volume
Defined in
packages/core/src/cache/classes/ImageVolume.ts:104
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:155
Accessors
compositeVoxelManager
getcompositeVoxelManager():CompositeVoxelManager<number|RGB>
Returns
CompositeVoxelManager<number | RGB>
Defined in
packages/core/src/cache/classes/ImageVolume.ts:413
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:794
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:172
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:364
sizeInBytes
getsizeInBytes():number
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:288
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:596
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:319
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:704
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:577
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:572
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:656
createVoxelRepresentation()
createVoxelRepresentation(
options):VoxelRepresentation<number|RGB>
Derives a new representation from the data that the volume already holds, and adds that representation to the composite.
A derivation always goes from a higher resolution to a lower one. Data that
no derivation can give arrives through compositeVoxelManager.acceptData,
which is the member that a loader calls.
Parameters
• options: CreateVoxelRepresentationOptions
Returns
VoxelRepresentation<number | RGB>
Defined in
packages/core/src/cache/classes/ImageVolume.ts:525
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:355
destroy()
destroy():
void
destroy the volume and make it unusable
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:856
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:924
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:679
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:551
getImageIdByIndex()
getImageIdByIndex(
imageIdIndex):string
Parameters
• imageIdIndex: number
Returns
string
Defined in
packages/core/src/cache/classes/ImageVolume.ts:836
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:832
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:787
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:845
getScalarDataLength()
getScalarDataLength():
number
Returns
number
Defined in
packages/core/src/cache/classes/ImageVolume.ts:892
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:603
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:539
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:498
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:914
invalidate()
invalidate():
void
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:870
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:819
load()
load(
callback?):void
Parameters
• callback?
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:849
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:774
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 redoes the derived boxes of the frame, whatever the record of earlier refreshes states, and it marks the textures.
Parameters
• frameIndex: number
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:765
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 and redoes no derived box.
One frame changes several textures, because each texture that covers the frame reads the same voxels, and MR-API-IV-6 states that rule. 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:720
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:881
pinTextureSet()
pinTextureSet(
name):boolean
Keeps a named set until this volume leaves the cache, whatever the budget. A legacy viewport draws a set that it holds no claim on, so it pins it.
Parameters
• name: string
Returns
boolean
Defined in
packages/core/src/cache/classes/ImageVolume.ts:664
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.
ownerId gives a set of slabs that re-point, and exactly one owner holds
such a set, because the owner is the only party that knows when a draw
starts and stops.
Parameters
• options: VolumeProvisionTextureSetOptions
Returns
VolumeTextureSet<vtkStreamingOpenGLTexture>
the set, or undefined when the store refuses it
Defined in
packages/core/src/cache/classes/ImageVolume.ts:625
recordFrameDelivery()
recordFrameDelivery(
frameIndex,quality):void
Records that the data of one frame arrived at a known quality.
The composite records the delivery, and it redoes the boxes of every derived representation that the frame changed, because a derivation must follow the load. A second record of the same frame at the same quality redoes nothing. 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:744
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:669
removeFromCache()
removeFromCache():
void
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:888
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 and each derived representation then
describes data that the volume no longer holds.
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:408
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. createVoxelRepresentation creates, and the
caller decides whether a new representation is worth its cost.
Parameters
• selector: VoxelRepresentationSelector = {}
Returns
VoxelRepresentation<number | RGB>
Defined in
packages/core/src/cache/classes/ImageVolume.ts:511
clearTextureSets()
staticclearTextureSets():void
Removes every texture set of every volume.
Returns
void
Defined in
packages/core/src/cache/classes/ImageVolume.ts:591
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