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.controller.Controller
  • View page source

navigate.controller.controller.Controller

class navigate.controller.controller.Controller(root, splash_screen, configuration_path, experiment_path, waveform_constants_path, rest_api_path, waveform_templates_path, gui_configuration_path, multi_positions_path, args)

Bases: object

Navigate Controller

__init__(root, splash_screen, configuration_path, experiment_path, waveform_constants_path, rest_api_path, waveform_templates_path, gui_configuration_path, multi_positions_path, args)

Initialize the Navigate Controller.

Parameters:
  • root (Tk top-level widget.) – Tk.tk GUI instance.

  • splash_screen (Tk top-level widget.) – Tk.tk GUI instance.

  • configuration_path (string) – Path to the configuration yaml file. Provides global microscope configuration parameters.

  • experiment_path (string) – Path to the experiment yaml file. Provides experiment-specific microscope configuration.

  • waveform_constants_path (string) – Path to the waveform constants yaml file. Provides magnification and wavelength-specific parameters.

  • rest_api_path (string) – Path to the REST API yaml file. Provides REST API configuration parameters.

  • waveform_templates_path (string) – Path to the waveform templates yaml file. Provides waveform templates for each channel.

  • gui_configuration_path (string) – Path to the GUI configuration yaml file. Provides GUI configuration parameters.

  • *args – Command line input arguments for non-default file paths or using synthetic hardware modes.

Methods

__init__(root, splash_screen, ...)

Initialize the Navigate Controller.

add_acquisition_mode(name, acquisition_obj)

Add and Acquisition Mode.

capture_image(command, mode, *args)

Trigger the model to capture images.

change_microscope(microscope_name[, zoom])

Change the microscope configuration.

destroy_virtual_microscope(microscope_name)

Destroy virtual microscopes.

execute(command, *args)

Functions listens to the Sub_Gui_Controllers.

initialize_cam_view()

Populate view and maximum intensity projection tabs.

launch_additional_microscopes()

Launch additional microscopes.

move_stage(pos_dict)

Trigger the model to move the stage.

populate_experiment_setting([file_name, ...])

Load experiment file and populate model.experiment and configure view.

prepare_acquire_data()

Prepare the acquisition data.

register_event_listener(event_name, ...)

Register an event listener.

register_event_listeners(events)

Register multiple event listeners.

resize(event)

Resize the GUI.

set_mode_of_sub(mode)

Communicates imaging mode to sub-controllers.

sloppy_stop()

Keep trying to stop the model until successful.

stop_stage()

Stop the stage.

update_acquire_control()

Update the acquire control based on the current experiment parameters.

update_buffer()

Update the buffer size according to the camera dimensions listed in the experimental parameters.

update_event()

Update the View/Controller based on events from the Model.

update_experiment_setting()

Update model.experiment according to values in the GUI

update_stage_controller_silent(ret_pos_dict)

Send updates to the stage GUI

Attributes

root

Tk.tk GUI instance.

splash_screen

Tk.tk GUI instance.

configuration_path

Path to the configuration yaml file.

experiment_path

Path to the experiment yaml file.

waveform_constants_path

Path to the waveform constants yaml file.

rest_api_path

Path to the REST API yaml file.

waveform_templates_path

Path to the waveform templates yaml file.

gui_configuration_path

Path to the GUI configuration yaml file.

args

Non-default command line input arguments for

threads_pool

Thread pool for the controller.

event_queue

Queue for retrieving events ('event_name', value) from model

manager

A shared memory manager

configuration

Configuration dictionary

model

Model object in MVC architecture.

show_img_pipe

Pipe for sending images from model to view.

default_experiment_file

Path to the default experiment yaml file.

configuration_controller

Configuration Controller object.

view

View object in MVC architecture.

event_listeners

Event listeners for the controller.

acquire_bar_controller

Acquire Bar Sub-Controller.

channels_tab_controller

Channels Tab Sub-Controller.

multiposition_tab_controller

Multi-Position Tab Sub-Controller.

camera_view_controller

