3.3.1. broh5.lib.interactions

This module links user interactions to the responses of the Broh5 software.

class broh5.lib.interactions.GuiInteraction[source]

A subclass of GuiRendering that provides specific functionalities for interacting with the GUI elements in Broh5.

This class handles user actions such as file selection, branch/leaf selection in an HDF tree, image saving, or data display; resets and updates the GUI in response to these interactions.

current_state

Current state of the GUI: file path, HDF key, slider values, …

Type:

tuple or None

columns

Columns for displaying data in a table.

Type:

list or None

rows

Rows for displaying data in a table.

Type:

list or None

image

Current slice from a 3D dataset.

Type:

np.ndarray or None

current_slice

Information about the current slice being displayed.

Type:

tuple or None

data_1d_2d

Current 1D or 2D data being displayed.

Type:

np.ndarray or None

timer

To update the GUI in regular intervals.

Type:

UI object

mouse_handler(MouseEventArguments)[source]

Display the image ROI or intensity profile when clicking on the image.

show_key(ValueChangeEventArguments, str)[source]

Display the key of the HDF dataset/group when a tree node is clicked.

pick_file()[source]

Open a file picker dialog to select a file.

display_hdf_tree(str)[source]

Display the HDF file structure as an interactive tree.

disable_sliders()[source]

Disable and reset the sliders for 3D-data slicing.

enable_ui_elements_3d_data()[source]

Enable UI elements specific to 3D-data display.

enable_ui_elements_1d_2d_data()[source]

Enable UI elements specific to 1D/2D data display.

reset(keep_display=False)[source]

Reset the UI elements to their initial states.

reset_min_max()[source]

Reset the minimum and maximum sliders for image contrast.

display_3d_data(data_obj)[source]

Display a slice of a 3D dataset as an image.

display_1d_2d_data(data_obj, "plot")[source]

Display 1D/2D data as a plot or table.

show_data()[source]

Display data from an HDF file based on the current GUI state.

save_image()[source]

Save the currently displayed image to a file.

save_data()[source]

Save the currently displayed 1D/2D data to a file.

shutdown()[source]

Routine to close the app.

mouse_handler(e: nicegui.events.MouseEventArguments)[source]

Show the zoomed area around the mouse-clicked location or the intensity profile across the clicked location.