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.config
    • navigate.controller
    • navigate.log_files
    • navigate.model
      • navigate.model.analysis
      • navigate.model.concurrency
      • navigate.model.data_sources
      • navigate.model.device_startup_functions
      • navigate.model.devices
      • navigate.model.features
        • navigate.model.features.adaptive_optics
        • navigate.model.features.auto_tile_scan
        • navigate.model.features.autofocus
        • navigate.model.features.common_features
        • navigate.model.features.feature_container
        • navigate.model.features.feature_related_functions
        • navigate.model.features.image_writer
        • navigate.model.features.remove_empty_tiles
        • navigate.model.features.restful_features
        • navigate.model.features.update_setting
        • navigate.model.features.volume_search
      • navigate.model.metadata_sources
      • navigate.model.microscope
      • navigate.model.model
      • navigate.model.plugins_model
      • navigate.model.waveforms
    • navigate.tools
    • navigate.view
navigate
  • Acquiring Data
  • Currently Implemented Features
  • navigate.model.features.image_writer
  • navigate.model.features.image_writer.ImageWriter
  • View page source

navigate.model.features.image_writer.ImageWriter

class navigate.model.features.image_writer.ImageWriter(model: Model, microscope_name: Optional[str] = None, data_buffer: Optional[list[navigate.model.concurrency.concurrency_tools.SharedNDArray]] = None, sub_dir: str = '', image_name: Optional[str] = None, saving_flags: Optional[list[bool]] = None, saving_config: Optional[dict] = None)

Bases: object

Class for saving acquired data to disk.

__init__(model: Model, microscope_name: Optional[str] = None, data_buffer: Optional[list[navigate.model.concurrency.concurrency_tools.SharedNDArray]] = None, sub_dir: str = '', image_name: Optional[str] = None, saving_flags: Optional[list[bool]] = None, saving_config: Optional[dict] = None)

Class for saving acquired data to disk.

Parameters:
  • model (navigate.model.model.Model) – Navigate Model class for controlling hardware/acquisition.

  • data_buffer ([SharedNDArray]) – data_buffer will use model’s default data_buffer if it’s not specified

  • sub_dir (str) – Sub-directory of self.model.configuration[‘experiment’] [‘Saving’][‘save_directory’] indicating where to save data

  • image_name (Optional[str]) – Name of the image to be saved. If None, a name will be generated

  • saving_flags (Optional[list[bool]]) – A list of flags indicating whether to save each frame.

  • saving_config (Optional[dict]) – Dictionary of saving configuration

Methods

__init__(model[, microscope_name, ...])

Class for saving acquired data to disk.

calculate_and_check_disk_space()

Estimate the size of the data that will be written to disk, and confirm that sufficient disk space is available.

close()

Close the data source we are writing to.

generate_image_name(current_channel[, ext])

Generates a string for the filename, e.g., CH00_000000.tif.

get_saving_file_name([sub_dir, image_name])

initialize_saving([sub_dir, image_name])

save_image(frame_ids)

Save the data to disk.

Attributes

data_buffer

Data buffer for saving data.

number_of_frames

Number of frames in the experiment.

saving_flags

Array of saving flags

save_directory

Directory for saving data to disk.

mip

Maximum intensity projection image.

mip_directory

Directory for saving maximum intensity projection images.

sub_dir

Sub-directory for saving data to disk.

current_time_point

Current time point for saving data.

config_table

Dictionary of functions to call for each configuration.

big_tiff

Is 32 vs 64-bit file format.

saving_config

Saving config

data_source

Data source

disk_space_check_interval

Disk space check interval in seconds.

min_disk_space

Minimum disk space required in bytes.

last_disk_space_check

Time of last disk space check

initialized

Flag to indicate if initialized before

calculate_and_check_disk_space()

Estimate the size of the data that will be written to disk, and confirm that sufficient disk space is available. Also evaluates whether big-tiff or tiff is needed. Tiff file formats were designed for 32-bit operating systems, whereas big-tiff was designed for 64-bit operating systems.

Assumes 16-bit image type, without compression.

close()

Close the data source we are writing to.

generate_image_name(current_channel, ext='.tif')

Generates a string for the filename, e.g., CH00_000000.tif.

Parameters:
  • current_channel (int) – Index into self.model.configuration[‘experiment’] [‘MicroscopeState’][‘channels’] of saved color channel.

  • ext (str) – File extension, e.g., ‘.tif’

Returns:

File name, e.g., CH00_000000.tif

Return type:

str

save_image(frame_ids)

Save the data to disk.

Parameters:

frame_ids (list[int]) – Index into self.model.data_buffer.

big_tiff

Is 32 vs 64-bit file format.

Type:

bool

config_table

Dictionary of functions to call for each configuration.

Type:

dict

current_time_point

Current time point for saving data.

Type:

int

data_buffer

Data buffer for saving data.

Type:

[SharedNDArray]

data_source

Data source

Type:

DataSource

disk_space_check_interval

Disk space check interval in seconds.

Type:

int

initialized

Flag to indicate if initialized before

Type:

bool

last_disk_space_check

Time of last disk space check

Type:

float

min_disk_space

Minimum disk space required in bytes.

Type:

int

mip

Maximum intensity projection image.

Type:

np.ndarray

mip_directory

Directory for saving maximum intensity projection images.

Type:

str

number_of_frames

Number of frames in the experiment.

Type:

int

save_directory

Directory for saving data to disk.

Type:

str

saving_config

Saving config

Type:

dict

saving_flags

Array of saving flags

Type:

array

sub_dir

Sub-directory for saving data to disk.

Type:

str

Previous Next

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