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.common_features
  • navigate.model.features.common_features.ZStackAcquisition
  • View page source

navigate.model.features.common_features.ZStackAcquisition

class navigate.model.features.common_features.ZStackAcquisition(model, get_origin=False, saving_flag=False, saving_dir='z-stack', force_multiposition=False)

Bases: object

ZStackAcquisition class for controlling z-stack acquisition in microscopy.

This class provides functionality to control z-stack acquisition, including managing z and focus positions, acquiring image data, and handling multi-channel acquisitions.

Notes:

  • This class is used to control z-stack acquisition during microscopy experiments,

allowing for position cycling, multi-channel acquisitions, and image saving.

  • The z-stack acquisition process involves initializing parameters, controlling

position and focus movements, handling data acquisition, and managing data threads.

  • The config_table attribute defines the configuration for the z-stack acquisition

process, including signal acquisition, data handling, and node type.

__init__(model, get_origin=False, saving_flag=False, saving_dir='z-stack', force_multiposition=False)

Initialize the ZStackAcquisition class.

Parameters:

modelMicroscopeModel

The microscope model object used for z-stack acquisition control.

get_originbool, optional

Flag to determine whether to get the z and focus origin positions. Default is False.

saving_flagbool, optional

Flag to enable image saving during z-stack acquisition. Default is False.

saving_dirstr, optional

The subdirectory for saving z-stack images. The default is “z-stack”.

Methods

__init__(model[, get_origin, saving_flag, ...])

Initialize the ZStackAcquisition class.

cleanup_data_func()

Perform cleanup actions after data acquisition if image saving is enabled.

end_data_func()

Check if all expected data frames have been received.

get_f_stack_parameters(microscope_state)

Get focus stack parameters from the configuration.

get_microscope_state(microscope_state)

Get the microscope state from the configuration.

get_z_stack_parameters(microscope_state)

Get z-stack parameters from the configuration.

in_data_func(frame_ids)

Handle incoming data frames during data acquisition.

pre_data_func()

Initialize data-related parameters before data acquisition.

pre_signal_func()

Initialize z-stack acquisition parameters before the signal stage.

signal_end()

Handle the end of the signal stage and position cycling.

signal_func()

Control z-stack acquisition, move positions, and manage data threads.

update_channel()

Update the active channel during multichannel acquisition.

Attributes

model

The microscope model associated with z-stack acquisition.

current_channel_in_list

The current channel being acquired in the z-stack

get_origin

Flag to determine whether to get the z and focus origin positions.

number_z_steps

The number of z steps in the z-stack.

start_z_position

The start z position for the z-stack.

z_stack_distance

The z stack distance for the z-stack.

f_stack_distance

The focus stack distance for the z-stack.

restore_z

The z position of the channel being acquired in the z-stack

restore_f

The f position of the channel being acquired in the z-stack

start_focus

The start focus position for the z-stack.

z_step_size

The z step size for the z-stack.

focus_step_size

The z stack distance for the z-stack.

positions

A dictionary defining the multi-position table for z-stack acquisition.

position_headers

The list of stage axes (e.g., X, Y, Z, THETA, F)

axes_index

A list of each header position in the multi-position table.

current_position

A dictionary defining the current position in the multi-position table.

current_position_idx

The current index of the position being acquired in the multi-position

current_z_position

The z position of the channel being acquired in the z-stack

current_focus_position

The f position of the channel being acquired in the z-stack

need_to_move_new_position

Flag to determine whether to move to a new position

need_to_move_z_position

Flag to determine whether to move the z position

should_pause_data_thread

Flag to determine whether to pause the data thread.

stage_distance_threshold

The stage distance threshold for pausing the data thread.

pre_position

A dictionary of the previous position in the multi-position table.

z_position_moved_time

The number of times the z position has been moved

defocus

A dictionary defining the defocus values between channels

stack_cycling_mode

The stack cycling mode for z-stack acquisition.

channels

The number of channels in the z-stack.

force_multiposition

Force multiposition

received_frames

The number of frames received by the data thread.

total_frames

The number of frames anticipated by the data thread.

timepoints

The number of timepoints in the z-stack acquisition.

image_writer

An image writer object for saving z-stack images.

config_table

A dictionary defining the configuration for the z-stack acquisition

cleanup_data_func() → None

Perform cleanup actions after data acquisition if image saving is enabled.

This method performs cleanup actions after data acquisition, such as cleaning up

