Skip to main content

imageLoader

Index

Interfaces

ImageLoaderOptions

ImageLoaderOptions:

optionaladditionalDetails

additionalDetails?: Record<string, unknown>

priority

priority: number

requestType

requestType: string

Functions

cancelLoadAll

  • cancelLoadAll(): void
  • Removes all the ongoing image loads by calling the cancel method on each imageLoadObject. If no cancel method is available, it will be ignored.


    Returns void

cancelLoadImage

  • cancelLoadImage(imageId: string): void
  • Removes the imageId from the request pool manager and executes the cancel function if it exists.


    Parameters

    • imageId: string

      A Cornerstone Image Object’s imageId

    Returns void

cancelLoadImages

  • cancelLoadImages(imageIds: string[]): void
  • Removes the imageIds from the request pool manager and calls the cancel function if it exists.


    Parameters

    • imageIds: string[]

      Array of Cornerstone Image Object’s imageIds

    Returns void

loadAndCacheImage

  • 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 image is 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>

    Image Loader Object

loadAndCacheImages

  • Load and cache a list of imageIds


    Parameters

    Returns Promise<IImage>[]

loadImage

  • 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

registerImageLoader

  • registerImageLoader(scheme: string, imageLoader: ImageLoaderFn): void
  • Registers an imageLoader plugin with cornerstone for the specified scheme


    Parameters

    • scheme: string

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

    • imageLoader: ImageLoaderFn

      A Cornerstone Image Loader function

    Returns void

registerUnknownImageLoader

  • Registers a new unknownImageLoader and returns the previous one


    Parameters

    Returns ImageLoaderFn

    The previous Unknown Image Loader

unregisterAllImageLoaders

  • unregisterAllImageLoaders(): void
  • Removes all registered and unknown image loaders. This should be called when the application is unmounted to prevent memory leaks.


    Returns void