navigate.controller.sub_controllers.camera_settings.CameraSettingController
- class navigate.controller.sub_controllers.camera_settings.CameraSettingController(view, parent_controller=None, microscope_name=None)
Bases:
GUIController
Controller for the camera settings.
- __init__(view, parent_controller=None, microscope_name=None)
Initialize the camera setting controller.
- Parameters:
view (tkinter.Frame) – The view for the camera settings.
parent_controller (navigate.controller.main_controller.MainController) – The parent controller.
Methods
__init__
(view[, parent_controller, ...])Initialize the camera setting controller.
Calculate size of the FOV in microns.
execute
(command, *args)This function is called when a command is passed from a child process.
Sets widgets based on data given from main controller/config.
Sets values in View according to the experiment yaml file.
register_event_listener
(event_name, ...)Register event listener in the parent_controller
Sets values of widgets based on experiment setting
set_mode
(mode)Set widget configuration based upon imaging mode.
Set the status of ROI widgets
show_verbose_info
(*info)Prints verbose information to the console
Update caramera device related parameters.
Update GUI camera parameters
update_experiment_values
(*args)Updates experiment yaml file according to the values in View.
update_exposure_time
(exposure_time)When camera exposure time is changed, recalculate readout time
update_fov
(*args)Recalculate fov and update the widgets: FOV_X and FOV_Y
update_number_of_pixels
(*args)Update the number of pixels in the ROI.
Update camera readout time.
update_roi
(btn_name)Update ROI width and height.
update_sensor_mode
(*args)Updates the camera sensor mode.
Attributes
Custom events for this controller
Camera name
True if in initialization
Resolution value
Mode value
Solvent type
Mode widgets
Framerate widgets
ROI widgets
ROI buttons
Default pixel size
Default width int: Default height
Default width int: Default height
Camera width step interval
Camera height step interval
Camera width minimum
Camera height minimum
True if pixel event id
- calculate_physical_dimensions()
Calculate size of the FOV in microns.
Calculates the size of the field of view according to the magnification of the system, the physical size of the pixel, and the number of pixels. update FOV_X and FOV_Y
TODO: Should make sure that this is updated before we run the tiling wizard. Also can probably be done more elegantly in a configuration file and dictionary structure.
- execute(command, *args)
This function is called when a command is passed from a child process.
- Parameters:
command (str) – command name
args (tuple) – command arguments
- initialize()
Sets widgets based on data given from main controller/config.
- populate_experiment_values()
Sets values in View according to the experiment yaml file.
Experiment yaml filed passed by controller.
- register_event_listener(event_name, event_handler)
Register event listener in the parent_controller
- Parameters:
event_name (str) – event name
event_handler (function) – event handler
- set_experiment_values()
Sets values of widgets based on experiment setting
setting_dict is a dictionary
- set_mode(mode)
Set widget configuration based upon imaging mode.
This function will change state of widgets according to different mode ‘stop’ mode will let the editable widget be ‘normal’ in ‘live’ and ‘stack’ mode, some widgets are disabled
- Parameters:
mode (str) – One of ‘live’, ‘z-stack’, ‘stop’, ‘single’
- set_roi_widgets_state()
Set the status of ROI widgets
- show_verbose_info(*info)
Prints verbose information to the console
- Parameters:
info (tuple) – information to be printed
- update_camera_device_related_setting()
Update caramera device related parameters.
This function will update default width and height according to microscope name.
- update_camera_parameters_silent(value)
Update GUI camera parameters
- Parameters:
value (tuple) – (sensor_mode, readout_direction, number_of_pixels)
- update_experiment_values(*args)
Updates experiment yaml file according to the values in View.
Update the dictionary so that it can be combined with all the other sub-controllers, and then sent to the model.
- Parameters:
*args – Variable length argument list.
- update_exposure_time(exposure_time)
When camera exposure time is changed, recalculate readout time
- Parameters:
exposure_time (float) – exposure time in seconds
- update_fov(*args)
Recalculate fov and update the widgets: FOV_X and FOV_Y
- Parameters:
*args (Variable length argument list.) –
- update_number_of_pixels(*args)
Update the number of pixels in the ROI.
In live mode, we should let the device know the number of pixels changed.
- Parameters:
*args (tuple) – Unused
- update_readout_time()
Update camera readout time.
TODO: Highly specific to Hamamatsu Orca Flash 4.0. Should find a way to pass this from the camera to here. This should be moved to the camera device/API, ideally by calling a command from the camera.
- update_roi(btn_name)
Update ROI width and height.
- Parameters:
btn_name (roi button name) – width of roi in pixels: “All”, 1600, 1024, 512
- update_sensor_mode(*args)
Updates the camera sensor mode.
Updates text in readout widget based on what sensor mode is selected If we are in the Light Sheet mode, then we want the camera self.model[‘CameraParameters’][‘sensor_mode’]) == 12
If we are in thef normal mode, then we want the camera self.model[‘CameraParameters’][‘sensor_mode’]) == 1
Should initialize from the configuration file to the default version
- Parameters:
*args (Variable length argument list.) – usually args[0] is tkinter.Event or a str
- property custom_events
Custom events for this controller
- Type:
dict
- default_height
Default width int: Default height
- Type:
int
- default_pixel_size
Default pixel size
- Type:
int
- default_width
Default width int: Default height
- Type:
int
- framerate_widgets
Framerate widgets
- Type:
dict
- in_initialization
True if in initialization
- Type:
bool
- microscope_name
Camera name
- Type:
str
- min_height
Camera height minimum
- Type:
int
- min_width
Camera width minimum
- Type:
int
- mode
Mode value
- Type:
str
- mode_widgets
Mode widgets
- Type:
dict
- parent_controller
parent controller
- Type:
- pixel_event_id
True if pixel event id
- Type:
bool
- resolution_value
Resolution value
- Type:
str
- roi_btns
ROI buttons
- Type:
dict
- roi_widgets
ROI widgets
- Type:
dict
- solvent
Solvent type
- Type:
str
- step_height
Camera height step interval
- Type:
int
- step_width
Camera width step interval
- Type:
int
- view
GUI view
- Type:
tkinter.Tk