Skip to main content

StreamingDynamicImageVolume

Streaming Image Volume Class that extends StreamingImageVolume base class. It implements load method to load the imageIds and insert them into the volume.

Hierarchy

  • default
    • StreamingDynamicImageVolume

Implements

Index

Constructors

constructor

Properties

dimensions

dimensions: Point3

Dimensions of the volume

direction

direction: Mat3

volume direction in world space

hasPixelSpacing

hasPixelSpacing: boolean

whether the metadata for the pixel spacing is not undefined

optionalimageData

imageData?: vtkImageData

volume image data

isPrescaled

isPrescaled: boolean = false

Whether preScaling has been performed on the volume

loadStatus

loadStatus: { cachedFrames: boolean[]; callbacks: (...args: unknown[]) => void[]; cancelled: boolean; loaded: boolean; loading: boolean }

loading status object for the volume containing loaded/loading statuses


Type declaration

  • cachedFrames: boolean[]
  • callbacks: (...args: unknown[]) => void[]
  • cancelled: boolean
  • loaded: boolean
  • loading: boolean

metadata

metadata: Metadata

volume metadata

numVoxels

numVoxels: number

volume number of voxels

origin

origin: Point3

volume origin, Note this is an opinionated origin for the volume

optionalreferencedVolumeId

referencedVolumeId?: string

optional reference volume id if the volume is derived from another volume

optionalscaling

scaling?: { PET?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number } }

volume scaling parameters if it contains scaled data


Type declaration

  • optionalPET?: { SUVbsaFactor?: number; SUVlbmFactor?: number; suvbwToSuvbsa?: number; suvbwToSuvlbm?: number }
    • optionalSUVbsaFactor?: number
    • optionalSUVlbmFactor?: number
    • optionalsuvbwToSuvbsa?: number
    • optionalsuvbwToSuvlbm?: number

optionalsizeInBytes

sizeInBytes?: number

volume size in bytes

spacing

spacing: Point3

volume spacing in 3d world space

readonlyvolumeId

volumeId: string

Read-only unique identifier for the volume

vtkOpenGLTexture

vtkOpenGLTexture: any

open gl texture for the volume

Accessors

publicimageIds

  • get imageIds(): string[]
  • set imageIds(newImageIds: string[]): void
  • return the image ids for the volume if it is made of separated images


    Returns string[]

  • updates the image ids


    Parameters

    • newImageIds: string[]

    Returns void

publicnumTimePoints

  • get numTimePoints(): number
  • Returns the number of time points


    Returns number

    number of time points

publictimePointIndex

  • get timePointIndex(): number
  • set timePointIndex(newTimePointIndex: number): void
  • Returns the active time point index


    Returns number

    active time point index

  • Set the active time point index which also updates the active scalar data


    Parameters

    • newTimePointIndex: number

    Returns void

    current time point index

Methods

publiccancelLoading

  • cancelLoading(): void
  • It cancels loading the images of the volume. It sets the loading status to false and filters any imageLoad request in the requestPoolManager that has the same volumeId


    Returns void

publicclearLoadCallbacks

  • clearLoadCallbacks(): void
  • Clear the load callbacks


    Returns void

publicconvertToCornerstoneImage

  • convertToCornerstoneImage(imageId: string, imageIdIndex: number): IImageLoadObject
  • Converts the requested imageId inside the volume to a cornerstoneImage object. It uses the typedArray set method to copy the pixelData from the correct offset in the scalarData to a new array for the image


    Parameters

    • imageId: string

      the imageId of the image to be converted

    • imageIdIndex: number

      the index of the imageId in the imageIds array

    Returns IImageLoadObject

    imageLoadObject containing the promise that resolves to the cornerstone image

publicdecache

  • decache(completelyRemove?: boolean): void
  • If completelyRemove is true, remove the volume completely from the cache. Otherwise, convert the volume to cornerstone images (stack images) and store it in the cache


    Parameters

    • completelyRemove: boolean = false

      If true, the image will be removed from the cache completely.

    Returns void

destroy

  • destroy(): void
  • destroy the volume and make it unusable


    Returns void

publicgetImageIdIndex

  • getImageIdIndex(imageId: string): number
  • return the index of a given imageId


    Parameters

    • imageId: string

      imageId

    Returns number

    imageId index

publicgetImageLoadRequests

  • getImageLoadRequests(priority: number): any[]
  • It returns the imageLoad requests for the streaming image volume instance. It involves getting all the imageIds of the volume and creating a success callback which would update the texture (when the image has loaded) and the failure callback. Note that this method does not executes the requests but only returns the requests. It can be used for sorting requests outside of the volume loader itself e.g. loading a single slice of CT, followed by a single slice of PET (interleaved), before moving to the next slice.


    Parameters

    • priority: number

    Returns any[]

    Array of requests including imageId of the request, its imageIdIndex, options (targetBuffer and scaling parameters), and additionalDetails (volumeId)

publicgetImageURIIndex

  • getImageURIIndex(imageURI: string): number
  • return the index of a given imageURI


    Parameters

    • imageURI: string

    Returns number

    imageURI index

publicgetScalarData

  • Return the active scalar data (buffer)


    Returns VolumeScalarData

    volume scalar data

publicgetScalarDataArrays

  • Return all scalar data objects (buffers) which will be only one for 3D volumes and one per time point for 4D volumes images of each 3D volume is stored


    Returns VolumeScalarData[]

    scalar data array

publicisDynamicVolume

  • isDynamicVolume(): boolean
  • return true if it is a 4D volume or false if it is 3D volume


    Returns boolean

publicload

  • load(callback: (...args: unknown[]) => void, priority?: number): void
  • It triggers a prefetch for images in the volume.


    Parameters

    • callback: (...args: unknown[]) => void

      A callback function to be called when the volume is fully loaded

    • priority: number = 5

      The priority for loading the volume images, lower number is higher priority

    Returns void