Skip to main content

volumeLoader

Index

Functions

createAndCacheDerivedVolume

  • createAndCacheDerivedVolume(referencedVolumeId: string, options: DerivedVolumeOptions): Promise<ImageVolume>
  • Based on a referencedVolumeId, it will build and cache a new volume. If no scalarData is specified in the options, an empty derived volume will be created that matches the image metadata of the referenceVolume. If scalarData is given, it will be used to generate the intensity values for the derivedVolume. Finally, it will save the volume in the cache.


    Parameters

    • referencedVolumeId: string

      the volumeId from which the new volume will get its metadata

    • options: DerivedVolumeOptions

      DerivedVolumeOptions {uid: derivedVolumeUID, targetBuffer: { type: Float32Array | Uint8Array | Uint16Array | Uint32Array }, scalarData: if provided}

    Returns Promise<ImageVolume>

    ImageVolume

createAndCacheVolume

  • createAndCacheVolume(volumeId: string, options: VolumeLoaderOptions): Promise<Record<string, any>>
  • Loads an image given an volumeId and optional priority and returns a promise which will resolve to the loaded image object or fail if an error occurred. The image is stored in the cache.


    Parameters

    • volumeId: string

      A Cornerstone Image Object’s volumeId

    • options: VolumeLoaderOptions

      Options to be passed to the Volume Loader

    Returns Promise<Record<string, any>>

    Volume Loader Object

createLocalVolume

  • createLocalVolume(options: LocalVolumeOptions, volumeId: string, preventCache?: boolean): ImageVolume
  • Creates and cache a volume based on a set of provided properties including dimensions, spacing, origin, direction, metadata, scalarData. It should be noted that scalarData should be provided for this function to work. If a volume with the same Id exists in the cache it returns it immediately.


    Parameters

    • options: LocalVolumeOptions

      { scalarData, metadata, dimensions, spacing, origin, direction }

    • volumeId: string

      Id of the generated volume

    • preventCache: boolean = false

    Returns ImageVolume

    ImageVolume

getVolumeLoaderSchemes

  • getVolumeLoaderSchemes(): string[]
  • Gets the array of volume loader schemes


    Returns string[]

loadVolume

  • Loads a volume given a volumeId 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

    • volumeId: string

      A Cornerstone Image Object’s volumeId

    • options: VolumeLoaderOptions = ...

      Options to be passed to the Volume Loader

    Returns Promise<Types.IImageVolume>

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

registerUnknownVolumeLoader

  • Registers a new unknownVolumeLoader and returns the previous one


    Parameters

    Returns Types.VolumeLoaderFn | undefined

    The previous Unknown Volume Loader

registerVolumeLoader

  • registerVolumeLoader(scheme: string, volumeLoader: VolumeLoaderFn): void
  • Registers an volumeLoader plugin with cornerstone for the specified scheme


    Parameters

    • scheme: string

      The scheme to use for this volume loader (e.g. ‘dicomweb’, ‘wadouri’, ‘http’)

    • volumeLoader: VolumeLoaderFn

      A Cornerstone Volume Loader function

    Returns void