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.metadata_sources
      • navigate.model.microscope
        • navigate.model.microscope.Microscope
      • navigate.model.model
      • navigate.model.plugins_model
      • navigate.model.waveforms
    • navigate.tools
    • navigate.view
navigate
  • Software API
  • navigate.model
  • navigate.model.microscope
  • navigate.model.microscope.Microscope
  • View page source

navigate.model.microscope.Microscope

class navigate.model.microscope.Microscope(name: str, configuration: Dict[str, Any], devices_dict: dict, is_synthetic: bool = False, is_virtual: bool = False)

Bases: object

Microscope Class - Used to control the microscope.

__init__(name: str, configuration: Dict[str, Any], devices_dict: dict, is_synthetic: bool = False, is_virtual: bool = False) → None

Initialize the microscope.

Parameters:
  • name (str) – Name of the microscope.

  • configuration (Dict[str, Any]) – Configuration dictionary.

  • devices_dict (dict) – Dictionary of devices.

  • is_synthetic (bool, optional) – Is synthetic, by default False

  • is_virtual (bool, optional) – Is virtual, by default False

Methods

__init__(name, configuration, devices_dict)

Initialize the microscope.

assemble_device_config_lists(device_name, ...)

Assemble device config lists.

calculate_all_waveform()

Calculate all the waveforms.

calculate_exposure_sweep_times()

Calculate the exposure and sweep times for all channels.

end_acquisition()

End the acquisition.

get_available_channels()

Get the available channels for imaging.

get_exposure_sweep_times()

Get the exposure and sweep times for all channels.

get_stage_position()

Get stage position.

load_and_start_devices(device_name, is_list, ...)

Load and start devices.

move_remote_focus([offset])

Move remote focus.

move_stage(pos_dict[, wait_until_done, ...])

Move stage to a position.

move_stage_offset([former_microscope])

Move the stage to the offset position.

prepare_acquisition()

Prepare the acquisition.

prepare_next_channel([update_daq_task_flag])

Prepare the next channel.

report_camera_settings()

Log the camera settings.

run_command(command, *args)

Run command.

set_camera_exposure_time(channel)

Set the camera exposure time.

set_camera_roi_and_binning()

Set the camera ROI and binning.

set_camera_sensor_mode()

Set the camera sensor mode.

set_camera_trigger_mode()

Set the camera trigger mode.

stop_stage()

Stop stage.

terminate()

Close hardware explicitly.

turn_off_lasers()

Turn off current laser.

turn_on_laser()

Turn on the current laser.

update_data_buffer(data_buffer, number_of_frames)

Update the data buffer for the camera.

update_stage_limits([limits_flag])

Update stage limits.

Attributes

microscope_name

Name of the microscope.

output_event_queue

Output event queue.

configuration

Configuration dictionary.

data_buffer

Buffer for image data.

stages

Dictionary of stages.

stages_list

List of stages.

ask_stage_for_position

Ask stage for position.

camera

Camera object.

shutter

Shutter device.

laser

Dictionary of lasers.

galvo

Dictionary of galvanometers.

remote_focus

Remote focus device.

filter_wheel

Dictionary of filter_wheels

info

Dictionary of microscope info.

current_channel

Current channel.

current_laser_index

Current laser index.

channels

List of all channels.

available_channels

List of available channels.

number_of_frames

Number of images.

central_focus

Central focus position.

is_synthetic

Is a synthetic microscope.

laser_wavelength

Dictionary of laser configurations.

ret_pos_dict

Dictionary of returned stage positions.

commands

Dictionary of commands

plugin_devices

Dictionary of plugin devices

daq

Dictionary of data acquisition devices.

assemble_device_config_lists(device_name: str, device_name_dict: dict) → tuple

Assemble device config lists.

Parameters:
  • device_name (str) – Device name.

  • device_name_dict (dict) – Device name dictionary.

Returns:

  • device_config_list (list) – Device configuration list.

  • device_name_list (list) – Device name list.

  • is_list (bool) – Is list.

calculate_all_waveform() → dict

Calculate all the waveforms.

Returns:

waveform – Dictionary of all the waveforms.

Return type:

dict

calculate_exposure_sweep_times() → tuple

Calculate the exposure and sweep times for all channels.

The calculate_exposure_sweep_times function calculates and returns exposure times and sweep times for all channels in a microscope configuration. It takes the camera’s readout time as an input parameter and considers various parameters such as camera exposure time, delay percentages, and smoothing to compute these times. The function iterates through the channels, performs calculations, and returns the results as dictionaries containing exposure times and sweep times for each channel.

Returns:

  • exposure_times (dict) – Dictionary of exposure times.

  • sweep_times (dict) – Dictionary of sweep times.

end_acquisition() → None

End the acquisition.

This function stops the acquisition, which includes stopping the data acquisition system, closing the camera image series, closing the shutter, turning off the lasers, and moving the stage to the central focus position if it was moved during the acquisition. It also stops the stage if it is moving.

get_available_channels() → None

Get the available channels for imaging.

This function gets the available channels for imaging by identifying which channels are selected for imaging in the configuration file.

get_exposure_sweep_times() → tuple

Get the exposure and sweep times for all channels.

Returns:

  • exposure_times (dict) – Dictionary of exposure times.

  • sweep_times (dict) – Dictionary of sweep times.

get_stage_position() → dict

Get stage position.

Returns:

stage_position – Dictionary of stage positions.

Return type:

dict

load_and_start_devices(device_name: str, is_list: bool, device_name_list: list, device_ref_name: str, device_connection: Any, name: str, i: int, plugin_devices: dict) → None

Load and start devices.