image writing, if image saving is enabled.

end_data_func() → bool

Check if all expected data frames have been received.

This method checks whether all expected data frames have been received during data acquisition.

Returns:

bool

A boolean value indicating whether all expected data frames have been received.

get_f_stack_parameters(microscope_state: dict) → None

Get focus stack parameters from the configuration.

Parameters:

microscope_statedict

The microscope state configuration dictionary.

get_microscope_state(microscope_state: dict) → None

Get the microscope state from the configuration.

Parameters:

microscope_statedict

The microscope state configuration dictionary.

get_z_stack_parameters(microscope_state: dict) → None

Get z-stack parameters from the configuration.

Parameters:

microscope_statedict

The microscope state configuration dictionary.

in_data_func(frame_ids: list) → None

Handle incoming data frames during data acquisition.

This method handles incoming data frames during data acquisition, updating the count of received frames and saving images if enabled.

Parameters:

frame_idslist

A list of frame IDs received during data acquisition.

pre_data_func() → None

Initialize data-related parameters before data acquisition.

This method initializes data-related parameters before data acquisition, including the count of received and expected frames.

pre_signal_func() → None

Initialize z-stack acquisition parameters before the signal stage.

This method initializes z-stack acquisition parameters, including position, focus, and data thread management, before the signal stage.

signal_end() → bool

Handle the end of the signal stage and position cycling.

This method handles the end of the signal stage, including position cycling and channel updates for multichannel acquisitions.

Returns:

bool

A boolean value indicating whether to end the current node.

signal_func()

Control z-stack acquisition, move positions, and manage data threads.

This method controls the z-stack acquisition process, including moving positions and focus, managing data threads, and handling data acquisition during the signal stage.

Returns:

bool

A boolean value indicating whether to continue the z-stack acquisition process.

update_channel() → None

Update the active channel during multichannel acquisition.

This method updates the active channel for multichannel acquisitions, allowing cycling through channels.

axes_index

A list of each header position in the multi-position table.

Type:

list

channels

The number of channels in the z-stack.

Type:

int

config_table

A dictionary defining the configuration for the z-stack acquisition

Type:

dict

current_channel_in_list

The current channel being acquired in the z-stack

Type:

int

current_focus_position

The f position of the channel being acquired in the z-stack

Type:

int

current_position

A dictionary defining the current position in the multi-position table.

Type:

dict

current_position_idx

The current index of the position being acquired in the multi-position

Type:

int

current_z_position

The z position of the channel being acquired in the z-stack

Type:

int

defocus

A dictionary defining the defocus values between channels

Type:

dict

f_stack_distance

The focus stack distance for the z-stack.

Type:

float

focus_step_size

The z stack distance for the z-stack.

Type:

float

force_multiposition

Force multiposition

Type:

bool

get_origin

Flag to determine whether to get the z and focus origin positions.

Type:

bool

image_writer

An image writer object for saving z-stack images.

Type:

ImageWriter

model

The microscope model associated with z-stack acquisition.

Type:

MicroscopeModel

need_to_move_new_position

Flag to determine whether to move to a new position

Type:

bool

need_to_move_z_position

Flag to determine whether to move the z position

Type:

bool

number_z_steps

The number of z steps in the z-stack.

Type:

int

position_headers

The list of stage axes (e.g., X, Y, Z, THETA, F)

Type:

list

positions

A dictionary defining the multi-position table for z-stack acquisition.

Type:

dict

pre_position

A dictionary of the previous position in the multi-position table.

Type:

dict

received_frames

The number of frames received by the data thread.

Type:

int

restore_f

The f position of the channel being acquired in the z-stack

Type:

float

restore_z

The z position of the channel being acquired in the z-stack

Type:

float

should_pause_data_thread

Flag to determine whether to pause the data thread.

Type:

bool

stack_cycling_mode

The stack cycling mode for z-stack acquisition.

Type:

str

stage_distance_threshold

The stage distance threshold for pausing the data thread.

Type:

int

start_focus

The start focus position for the z-stack.

Type:

float

start_z_position

The start z position for the z-stack.

Type:

float

timepoints

The number of timepoints in the z-stack acquisition.

Type:

int

total_frames

The number of frames anticipated by the data thread.

Type:

int

z_position_moved_time

The number of times the z position has been moved

Type:

int

z_stack_distance

The z stack distance for the z-stack.

Type:

float

z_step_size

The z step size for the z-stack.

Type:

float

Previous Next

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