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
NRRD

NRRD Loader

The NRRD Loader Module is a custom loader designed to handle NRRD (Nearly Raw Raster Data) files. It provides efficient parsing, caching, and integration for visualization within the cornerstone-core ecosystem.

Key Responsibilities

  • Loading NRRD Images: Implements custom logic to load volumetric images from NRRD files.
  • Metadata Extraction: Parses NRRD headers to extract essential metadata.
  • Image ID Management: Generates unique image IDs for frame referencing.
  • Series Integration: Works with the Image Manager to manage series and frames.
  • Custom Image Creation: Converts NRRD pixel data into Cornerstone-compatible images.

Internal Workflow

  1. Header Parsing:
    • Extracts volume dimensions, pixel spacing, and other essential metadata.
  2. Image ID Assignment:
    • Generates unique identifiers for each slice.
  3. Pixel Data Processing:
    • Organizes pixel data into structured frames for visualization.
  4. Custom Image Generation:
    • Creates Cornerstone-compatible images for rendering.

Main Functions

buildNrrdImage

Syntax:

buildNrrdImage(volume: NrrdInputVolume, seriesId: string, custom_header: NrrdHeader): NrrdSeries

Parameters:

ParameterTypeDescription
volumeNrrdInputVolumeThe parsed volume object.
seriesIdstringUnique identifier for the image series.
custom_headerNrrdHeaderCustom header with additional metadata.

Returns:

NrrdSeries – The structured NRRD image series.


getNrrdImageId

Syntax:

getNrrdImageId(customLoaderName: string): string

Parameters:

ParameterTypeDescription
customLoaderNamestringThe custom image loader identifier.

Returns:

string – A unique image ID for the loader.


loadNrrdImage

Syntax:

loadNrrdImage(imageId: string): ImageLoadObject

Parameters:

ParameterTypeDescription
imageIdstringThe ID of the image to be loaded.

Returns:

ImageLoadObject – An object containing a Promise resolving to the loaded image.


getImageIdFromSlice

Syntax:

getImageIdFromSlice(sliceNumber: number, orientation: string, seriesId: string): string

Parameters:

ParameterTypeDescription
sliceNumbernumberThe slice index.
orientationstringThe viewing orientation (axial, etc.).
seriesIdstringThe ID of the series.

Returns:

string – The corresponding image ID for the slice.


getSliceNumberFromImageId

Syntax:

getSliceNumberFromImageId(imageId: string, orientation: string): number

Parameters:

ParameterTypeDescription
imageIdstringThe image ID.
orientationstringThe viewing orientation.

Returns:

number – The corresponding slice number.


getNrrdSerieDimensions

Syntax:

getNrrdSerieDimensions(): Object

Returns:

Object – An object containing the dimensions of the NRRD series for different orientations.


clearNrrdCache

Syntax:

clearNrrdCache(seriesId: string): void

Parameters:

ParameterTypeDescription
seriesIdstringThe ID of the series to clear from the cache.

Returns:

void – Clears cached NRRD data.


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