Qudi
|
Main Confocal Class for xy and depth scans. More...
Public Member Functions | |
def | __init__ (self, config, kwargs) |
def | on_activate (self) |
Initializes all needed UI files and establishes the connectors. More... | |
def | initMainUI (self) |
Definition, configuration and initialisation of the confocal GUI. More... | |
def | initSettingsUI (self) |
Definition, configuration and initialisation of the settings GUI. More... | |
def | initOptimizerSettingsUI (self) |
Definition, configuration and initialisation of the optimizer settings GUI. More... | |
def | on_deactivate (self) |
Reverse steps of activation. More... | |
def | show (self) |
Make main window visible and put it above all other windows. More... | |
def | keyPressEvent (self, event) |
Handles the passed keyboard events from the main window. More... | |
def | get_xy_cb_range (self) |
Determines the cb_min and cb_max values for the xy scan image. | |
def | get_depth_cb_range (self) |
Determines the cb_min and cb_max values for the xy scan image. | |
def | refresh_xy_colorbar (self) |
Adjust the xy colorbar. More... | |
def | refresh_depth_colorbar (self) |
Adjust the depth colorbar. More... | |
def | disable_scan_actions (self) |
Disables the buttons for scanning. | |
def | enable_scan_actions (self) |
Reset the scan action buttons to the default active state when the system is idle. | |
def | set_history_actions (self, enable) |
Enable or disable history arrows taking history state into account. More... | |
def | menu_settings (self) |
This method opens the settings menu. More... | |
def | update_settings (self) |
Write new settings from the gui to the file. More... | |
def | keep_former_settings (self) |
Keep the old settings and restores them in the gui. More... | |
def | menu_optimizer_settings (self) |
This method opens the settings menu. More... | |
def | update_optimizer_settings (self) |
Write new settings from the gui to the file. More... | |
def | keep_former_optimizer_settings (self) |
Keep the old settings and restores them in the gui. More... | |
def | ready_clicked (self) |
Stopp the scan if the state has switched to ready. More... | |
def | xy_scan_clicked (self) |
Manages what happens if the xy scan is started. More... | |
def | continue_xy_scan_clicked (self) |
Continue xy scan. More... | |
def | continue_depth_scan_clicked (self) |
Continue depth scan. More... | |
def | depth_scan_clicked (self) |
Start depth scan. More... | |
def | refocus_clicked (self) |
Start optimize position. More... | |
def | update_crosshair_position_from_logic (self, tag) |
Update the GUI position of the crosshair from the logic. More... | |
def | roi_xy_bounds_check (self, roi) |
Check if the focus cursor is oputside the allowed range after drag and set its position to the limit. | |
def | roi_depth_bounds_check (self, roi) |
Check if the focus cursor is oputside the allowed range after drag and set its position to the limit. | |
def | update_roi_xy (self, h=None, v=None) |
Adjust the xy ROI position if the value has changed. More... | |
def | update_roi_xy_size (self) |
Update the cursor size showing the optimizer scan area for the XY image. | |
def | update_roi_depth_size (self) |
Update the cursor size showing the optimizer scan area for the X-depth image. | |
def | update_roi_depth (self, h=None, v=None) |
Adjust the depth ROI position if the value has changed. More... | |
def | update_from_roi_xy (self, roi) |
The user manually moved the XY ROI, adjust all other GUI elements accordingly. More... | |
def | update_from_roi_depth (self, roi) |
The user manually moved the Z ROI, adjust all other GUI elements accordingly. More... | |
def | update_from_key (self, x=None, y=None, z=None) |
The user pressed a key to move the crosshair, adjust all GUI elements. More... | |
def | update_from_input_x (self) |
The user changed the number in the x position spin box, adjust all other GUI elements. More... | |
def | update_from_input_y (self) |
The user changed the number in the y position spin box, adjust all other GUI elements. More... | |
def | update_from_input_z (self) |
The user changed the number in the z position spin box, adjust all other GUI elements. More... | |
def | update_input_x (self, x_pos) |
Update the displayed x-value. More... | |
def | update_input_y (self, y_pos) |
Update the displayed y-value. More... | |
def | update_input_z (self, z_pos) |
Update the displayed z-value. More... | |
def | update_from_slider_x (self, sliderValue) |
The user moved the x position slider, adjust the other GUI elements. More... | |
def | update_from_slider_y (self, sliderValue) |
The user moved the y position slider, adjust the other GUI elements. More... | |
def | update_from_slider_z (self, sliderValue) |
The user moved the z position slider, adjust the other GUI elements. More... | |
def | update_slider_x (self, x_pos) |
Update the x slider when a change happens. More... | |
def | update_slider_y (self, y_pos) |
Update the y slider when a change happens. More... | |
def | update_slider_z (self, z_pos) |
Update the z slider when a change happens. More... | |
def | change_xy_resolution (self) |
Update the xy resolution in the logic according to the GUI. | |
def | change_z_resolution (self) |
Update the z resolution in the logic according to the GUI. | |
def | change_x_image_range (self) |
Adjust the image range for x in the logic. More... | |
def | change_y_image_range (self) |
Adjust the image range for y in the logic. | |
def | change_z_image_range (self) |
Adjust the image range for z in the logic. More... | |
def | update_tilt_correction (self) |
Update all tilt points from the scanner logic. More... | |
def | update_xy_channel (self, index) |
The displayed channel for the XY image was changed, refresh the displayed image. More... | |
def | update_depth_channel (self, index) |
The displayed channel for the X-depth image was changed, refresh the displayed image. More... | |
def | shortcut_to_xy_cb_manual (self) |
Someone edited the absolute counts range for the xy colour bar, better update. More... | |
def | shortcut_to_xy_cb_centiles (self) |
Someone edited the centiles range for the xy colour bar, better update. More... | |
def | shortcut_to_depth_cb_manual (self) |
Someone edited the absolute counts range for the z colour bar, better update. More... | |
def | shortcut_to_depth_cb_centiles (self) |
Someone edited the centiles range for the z colour bar, better update. More... | |
def | update_xy_cb_range (self) |
Redraw xy colour bar and scan image. More... | |
def | update_depth_cb_range (self) |
Redraw z colour bar and scan image. More... | |
def | refresh_xy_image (self) |
Update the current XY image from the logic. More... | |
def | refresh_depth_image (self) |
Update the current Depth image from the logic. More... | |
def | refresh_refocus_image (self) |
Refreshes the xy image, the crosshair and the colorbar. More... | |
def | refresh_scan_line (self) |
Get the previously scanned image line and display it in the scan line plot. More... | |
def | adjust_xy_window (self) |
Fit the visible window in the xy scan to full view. More... | |
def | adjust_depth_window (self) |
Fit the visible window in the depth scan to full view. More... | |
def | put_cursor_in_xy_scan (self) |
Put the xy crosshair back if it is outside of the visible range. More... | |
def | put_cursor_in_depth_scan (self) |
Put the depth crosshair back if it is outside of the visible range. More... | |
def | save_xy_scan_data (self) |
Run the save routine from the logic to save the xy confocal data. More... | |
def | save_xy_scan_image (self) |
Save the image and according to that the data. More... | |
def | save_depth_scan_data (self) |
Run the save routine from the logic to save the xy confocal pic. More... | |
def | save_depth_scan_image (self) |
Save the image and according to that the data. More... | |
def | switch_hardware (self) |
Switches the hardware state. More... | |
def | restore_default_view (self) |
Restore the arrangement of DockWidgets to the default. | |
def | small_optimizer_view (self) |
Rearrange the DockWidgets to produce a small optimizer interface. | |
def | zoom_clicked (self, is_checked) |
Methods for the zoom functionality of confocal GUI #. More... | |
def | xy_scan_start_zoom_point (self, event) |
Get the mouse coordinates if the mouse button was pressed. More... | |
def | xy_scan_end_zoom_point (self, event) |
Get the mouse coordinates if the mouse button was released. More... | |
def | reset_xy_imagerange (self) |
Reset the imagerange if autorange was pressed. More... | |
def | set_full_scan_range_xy (self) |
Set xy image scan range to scanner limits. | |
def | activate_zoom_double_click (self) |
Enable zoom tool when double clicking image. | |
def | depth_scan_start_zoom_point (self, event) |
Get the mouse coordinates if the mouse button was pressed. More... | |
def | depth_scan_end_zoom_point (self, event) |
Get the mouse coordinates if the mouse button was released. More... | |
def | reset_depth_imagerange (self) |
Reset the imagerange if autorange was pressed. More... | |
def | set_full_scan_range_z (self) |
Set depth image scan range to scanner limits. | |
def | update_scan_range_inputs (self) |
Update scan range spinboxes from confocal logic. | |
def | logic_started_scanning (self, tag) |
Disable icons if a scan was started. More... | |
def | logic_continued_scanning (self, tag) |
Disable icons if a scan was continued. More... | |
def | logic_started_refocus (self, tag) |
Disable icons if a refocus was started. More... | |
Public Attributes | |
xy_channel | |
Configuring the dock widgets #. More... | |
depth_channel | |
opt_channel | |
xy_image | |
depth_image | |
scan_line_plot | |
xy_refocus_image | |
Configuration of the optimizer tab #. More... | |
depth_refocus_image | |
depth_refocus_fit_image | |
vLine | |
hLine | |
roi_xy | |
hline_xy | |
vline_xy | |
roi_depth | |
hline_depth | |
vline_depth | |
slider_res | |
my_colors | |
Connect the colorbar and their actions #. More... | |
xy_cb | |
depth_cb | |
Static Public Attributes | |
confocallogic1 = Connector(interface='ConfocalLogic') | |
savelogic = Connector(interface='SaveLogic') | |
optimizerlogic1 = Connector(interface='OptimizerLogic') | |
fixed_aspect_ratio_xy = ConfigOption('fixed_aspect_ratio_xy', True) | |
fixed_aspect_ratio_depth = ConfigOption('fixed_aspect_ratio_depth', True) | |
image_x_padding = ConfigOption('image_x_padding', 0.02) | |
image_y_padding = ConfigOption('image_y_padding', 0.02) | |
image_z_padding = ConfigOption('image_z_padding', 0.02) | |
default_meter_prefix = ConfigOption('default_meter_prefix', None) | |
adjust_cursor_roi = StatusVar(default=True) | |
slider_small_step = StatusVar(default=10e-9) | |
slider_big_step = StatusVar(default=100e-9) | |
sigStartOptimizer = QtCore.Signal(list, str) | |
Main Confocal Class for xy and depth scans.
def confocalgui.ConfocalGui.adjust_depth_window | ( | self | ) |
Fit the visible window in the depth scan to full view.
Be careful in using that method, since it uses the input values for the ranges to adjust x and z. Make sure that in the process of the depth scan no method is calling adjust_xy_window, otherwise it will adjust for you a window which does not correspond to the scan!
def confocalgui.ConfocalGui.adjust_xy_window | ( | self | ) |
Fit the visible window in the xy scan to full view.
Be careful in using that method, since it uses the input values for the ranges to adjust x and y. Make sure that in the process of the depth scan no method is calling adjust_depth_window, otherwise it will adjust for you a window which does not correspond to the scan!
def confocalgui.ConfocalGui.change_x_image_range | ( | self | ) |
Adjust the image range for x in the logic.
def confocalgui.ConfocalGui.change_z_image_range | ( | self | ) |
Adjust the image range for z in the logic.
def confocalgui.ConfocalGui.continue_depth_scan_clicked | ( | self | ) |
Continue depth scan.
def confocalgui.ConfocalGui.continue_xy_scan_clicked | ( | self | ) |
Continue xy scan.
def confocalgui.ConfocalGui.depth_scan_clicked | ( | self | ) |
Start depth scan.
def confocalgui.ConfocalGui.depth_scan_end_zoom_point | ( | self, | |
event | |||
) |
Get the mouse coordinates if the mouse button was released.
QEvent | event: |
def confocalgui.ConfocalGui.depth_scan_start_zoom_point | ( | self, | |
event | |||
) |
Get the mouse coordinates if the mouse button was pressed.
QMouseEvent | event: Mouse Event object which contains all the information at the time the event was emitted |
def confocalgui.ConfocalGui.initMainUI | ( | self | ) |
Definition, configuration and initialisation of the confocal GUI.
This init connects all the graphic modules, which were created in the *.ui file and configures the event handling between the modules. Moreover it sets default values.
def confocalgui.ConfocalGui.initOptimizerSettingsUI | ( | self | ) |
Definition, configuration and initialisation of the optimizer settings GUI.
This init connects all the graphic modules, which were created in the *.ui file and configures the event handling between the modules. Moreover it sets default values if not existed in the logic modules.
def confocalgui.ConfocalGui.initSettingsUI | ( | self | ) |
Definition, configuration and initialisation of the settings GUI.
This init connects all the graphic modules, which were created in the *.ui file and configures the event handling between the modules. Moreover it sets default values if not existed in the logic modules.
def confocalgui.ConfocalGui.keep_former_optimizer_settings | ( | self | ) |
Keep the old settings and restores them in the gui.
def confocalgui.ConfocalGui.keep_former_settings | ( | self | ) |
Keep the old settings and restores them in the gui.
def confocalgui.ConfocalGui.keyPressEvent | ( | self, | |
event | |||
) |
Handles the passed keyboard events from the main window.
object | event: qtpy.QtCore.QEvent object. |
def confocalgui.ConfocalGui.logic_continued_scanning | ( | self, | |
tag | |||
) |
Disable icons if a scan was continued.
tag | str: tag indicating command source |
def confocalgui.ConfocalGui.logic_started_refocus | ( | self, | |
tag | |||
) |
Disable icons if a refocus was started.
tag | str: tag indicating command source |
def confocalgui.ConfocalGui.logic_started_scanning | ( | self, | |
tag | |||
) |
Disable icons if a scan was started.
tag | str: tag indicating command source |
def confocalgui.ConfocalGui.menu_optimizer_settings | ( | self | ) |
This method opens the settings menu.
def confocalgui.ConfocalGui.menu_settings | ( | self | ) |
This method opens the settings menu.
def confocalgui.ConfocalGui.on_activate | ( | self | ) |
Initializes all needed UI files and establishes the connectors.
This method executes the all the inits for the differnt GUIs and passes the event argument from fysom to the methods.
def confocalgui.ConfocalGui.on_deactivate | ( | self | ) |
Reverse steps of activation.
def confocalgui.ConfocalGui.put_cursor_in_depth_scan | ( | self | ) |
Put the depth crosshair back if it is outside of the visible range.
def confocalgui.ConfocalGui.put_cursor_in_xy_scan | ( | self | ) |
Put the xy crosshair back if it is outside of the visible range.
def confocalgui.ConfocalGui.ready_clicked | ( | self | ) |
Stopp the scan if the state has switched to ready.
def confocalgui.ConfocalGui.refocus_clicked | ( | self | ) |
Start optimize position.
def confocalgui.ConfocalGui.refresh_depth_colorbar | ( | self | ) |
Adjust the depth colorbar.
Calls the refresh method from colorbar, which takes either the lowest and higherst value in the image or predefined ranges. Note that you can invert the colorbar if the lower border is bigger then the higher one.
def confocalgui.ConfocalGui.refresh_depth_image | ( | self | ) |
Update the current Depth image from the logic.
Everytime the scanner is scanning a line in depth the image is rebuild and updated in the GUI.
def confocalgui.ConfocalGui.refresh_refocus_image | ( | self | ) |
Refreshes the xy image, the crosshair and the colorbar.
def confocalgui.ConfocalGui.refresh_scan_line | ( | self | ) |
Get the previously scanned image line and display it in the scan line plot.
def confocalgui.ConfocalGui.refresh_xy_colorbar | ( | self | ) |
Adjust the xy colorbar.
Calls the refresh method from colorbar, which takes either the lowest and higherst value in the image or predefined ranges. Note that you can invert the colorbar if the lower border is bigger then the higher one.
def confocalgui.ConfocalGui.refresh_xy_image | ( | self | ) |
Update the current XY image from the logic.
Everytime the scanner is scanning a line in xy the image is rebuild and updated in the GUI.
def confocalgui.ConfocalGui.reset_depth_imagerange | ( | self | ) |
Reset the imagerange if autorange was pressed.
Take the image range values directly from the scanned image and set them as the current image ranges.
def confocalgui.ConfocalGui.reset_xy_imagerange | ( | self | ) |
Reset the imagerange if autorange was pressed.
Take the image range values directly from the scanned image and set them as the current image ranges.
def confocalgui.ConfocalGui.save_depth_scan_data | ( | self | ) |
Run the save routine from the logic to save the xy confocal pic.
def confocalgui.ConfocalGui.save_depth_scan_image | ( | self | ) |
Save the image and according to that the data.
Here only the path to the module is taken from the save logic, but the picture save algorithm is situated here in confocal, since it is a very specific task to save the used PlotObject.
def confocalgui.ConfocalGui.save_xy_scan_data | ( | self | ) |
Run the save routine from the logic to save the xy confocal data.
def confocalgui.ConfocalGui.save_xy_scan_image | ( | self | ) |
Save the image and according to that the data.
Here only the path to the module is taken from the save logic, but the picture save algorithm is situated here in confocal, since it is a very specific task to save the used PlotObject.
def confocalgui.ConfocalGui.set_history_actions | ( | self, | |
enable | |||
) |
Enable or disable history arrows taking history state into account.
def confocalgui.ConfocalGui.shortcut_to_depth_cb_centiles | ( | self | ) |
Someone edited the centiles range for the z colour bar, better update.
def confocalgui.ConfocalGui.shortcut_to_depth_cb_manual | ( | self | ) |
Someone edited the absolute counts range for the z colour bar, better update.
def confocalgui.ConfocalGui.shortcut_to_xy_cb_centiles | ( | self | ) |
Someone edited the centiles range for the xy colour bar, better update.
def confocalgui.ConfocalGui.shortcut_to_xy_cb_manual | ( | self | ) |
Someone edited the absolute counts range for the xy colour bar, better update.
def confocalgui.ConfocalGui.show | ( | self | ) |
Make main window visible and put it above all other windows.
def confocalgui.ConfocalGui.switch_hardware | ( | self | ) |
Switches the hardware state.
def confocalgui.ConfocalGui.update_crosshair_position_from_logic | ( | self, | |
tag | |||
) |
Update the GUI position of the crosshair from the logic.
str | tag: tag indicating the source of the update |
Ignore the update when it is tagged with one of the tags that the confocal gui emits, as the GUI elements were already adjusted.
def confocalgui.ConfocalGui.update_depth_cb_range | ( | self | ) |
Redraw z colour bar and scan image.
def confocalgui.ConfocalGui.update_depth_channel | ( | self, | |
index | |||
) |
The displayed channel for the X-depth image was changed, refresh the displayed image.
index | int: index of selected channel item in combo box |
def confocalgui.ConfocalGui.update_from_input_x | ( | self | ) |
The user changed the number in the x position spin box, adjust all other GUI elements.
def confocalgui.ConfocalGui.update_from_input_y | ( | self | ) |
The user changed the number in the y position spin box, adjust all other GUI elements.
def confocalgui.ConfocalGui.update_from_input_z | ( | self | ) |
The user changed the number in the z position spin box, adjust all other GUI elements.
def confocalgui.ConfocalGui.update_from_key | ( | self, | |
x = None , |
|||
y = None , |
|||
z = None |
|||
) |
The user pressed a key to move the crosshair, adjust all GUI elements.
float | x: new x position in m |
float | y: new y position in m |
float | z: new z position in m |
def confocalgui.ConfocalGui.update_from_roi_depth | ( | self, | |
roi | |||
) |
The user manually moved the Z ROI, adjust all other GUI elements accordingly.
object roi: PyQtGraph ROI object
def confocalgui.ConfocalGui.update_from_roi_xy | ( | self, | |
roi | |||
) |
The user manually moved the XY ROI, adjust all other GUI elements accordingly.
object roi: PyQtGraph ROI object
def confocalgui.ConfocalGui.update_from_slider_x | ( | self, | |
sliderValue | |||
) |
The user moved the x position slider, adjust the other GUI elements.
int sliderValue: slider postion, a quantized whole number
def confocalgui.ConfocalGui.update_from_slider_y | ( | self, | |
sliderValue | |||
) |
The user moved the y position slider, adjust the other GUI elements.
int sliderValue: slider postion, a quantized whole number
def confocalgui.ConfocalGui.update_from_slider_z | ( | self, | |
sliderValue | |||
) |
The user moved the z position slider, adjust the other GUI elements.
int sliderValue: slider postion, a quantized whole number
def confocalgui.ConfocalGui.update_input_x | ( | self, | |
x_pos | |||
) |
Update the displayed x-value.
float | x_pos: the current value of the x position in m |
def confocalgui.ConfocalGui.update_input_y | ( | self, | |
y_pos | |||
) |
Update the displayed y-value.
float | y_pos: the current value of the y position in m |
def confocalgui.ConfocalGui.update_input_z | ( | self, | |
z_pos | |||
) |
Update the displayed z-value.
float | z_pos: the current value of the z position in m |
def confocalgui.ConfocalGui.update_optimizer_settings | ( | self | ) |
Write new settings from the gui to the file.
def confocalgui.ConfocalGui.update_roi_depth | ( | self, | |
h = None , |
|||
v = None |
|||
) |
Adjust the depth ROI position if the value has changed.
float | h: real value of the current horizontal position |
float | v: real value of the current vertical position |
Since the origin of the region of interest (ROI) is not the crosshair point but the lowest left point of the square, you have to shift the origin according to that. Therefore the position of the ROI is not the actual position!
def confocalgui.ConfocalGui.update_roi_xy | ( | self, | |
h = None , |
|||
v = None |
|||
) |
Adjust the xy ROI position if the value has changed.
float | x: real value of the current x position |
float | y: real value of the current y position |
Since the origin of the region of interest (ROI) is not the crosshair point but the lowest left point of the square, you have to shift the origin according to that. Therefore the position of the ROI is not the actual position!
def confocalgui.ConfocalGui.update_settings | ( | self | ) |
Write new settings from the gui to the file.
def confocalgui.ConfocalGui.update_slider_x | ( | self, | |
x_pos | |||
) |
Update the x slider when a change happens.
float | x_pos: x position in m |
def confocalgui.ConfocalGui.update_slider_y | ( | self, | |
y_pos | |||
) |
Update the y slider when a change happens.
float | y_pos: x yosition in m |
def confocalgui.ConfocalGui.update_slider_z | ( | self, | |
z_pos | |||
) |
Update the z slider when a change happens.
float | z_pos: z position in m |
def confocalgui.ConfocalGui.update_tilt_correction | ( | self | ) |
Update all tilt points from the scanner logic.
def confocalgui.ConfocalGui.update_xy_cb_range | ( | self | ) |
Redraw xy colour bar and scan image.
def confocalgui.ConfocalGui.update_xy_channel | ( | self, | |
index | |||
) |
The displayed channel for the XY image was changed, refresh the displayed image.
index | int: index of selected channel item in combo box |
def confocalgui.ConfocalGui.xy_scan_clicked | ( | self | ) |
Manages what happens if the xy scan is started.
def confocalgui.ConfocalGui.xy_scan_end_zoom_point | ( | self, | |
event | |||
) |
Get the mouse coordinates if the mouse button was released.
QEvent | event: |
def confocalgui.ConfocalGui.xy_scan_start_zoom_point | ( | self, | |
event | |||
) |
Get the mouse coordinates if the mouse button was pressed.
QMouseEvent | event: Mouse Event object which contains all the information at the time the event was emitted |
def confocalgui.ConfocalGui.zoom_clicked | ( | self, | |
is_checked | |||
) |
Methods for the zoom functionality of confocal GUI #.
Activates the zoom mode in the xy and depth Windows.
@param bool is_checked: pass the state of the zoom button if checked or not. Depending on the state of the zoom button the DragMode in the ViewWidgets are changed. There are 3 possible modes and each of them corresponds to a int value: - 0: NoDrag - 1: ScrollHandDrag - 2: RubberBandDrag Pyqtgraph implements every action for the NoDrag mode. That means the other two modes are not used at the moment. Therefore we are using the RubberBandDrag mode to simulate a zooming procedure. The selection window in the RubberBandDrag is only used to show the user which region will be selected. But the zooming idea is based on catched mousePressEvent and mouseReleaseEvent, which will be used if the RubberBandDrag mode is activated. For more information see the qt doc: http://doc.qt.io/qt-4.8/qgraphicsview.html#DragMode-enum
confocalgui.ConfocalGui.my_colors |
Connect the colorbar and their actions #.
Get the colorscale and set the LUTs
confocalgui.ConfocalGui.xy_channel |
Configuring the dock widgets #.
All our gui elements are dockable, and so there should be no "central" widget.
confocalgui.ConfocalGui.xy_refocus_image |
Configuration of the optimizer tab #.
Load the image for the optimizer tab