Function uses importlib to import the device startup functions and then starts the devices. If it is a list, it will start the device at the index i. If it is a plugin, it will load the plugin device.

Parameters:
  • device_name (str) – The name of the device.

  • is_list (bool) – Whether the device is a list of devices.

  • device_name_list (list) – The list of device names.

  • device_ref_name (str) – The reference name of the device.

  • device_connection (Any) – The communication instance of the device.

  • name (str) – The name of the microscope.

  • i (int) – Index.

  • plugin_devices (dict) – Plugin Devices

move_remote_focus(offset: Optional[float] = None) → None

Move remote focus.

Parameters:

offset (Optional[float], optional) – Offset, by default None

move_stage(pos_dict: dict, wait_until_done: bool = False, update_focus: bool = True) → bool

Move stage to a position.

Parameters:
  • pos_dict (dict) – Dictionary of stage positions.

  • wait_until_done (bool, optional) – Wait until stage is done moving, by default False

  • update_focus (bool, optional) – Update the central focus

Returns:

success – True if stage is successfully moved, False otherwise.

Return type:

bool

move_stage_offset(former_microscope: Optional[str] = None) → None

Move the stage to the offset position.

Parameters:

former_microscope (Optional[str], optional) – Name of the former microscope.

prepare_acquisition() → dict

Prepare the acquisition.

This function prepares the acquisition by identifying which channels are selected for imaging, setting the camera region of interest (ROI), setting the camera sensor mode, setting the camera binning, initializing the image series, calculating all the waveforms required for the acquisition process, and opens the shutter.

Returns:

waveform – Dictionary of all the waveforms. None if the camera ROI and binning are not set successfully.

Return type:

dict/None

prepare_next_channel(update_daq_task_flag: bool = True) → None

Prepare the next channel.

This function, prepare_next_channel, is responsible for configuring various hardware components for the next imaging channel in an experimental setup. It sequentially selects the next available channel, sets the filter wheel, camera exposure time, laser power, and other parameters based on the selected channel’s configuration. Additionally, it stops data acquisition, prepares the data acquisition system for the new channel, and adjusts the focus position as necessary, ensuring the hardware is ready for imaging the selected channel.

Parameters:

update_daq_task_flag (bool) – whether to override waveforms in the DAQ (create new tasks)

report_camera_settings() → None

Log the camera settings.

This function logs the camera settings for the current acquisition. It logs the camera parameters specified in the configuration file for the current microscope.

run_command(command: str, *args) → None

Run command.

Parameters:
  • command (str) – Command.

  • *args (list) – Variable input arguments.

set_camera_exposure_time(channel: dict) → None

Set the camera exposure time.

This function prepares the camera for imaging by setting the camera exposure time based on the selected channel’s configuration. It also adjusts the camera line interval if the sensor mode is set to the Light-Sheet mode.

Parameters:

channel (dict) – Dictionary of channel parameters.

set_camera_roi_and_binning() → bool

Set the camera ROI and binning.

This function sets the camera region of interest (ROI) based on the camera parameters specified in the configuration file. It sets the image width, image height, and the center of the image. The camera ROI is used to define the area of the image sensor that will be used to capture images during the acquisition process. The function also sets the camera binning value.

Returns:

True if the camera ROI and binning are set successfully, False otherwise.

Return type:

bool

set_camera_sensor_mode() → None

Set the camera sensor mode.

This function sets the camera sensor mode based on the camera parameters specified in the configuration file. It sets the sensor mode and the readout direction for the camera if it is in the light-sheet imaging mode.

set_camera_trigger_mode() → None

Set the camera trigger mode.

This function sets the camera trigger source, trigger mode.

stop_stage() → None

Stop stage.

terminate() → None

Close hardware explicitly.

Closes all devices other than plugin devices and deformable mirrors.

turn_off_lasers() → None

Turn off current laser.

turn_on_laser() → None

Turn on the current laser.

update_data_buffer(data_buffer: List[ndarray], number_of_frames: int) → None

Update the data buffer for the camera.

Parameters:
  • data_buffer (List[np.ndarray]) – Data buffer for the camera.

  • number_of_frames (int) – Number of frames to be acquired.

update_stage_limits(limits_flag: bool = True) → None

Update stage limits.

Parameters:

limits_flag (bool, optional) – Limits flag, by default True

ask_stage_for_position

Ask stage for position.

Type:

bool

available_channels

List of available channels.

Type:

list

camera

Camera object.

Type:

obj

central_focus

Central focus position.

Type:

float

channels

List of all channels.

Type:

list

commands

Dictionary of commands

Type:

dict

configuration

Configuration dictionary.

Type:

dict

current_channel

Current channel.

Type:

int

current_laser_index

Current laser index.

Type:

int

daq

Dictionary of data acquisition devices.

Type:

dict

data_buffer

Buffer for image data.

Type:

SharedNDArray

filter_wheel

Dictionary of filter_wheels

Type:

dict

galvo

Dictionary of galvanometers.

Type:

dict

info

Dictionary of microscope info.

Type:

dict

is_synthetic

Is a synthetic microscope.

Type:

Bool

laser

Dictionary of lasers.

Type:

dict

laser_wavelength

Dictionary of laser configurations.

Type:

dict

microscope_name

Name of the microscope.

Type:

str

number_of_frames

Number of images.

Type:

int

output_event_queue

Output event queue.

Type:

Queue

plugin_devices

Dictionary of plugin devices

Type:

dict

remote_focus

Remote focus device.

Type:

Any

ret_pos_dict

Dictionary of returned stage positions.

Type:

dict

shutter

Shutter device.

Type:

Any

stages

Dictionary of stages.

Type:

dict

stages_list

List of stages.

Type:

list

Previous Next

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