navigate Logo

Getting Started

  • Quick Start Guide
  • Software Installation
  • I Want To…

User Guide

  • Supported Hardware
  • Supported File Formats
  • User Interface Walkthrough
  • Setting Up A Microscope
  • Acquiring Data
  • Case Studies

Development

  • Contributing Guidelines
  • Developer Install
  • Software Architecture
  • Feature Container
  • REST-API
  • Plugin Architecture

Troubleshooting & Known Issues

  • Troubleshooting
  • Known Issues

Plugins

  • navigate Plugin Template
  • navigate Confocal Projection
  • navigate at Scale
  • navigate Constant Velocity Acquisition
  • navigate MMCore
  • navigate ilastik Server
  • navigate Photoactivation

Reference

  • Implemented Microscopes
  • Software API
navigate
  • navigate.controller.sub_controllers.camera_view.SpooledImageLoader
  • View page source

navigate.controller.sub_controllers.camera_view.SpooledImageLoader

class navigate.controller.sub_controllers.camera_view.SpooledImageLoader(channels: int, size_y: int, size_x: int)

Bases: object

A class to lazily load images from disk using a spooled temporary file.

__init__(channels: int, size_y: int, size_x: int) → None

Initialize the SpooledImageLoader.

Parameters:

channels (int) – The number of channels.

Methods

__init__(channels, size_y, size_x)

Initialize the SpooledImageLoader.

get_default_directory()

Get the default directory for storing temporary files.

get_default_max_size()

Get the default max_size based on the total RAM.

get_indices(slice_index)

Get the indices of the images stored in the spooled files.

load_image(channel, slice_index)

Load an image from a temporary file.

save_image(image, channel, slice_index)

Save an image to a temporary file.

Attributes

channels

The number of channels.

n_bytes

The number of bytes in the image.

size_y

The height of the image.

size_x

The width of the image.

temp_files

The temporary files.

static get_default_directory() → str

Get the default directory for storing temporary files.

Default directory is within the .navigate directory.

Returns:

The default directory for storing temporary files.

Return type:

str

static get_default_max_size() → int

Get the default max_size based on the total RAM.

Returns:

The default max_size in bytes. By default, half the available RAM.

Return type:

int

get_indices(slice_index: int) → tuple

Get the indices of the images stored in the spooled files.

Parameters:

slice_index (int) – The slice index.

Returns:

The start and end indices of the images.

Return type:

tuple[int, int]

load_image(channel: int, slice_index: int) → ndarray

Load an image from a temporary file.

Parameters:
  • channel (int) – The channel of the image.

  • slice_index (int) – The slice index of the image.

Returns:

The image data or None if the image could not be loaded.

Return type:

np.ndarray or None

save_image(image: ndarray, channel: int, slice_index: int) → None

Save an image to a temporary file.

Parameters:
  • image (np.ndarray) – The image to save.

  • channel (int) – The channel of the image.

  • slice_index (int) – The slice index of the image.

channels

The number of channels.

Type:

int

n_bytes

The number of bytes in the image.

Type:

int

size_x

The width of the image.

Type:

int

size_y

The height of the image.

Type:

int

temp_files: Dict[int, SpooledTemporaryFile]

The temporary files.

Type:

Dict[int, tempfile.SpooledTemporaryFile]


© Copyright 2025, Dean Lab, UT Southwestern Medical Center.