Skip to main content

StreamingImageVolume

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

Hierarchy

  • default
    • StreamingImageVolume

Index

Constructors

constructor

Properties

optionaladditionalDetails

additionalDetails?: Record<string, any>

Property to store additional information

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

imageCacheOffsetMap

imageCacheOffsetMap: Map<any, any> = ...

optionalimageData

imageData?: vtkImageData

volume image data

imagesLoader

imagesLoader: IImagesLoader = ...

isPreScaled

isPreScaled: boolean = false

loadStatus

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

Type declaration

  • 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

optionalreferencedImageIds

referencedImageIds?: string[]

optional reference image ids if the volume is derived from a set of images in the image cache

optionalreferencedVolumeId

referencedVolumeId?: string

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

optionalscaling

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

volume scaling parameters if it contains scaled data


Type declaration

  • optionalPT?: { 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

Methods

callLoadImage

  • callLoadImage(imageId: any, imageIdIndex: any, options: any): any
  • Parameters

    • imageId: any
    • imageIdIndex: any
    • options: any

    Returns any

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 Duplicate of getCornerstoneImageLoadObject for legacy reasons


    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

publicconvertToImageSlicesAndCache

  • convertToImageSlicesAndCache(): string[]
  • Converts all the volume images (imageIds) to cornerstoneImages and caches them. It iterates over all the imageIds and convert them until there is no enough space left inside the imageCache. Finally it will decache the Volume.


    Returns string[]

publicdecache

  • decache(completelyRemove?: boolean): void | string[]
  • 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 | string[]

destroy

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


    Returns void

publicerrorCallback

  • errorCallback(imageId: any, permanent: any, error: any): void
  • Parameters

    • imageId: any
    • permanent: any
    • error: any

    Returns void

publicgetCornerstoneImage

  • getCornerstoneImage(imageId: string, imageIdIndex: number): IImage
  • 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 IImage

    image object containing the pixel data, metadata, and other information

publicgetCornerstoneImageLoadObject

  • getCornerstoneImageLoadObject(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

publicgetCornerstoneImages

  • 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.

publicgetImageIdIndex

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


    Parameters

    • imageId: string

      imageId

    Returns number

    imageId index

publicgetImageIdsToLoad

  • getImageIdsToLoad(): string[]
  • Returns string[]

publicgetImageLoadRequests

  • getImageLoadRequests(priority: number): default[]
  • 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 default[]

    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

publicgetLoaderImageOptions

  • getLoaderImageOptions(imageId: string): { additionalDetails: { imageId: string; imageIdIndex: number; volumeId: string }; allowFloatRendering: boolean; loader: (imageId: string, options?: ImageLoaderOptions) => Promise<IImage>; preScale: { enabled: boolean; scalingParameters: ScalingParameters }; skipCreateImage: boolean; targetBuffer: { arrayBuffer: SharedArrayBuffer; columns: any; length: number; offset: number; rows: any; type: any }; transferPixelData: boolean; transferSyntaxUID: any }
  • Parameters

    • imageId: string

    Returns { additionalDetails: { imageId: string; imageIdIndex: number; volumeId: string }; allowFloatRendering: boolean; loader: (imageId: string, options?: ImageLoaderOptions) => Promise<IImage>; preScale: { enabled: boolean; scalingParameters: ScalingParameters }; skipCreateImage: boolean; targetBuffer: { arrayBuffer: SharedArrayBuffer; columns: any; length: number; offset: number; rows: any; type: any }; transferPixelData: boolean; transferSyntaxUID: any }

    • additionalDetails: { imageId: string; imageIdIndex: number; volumeId: string }
      • imageId: string
      • imageIdIndex: number
      • volumeId: string
    • allowFloatRendering: boolean
    • loader: (imageId: string, options?: ImageLoaderOptions) => Promise<IImage>
        • Loads an image given an imageId and optional priority and returns a promise which will resolve to the loaded image object or fail if an error occurred. The loaded image is not stored in the cache.


          Parameters

          • imageId: string

            A Cornerstone Image Object’s imageId

          • options: ImageLoaderOptions = ...

            Options to be passed to the Image Loader

          Returns Promise<IImage>

          An Object which can be used to act after an image is loaded or loading fails

    • preScale: { enabled: boolean; scalingParameters: ScalingParameters }
    • skipCreateImage: boolean
    • targetBuffer: { arrayBuffer: SharedArrayBuffer; columns: any; length: number; offset: number; rows: any; type: any }
      • arrayBuffer: SharedArrayBuffer
      • columns: any
      • length: number
      • offset: number
      • rows: any
      • type: any
    • transferPixelData: boolean
    • transferSyntaxUID: any

publicgetScalarData

  • Return the scalar data (buffer)


    Returns PixelDataTypedArray

    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 PixelDataTypedArray[]

    scalar data array

publicgetScalarDataLength

  • getScalarDataLength(): number
  • Returns number

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): 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

    Returns void

publicloadImages

  • Retrieves images using the older getImageLoadRequests method to setup all the requests. Ensures compatibility with the custom image loaders.


    Parameters

    Returns Promise<boolean>

publicmodified

  • 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

publicremoveFromCache

  • removeFromCache(): void
  • Returns void

publicsuccessCallback

  • successCallback(imageId: string, image: any): void
  • Parameters

    • imageId: string
    • image: any

    Returns void