Camera View Tab Sub-Controller.

mip_setting_controller

MIP Settings Tab Sub-Controller.

camera_setting_controller

Camera Settings Tab Sub-Controller.

stage_controller

Stage Sub-Controller.

waveform_tab_controller

Waveform Display Sub-Controller.

keystroke_controller

Keystroke Sub-Controller.

menu_controller

Menu Sub-Controller.

plugin_acquisition_modes

acquisition modes from plugins

plugin_controller

Plugin Sub-Controller

img_width

Number of x_pixels from microscope configuration file.

img_height

Number of y_pixels from microscope configuration file.

data_buffer

Pre-allocated shared memory array.

additional_microscopes

Additional microscopes.

additional_microscopes_configs

Additional microscope configurations.

stop_acquisition_flag

Flag for stopping acquisition.

current_image_id

current image id in the buffer

resize_event_id

ID for the resize event.Only works on Windows OS.

add_acquisition_mode(name, acquisition_obj)

Add and Acquisition Mode.

Parameters:
  • name (string) – Name of the acquisition mode.

  • acquisition_obj (object) – Object of the acquisition mode.

capture_image(command, mode, *args)

Trigger the model to capture images.

Parameters:
  • command (string) – ‘acquire’ or ‘autofocus’

  • mode (string) – ‘continuous’, ‘z-stack’, ‘single’, or ‘projection’

  • args (function-specific passes.) –

change_microscope(microscope_name, zoom=None)

Change the microscope configuration.

Parameters:
  • microscope_name (string) – Name of the microscope to change to.

  • zoom (string) – Name of the zoom value to change to.

destroy_virtual_microscope(microscope_name, destroy_window=True)

Destroy virtual microscopes.

Parameters:
  • microscope_name (str) – The microscope name

  • destroy_window (bool) – The flag to dismiss window.

execute(command, *args)

Functions listens to the Sub_Gui_Controllers.

The controller.experiment is passed as an argument to the model, which then overwrites the model.experiment. Workaround due to model being in a sub-process.

Parameters:
  • command (string) – The string includes ‘stage’, ‘stop_stage’, ‘move_stage_and_update_info’,

  • args* (Iterable.) – Function-specific passes

initialize_cam_view()

Populate view and maximum intensity projection tabs.

Communicates with the camera view controller and mip setting controller to set the minimum and maximum counts, as well as the default channel settings.

launch_additional_microscopes()

Launch additional microscopes.

move_stage(pos_dict)

Trigger the model to move the stage.

Parameters:

pos_dict (dict) – Dictionary of axis positions

populate_experiment_setting(file_name=None, in_initialize=False)

Load experiment file and populate model.experiment and configure view.

Confirms that the experiment file exists. Sends the experiment file to the model and the controller. Populates the GUI with these settings.

Parameters:

file_name (string) – file_name = path to the non-default experiment yaml file.

prepare_acquire_data()

Prepare the acquisition data.

Updates model.experiment. Sets sub-controller’s mode to ‘live’ when ‘continuous is selected, or ‘stop’.

Returns:

True if all settings are valid, False otherwise.

Return type:

bool

register_event_listener(event_name, event_handler)

Register an event listener.

Parameters:
  • event_name (string) – Name of the event.

  • event_handler (callable) – The function to handle the event.

register_event_listeners(events)

Register multiple event listeners.

Parameters:

events (dict) – Dictionary of event names and handlers.

resize(event)

Resize the GUI.

Parameters:

event (event) – event = <Configure x=0 y=0 width=1200 height=600>

set_mode_of_sub(mode)

Communicates imaging mode to sub-controllers.

Parameters:

mode (str) – The string = ‘live’, ‘stop’

sloppy_stop()

Keep trying to stop the model until successful.

TODO: Delete this function!!!

This is set up to get around the conflict between self.threads_pool.createThread(‘model’, target) commands and the need to stop as abruptly as possible when the user hits stop. Here we leverage ObjectInSubprocess’ refusal to let us access the model from two threads to our advantage, and just try repeatedly until we get a command in front of the next command in the model threads_pool resource. We should instead pause the model thread pool and interject our stop command, or clear the queue in threads_pool.

