Larvitar Documentation
Home
Guide
API
GitHub
Home
Guide
API
GitHub
  • API

    • Initializing
    • Parsing
    • Loading
    • Rendering
    • Interacting
    • Testing
    • Modules

      • Logger
      • Store
      • Managers

        • Image Manager
        • GSPS Manager
        • File Manager
      • Parsers

        • PDF Parser
        • NRRD Parser
        • ECG Parser
      • Loaders
        • DICOM Loader
        • MultiFrame Loader
        • SingleFrame Loader
        • DSA Image Loader
        • File Loader
        • Nrrd Loader
      • Interaction Tools

        • Initialize and manage Tools
        • Default and Custom Tools
        • Segmentation Tools
        • DvTools
      • Utilities

        • DICOM Anonymization
        • DICOM Customization
        • Tags
        • Utils
        • Memory
      • Post Processing

        • DSA
      • Visualizations

        • Layers
        • ECG
        • Color Maps
        • Greyscale Presentation States
      • Testing
Larvitar

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

  1. Custom Image ID Generation:

    • The getFileCustomImageId function handles both File and ArrayBuffer inputs.
    • It uses the cornerstoneFileImageLoader to generate and store a unique image ID.
  2. 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:

ParameterTypeDescription
dataFile or ArrayBufferHTML5 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.


D/Vision Lab
Last Updated:
Contributors: Laura Borghesi, Simone "Lateralus" Manini
Prev
DSA Image Loader
Next
Nrrd Loader