ibl_alignment_gui.plugins.range_controller

Functions

callback

Open the Range Controller plugin window.

get_levels

Get the levels for a given plot key and type.

get_plot_group

Get the plot group for a given plot type.

reset_default_levels

Reset the levels to default for a given plot key and type.

set_levels

Set the levels for a given plot key and type.

setup

Set up the Range Controller plugin.

Classes

RangeController

The Range Controller plugin for the alignment GUI.

RangeControllerView

The GUI view for the Range Controller plugin.

class ibl_alignment_gui.plugins.range_controller.RangeController(title, controller)[source]

Bases: object

The Range Controller plugin for the alignment GUI.

Parameters:
  • title (str) – The title of the plugin window.

  • controller (AlignmentGUIController) – The main application controller.

title

The title of the plugin window.

Type:

str

controller

The main application controller.

Type:

AlignmentGUIController

view

The GUI view for the Range Controller plugin.

Type:

RangeControllerView

disable

A flag to disable callbacks during updates.

Type:

bool

plot_keys

A collection of current plot keys for image, probe, and line plots.

Type:

Bunch

disable_sliders()[source]

Disable sliders when the view is changed to feature view.

Return type:

None

get_image_plot_type(plot_key)[source]

Determine the plot type for a given plot key.

Parameters:

plot_key (str)

Returns:

The plot type (‘image’ or ‘scatter’) or None if not found.

Return type:

str | None

on_close()[source]

Triggered when the plugin window is closed.

Deactivate the plugin and callbacks.

Return type:

None

on_plot_changed(plot_key, plot_type)[source]

Triggered when a plot is changed in the main controller.

If no view is set or callbacks are disabled, it returns immediately.

Parameters:
  • plot_key (str) – The key of the plot that was changed.

  • plot_type (str) – The type of the plot (‘image’, ‘probe’, ‘line’, or ‘scatter’).

Return type:

None

on_reset_button_pressed(_, plot_type)[source]

Triggered when the reset button is pressed.

Resets the levels to default and updates the plots.

Parameters:

plot_type (str) – The type of the plot

Return type:

None

on_slider_moved(slider_widget, plot_type)[source]

Triggered when a slider is moved.

Updates the slider values and updates the plots.

Parameters:
  • slider_widget (SliderWidget) – The slider widget that was moved.

  • plot_type (str) – The type of the plot

Return type:

None

plot_panels(plot_key, plot_type)[source]

Re-plot the panels in the main view for the given plot key and type.

Parameters:
  • plot_key (str) – The key of the plot to update.

  • plot_type (str) – The type of the plot (‘image’, ‘probe’, ‘line’, ‘scatter’ or ‘feature’)

Return type:

None

set_init_levels()[source]

Set the initial levels for image, probe, and line plots based on controller settings.

Return type:

None

setup()[source]

Set up the plugin GUI and connect callbacks.

Return type:

None

class ibl_alignment_gui.plugins.range_controller.RangeControllerView(title, controller)[source]

Bases: PopupWindow

The GUI view for the Range Controller plugin.

Parameters:
  • title (str) – The title of the popup window.

  • controller (AlignmentGUIController) – The main application controller.

get_selected_configs()[source]

Get the list of selected configurations from the GUI.

Returns:

A list of selected configuration names.

Return type:

list

get_selected_shanks()[source]

Get the list of selected shanks from the GUI.

Returns:

A list of selected shank names.

Return type:

list

on_config_button_clicked(checked, button)[source]

Triggered when a configuration button is clicked.

If the clicked button is ‘both’, it checks or unchecks all configuration buttons accordingly.

Parameters:
  • checked (bool) – Whether the button is checked or not.

  • button (str) – The text of the button that was clicked.

Return type:

None

on_shank_button_clicked(checked, button)[source]

Triggered when a shank button is clicked.

If the clicked button is ‘All’, it checks or unchecks all shank buttons accordingly.

Parameters:
  • checked (bool) – Whether the button is checked or not.

  • button (str) – The text of the button that was clicked.

Return type:

None

setup()[source]

Add widgets to the popup window.

ibl_alignment_gui.plugins.range_controller.callback(controller)[source]

Open the Range Controller plugin window.

Parameters:

controller (AlignmentGUIController) – The main application controller.

Return type:

None

ibl_alignment_gui.plugins.range_controller.get_levels(controller, items, plot_key, plot_type, **kwargs)[source]

Get the levels for a given plot key and type.

Parameters:
  • plot_key (str) – The key of the plot.

  • plot_type (str) – The type of the plot (‘image’, ‘probe’, ‘line’, or ‘scatter’).

Returns:

A dictionary containing the data, shank, and config.

Return type:

dict

ibl_alignment_gui.plugins.range_controller.get_plot_group(items, plot_type)[source]

Get the plot group for a given plot type.

Parameters:

plot_type (The type of the plot ('image', 'probe', 'line', or 'scatter').)

Returns:

The plot group corresponding to the plot type.

Return type:

Bunch

ibl_alignment_gui.plugins.range_controller.reset_default_levels(controller, items, plot_key, plot_type, **kwargs)[source]

Reset the levels to default for a given plot key and type.

Parameters:
  • plot_key (str) – The key of the plot to reset.

  • plot_type (str) – The type of the plot (‘image’, ‘probe’, ‘line’, or ‘scatter’).

Return type:

None

ibl_alignment_gui.plugins.range_controller.set_levels(controller, items, plot_key, plot_type, levels, **kwargs)[source]

Set the levels for a given plot key and type.

Parameters:
  • plot_key (str) – The key of the plot to update.

  • plot_type (str) – The type of the plot (‘image’, ‘probe’, ‘line’, or ‘scatter’).

  • levels (list or tuple) – The new levels to set.

Return type:

None

ibl_alignment_gui.plugins.range_controller.setup(controller)[source]

Set up the Range Controller plugin.

Adds a submenu to the main menu to open the plugin and attaches necessary callbacks to the controller.

Parameters:

controller (AlignmentGUIController) – The main application controller.

Return type:

None