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

The File Manager

The File Manager module is a utility that handles the management of files or array buffers used in medical imaging workflows. It is based on the functionality of cornerstoneFileImageLoader and extends its capabilities to efficiently manage and retrieve image data using a unique identifier.

Key Responsibilities

  • File Management: Tracks and stores files or array buffers using unique identifiers..
  • Image Id Retrieval: Associates each file with a custom image ID for quick access during visualization.
  • Reset Functionalities: Provides a mechanism to reset and clear the file manager, freeing up memory when needed..

How It Works

  1. File Identification:

    • Each file is identified by its webkitRelativePath or name. For ArrayBuffer inputs, a unique ID is generated.
  2. Custom Image Ids:

    • The getFileCustomImageId function generates an image ID for each file, which is stored in the manager..
  3. Storage and Retrieval:

    • The File Manager maintains a mapping of file UUIDs to image IDs for efficient retrieval during imaging workflows..

Main Functions

populateFileManager

Syntax:

populateFileManager(data: File | ArrayBuffer): void

Parameters:

ParameterTypeDescription
dataFile or ArrayBufferHTML5 file object or an ArrayBuffer containing the image.

Returns:

void – Populates the File Manager with the relevant mappings.


getFileManager

Syntax:

getFileManager(): Record<string, string>

Returns:

FileManager – An object mapping unique identifiers (UUIDs) to custom image IDs.


getDataFromFileManager

Syntax:

getDataFromFileManager(data: File | string): string | null

Parameters:

ParameterTypeDescription
dataFile or StringHTML5 file object or unique Id.

Returns:

  • string – The custom image ID associated with the file
  • null – If the file is not found in the manager.

resetFileManager

Syntax:

resetFileManager(): void

Returns:

  • void – Clears all entries in the file manager and frees memory by nullifying the manager.


D/Vision Lab
Last Updated:
Contributors: Laura Borghesi, Simone "Lateralus" Manini
Prev
GSPS Manager