
File Loader
The File Loader module provides functionalities for handling custom file loading in medical imaging workflows. It integrates with the cornerstoneFileImageLoader to enable seamless loading of file-based DICOM images and supports advanced operations like resetting and clearing the loader state.
Key Responsibilities
- Custom File Image ID Generation: Generates a custom image ID for files and array buffers to integrate with Cornerstone.
- Loader State Management: Provides functionality to reset the loader, clear caches, and free up memory.
- Integration with File Manager: Works in conjunction with the File Manager to manage and retrieve file-based image IDs.
How It Works
Custom Image ID Generation:
- The
getFileCustomImageId
function handles bothFile
andArrayBuffer
inputs. - It uses the
cornerstoneFileImageLoader
to generate and store a unique image ID.
- The
State Reset:
- Clears any rendered Cornerstone elements.
- Resets the File Manager to remove all file-to-image ID mappings.
- Clears cached images to free memory.
Main Functions
getFileCustomImageId
Syntax:
getFileCustomImageId(data: File | ArrayBuffer): string
Parameters:
Parameter | Type | Description |
---|---|---|
data | File or ArrayBuffer | HTML5 file object or an ArrayBuffer containing the image. |
Returns:
string
– The custom image ID generated for the file or array buffer.
resetFileLoader
Syntax:
resetFileLoader(): void
Returns:
void
– Reset the file manager and clears the image cache.