stop_stage()

Stop the stage.

Grab the stopped position from the stage and update the GUI control values accordingly.

update_acquire_control()

Update the acquire control based on the current experiment parameters.

update_buffer()

Update the buffer size according to the camera dimensions listed in the experimental parameters.

Returns:

  • self.img_width (int) – Number of x_pixels from microscope configuration file.

  • self.image_height (int) – Number of y_pixels from microscope configuration file.

  • self.data_buffer (SharedNDArray) – Pre-allocated shared memory array. Size dictated by x_pixels, y_pixels, an number_of_frames in configuration file.

update_event()

Update the View/Controller based on events from the Model.

update_experiment_setting()

Update model.experiment according to values in the GUI

Collect settings from sub-controllers will validate the value, if something is wrong, it will return False

Returns:

Warning info if any

Return type:

string

update_stage_controller_silent(ret_pos_dict)

Send updates to the stage GUI

Parameters:

ret_pos_dict (dict) – Dictionary of axis positions

acquire_bar_controller

Acquire Bar Sub-Controller.

Type:

AcquireBarController

additional_microscopes

Additional microscopes.

Type:

dict

additional_microscopes_configs

Additional microscope configurations.

Type:

dict

args

Non-default command line input arguments for

Type:

iterable

camera_setting_controller

Camera Settings Tab Sub-Controller.

Type:

CameraSettingController

camera_view_controller

Camera View Tab Sub-Controller.

Type:

CameraViewController

channels_tab_controller

Channels Tab Sub-Controller.

Type:

ChannelsTabController

configuration

Configuration dictionary

Type:

dict

configuration_controller

Configuration Controller object.

Type:

ConfigurationController

configuration_path

Path to the configuration yaml file.

Type:

string

current_image_id

current image id in the buffer

Type:

int

data_buffer

Pre-allocated shared memory array.

Type:

SharedNDArray

default_experiment_file

Path to the default experiment yaml file.

Type:

string

event_listeners

Event listeners for the controller.

Type:

dict

event_queue

Queue for retrieving events (‘event_name’, value) from model

Type:

mp.Queue

experiment_path

Path to the experiment yaml file.

Type:

string

gui_configuration_path

Path to the GUI configuration yaml file.

Type:

string

img_height

Number of y_pixels from microscope configuration file.

Type:

int

img_width

Number of x_pixels from microscope configuration file.

Type:

int

keystroke_controller

Keystroke Sub-Controller.

Type:

KeystrokeController

manager

A shared memory manager

Type:

Manager

menu_controller

Menu Sub-Controller.

Type:

MenuController

mip_setting_controller

MIP Settings Tab Sub-Controller.

Type:

MIPSettingController

model

Model object in MVC architecture.

Type:

ObjectInSubprocess

multiposition_tab_controller

Multi-Position Tab Sub-Controller.

Type:

MultiPositionController

plugin_acquisition_modes

acquisition modes from plugins

Type:

dict

plugin_controller

Plugin Sub-Controller

Type:

PluginsController

resize_event_id

ID for the resize event.Only works on Windows OS.

Type:

int

rest_api_path

Path to the REST API yaml file.

Type:

string

root

Tk.tk GUI instance.

Type:

Tk top-level widget

show_img_pipe

Pipe for sending images from model to view.

Type:

mp.Pipe

splash_screen

Tk.tk GUI instance.

Type:

Tk top-level widget

stage_controller

Stage Sub-Controller.

Type:

StageController

stop_acquisition_flag

Flag for stopping acquisition.

Type:

bool

threads_pool

Thread pool for the controller.

Type:

Object

view

View object in MVC architecture.

Type:

View

waveform_constants_path

Path to the waveform constants yaml file.

Type:

string

waveform_tab_controller

Waveform Display Sub-Controller.

Type:

WaveformTabController

waveform_templates_path

Path to the waveform templates yaml file.

Type:

string


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