navigate.model.features.common_features.ZStackAcquisition
- class navigate.model.features.common_features.ZStackAcquisition(model, get_origin=False, saving_flag=False, saving_dir='z-stack')
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')
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 sub-directory for saving z-stack images. Default is “z-stack”.
Methods
__init__
(model[, get_origin, saving_flag, ...])Initialize the ZStackAcquisition class.
Perform cleanup actions after data acquisition, if image saving is enabled.
Check if all expected data frames have been received.
in_data_func
(frame_ids)Handle incoming data frames during data acquisition.
Initialize data-related parameters before data acquisition.
Initialize z-stack acquisition parameters before the signal stage.
Handle the end of the signal stage and position cycling.
Control z-stack acquisition, move positions, and manage data threads.
Update the active channel during multi-channel acquisition.
Attributes
The microscope model associated with z-stack acquisition.
Flag to determine whether to get the z and focus origin positions.
The number of z steps in the z-stack.
The start z position for the z-stack.
The start focus position for the z-stack.
The z step size for the z-stack.
The z stack distance for the z-stack.
A dictionary defining the multi-position table for z-stack acquisition.
The current index of the position being acquired in the multi-position
The z position of the channel being acquired in the z-stack
The f position of the channel being acquired in the z-stack
Flag to determine whether to move to a new position
Flag to determine whether to move the z position
The number of times the z position has been moved
A dictionary defining the defocus values between channels
The stack cycling mode for z-stack acquisition.
The number of channels in the z-stack.
An image writer object for saving z-stack images.
A dictionary defining the configuration for the z-stack acquisition
- cleanup_data_func()
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()
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.
- in_data_func(frame_ids)
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()
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()
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()
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 multi-channel 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()
Update the active channel during multi-channel acquisition.
This method updates the active channel for multi-channel acquisitions, allowing cycling through channels.
- 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_focus_position
The f position of the channel being acquired in the z-stack
- Type:
int
- 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
- focus_step_size
The z stack distance for the z-stack.
- Type:
float
- 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:
- 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
- positions
A dictionary defining the multi-position table for z-stack acquisition.
- Type:
dict
- stack_cycling_mode
The stack cycling mode for z-stack acquisition.
- Type:
str
- 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
- z_position_moved_time
The number of times the z position has been moved
- Type:
int
- z_step_size
The z step size for the z-stack.
- Type:
float