Skip to main content

volumeLoader

Index

Functions

createAndCacheDerivedSegmentationVolume

  • createAndCacheDerivedSegmentationVolume(referencedVolumeId: string, options?: DerivedVolumeOptions): Promise<IImageVolume>
  • Creates and caches a derived segmentation volume based on a referenced volume. This is basically a utility method since for the segmentations we have to specify Uint8Array as the targetBuffer type for now until we support other types.


    Parameters

    • referencedVolumeId: string

      The ID of the referenced volume.

    • options: DerivedVolumeOptions = ...

      The options for creating the derived volume.

    Returns Promise<IImageVolume>

    A promise that resolves to the created derived segmentation volume.

createAndCacheDerivedVolume

  • createAndCacheDerivedVolume(referencedVolumeId: string, options: DerivedVolumeOptions): Promise<IImageVolume>
  • 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<IImageVolume>

    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

    • optionaloptions: VolumeLoaderOptions

      Options to be passed to the Volume Loader

    Returns Promise<Record<string, any>>

    Volume Loader Object

createAndCacheVolumeFromImages

  • createAndCacheVolumeFromImages(volumeId: string, imageIds: string[], options?: { additionalDetails?: Record<string, any>; preventCache?: boolean }): Promise<IImageVolume>
  • Parameters

    • volumeId: string
    • imageIds: string[]
    • options: { additionalDetails?: Record<string, any>; preventCache?: boolean } = {}

    Returns Promise<IImageVolume>

createLocalSegmentationVolume

  • createLocalSegmentationVolume(options: LocalVolumeOptions, volumeId: string, preventCache?: boolean): Promise<IImageVolume>
  • Creates a local segmentation volume.


    Parameters

    • options: LocalVolumeOptions

      The options for creating the volume.

    • volumeId: string

      The ID of the volume.

    • preventCache: boolean = false

      Whether to prevent caching the volume.

    Returns Promise<IImageVolume>

    A promise that resolves to the created image volume.

createLocalVolume

  • createLocalVolume(options: LocalVolumeOptions, volumeId: string, preventCache?: boolean): IImageVolume
  • 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 IImageVolume

    ImageVolume

getUnknownVolumeLoaderSchema

  • getUnknownVolumeLoaderSchema(): string
  • Returns string

getVolumeLoaderSchemes

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


    Returns string[]

loadVolume

  • loadVolume(volumeId: string, options?: VolumeLoaderOptions): Promise<IImageVolume>
  • 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<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 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