imageLoader
Index
Interfaces
Functions
- cancelLoadAll
- cancelLoadImage
- cancelLoadImages
- createAndCacheDerivedImage
- createAndCacheDerivedImages
- createAndCacheDerivedSegmentationImage
- createAndCacheDerivedSegmentationImages
- createAndCacheLocalImage
- loadAndCacheImage
- loadAndCacheImages
- loadImage
- registerImageLoader
- registerUnknownImageLoader
- unregisterAllImageLoaders
Interfaces
ImageLoaderOptions
optionaladditionalDetails
optionalignoreCache
priority
requestType
Functions
cancelLoadAll
Returns void
cancelLoadImage
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
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
createAndCacheDerivedImage
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
referencedImageId: string
A Cornerstone Image Object’s imageId
options: DerivedImageOptions = {}
Options to be passed to the Image Loader
preventCache: boolean = false
Returns Promise<IImage>
Image Loader Object
createAndCacheDerivedImages
Load and cache a list of imageIds
Parameters
referencedImageIds: string[]
list of imageIds
options: LocalImageOptions & { imageId?: string; targetBufferType?: PixelDataTypedArrayString } & { getDerivedImageId?: (referencedImageId: string) => string; targetBufferType?: PixelDataTypedArrayString } = {}
Returns DerivedImages
createAndCacheDerivedSegmentationImage
Creates and caches a derived segmentation image based on the referenced image ID. this is a helper function, we don’t have segmentation concept in the cornerstone core; however, this helper would make it clear that the segmentation images SHOULD be Uint8Array type always until we have a better solution.
Parameters
referencedImageId: string
The ID of the referenced image.
options: DerivedImageOptions = ...
The options for creating the derived image (default: { targetBufferType: ‘Uint8Array’ }).
Returns Promise<IImage>
A promise that resolves to the created derived segmentation image.
createAndCacheDerivedSegmentationImages
Creates and caches derived segmentation images based on the referenced imageIds, this is a helper function, we don’t have segmentation concept in the cornerstone core; however, this helper would make it clear that the segmentation images SHOULD be Uint8Array type always until we have a better solution.
Parameters
referencedImageIds: string[]
An array of referenced image IDs.
options: DerivedImageOptions = ...
The options for creating the derived images (default: { targetBufferType: ‘Uint8Array’ }).
Returns DerivedImages
The derived images.
createAndCacheLocalImage
Parameters
options: LocalImageOptions
imageId: string
preventCache: boolean = false
Returns IImage
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
imageIds: string[]
list of imageIds
options: ImageLoaderOptions = ...
options for loader
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
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
imageLoader: ImageLoaderFn
A Cornerstone Image Loader
Returns ImageLoaderFn
The previous Unknown Image Loader
unregisterAllImageLoaders
Removes all registered and unknown image loaders. This should be called when the application is unmounted to prevent memory leaks.
Returns void
Removes all the ongoing image loads by calling the
cancel
method on each imageLoadObject. If nocancel
method is available, it will be ignored.