3.1.1. broh5.lib.rendering
- class broh5.lib.rendering.GuiRendering[source]
Bases:
objectA class to build the graphical user interface for an HDF viewer.
This class creates various UI elements like headers, buttons, sliders, tables, and plots to facilitate user interaction with HDF data.
- fig_size
Dimensions for the figure in the UI.
- Type:
tuple
- plot_size
Dimensions for the histogram plot in the UI.
- Type:
tuple
- tree_container
Container for the HDF tree structure.
- Type:
UI column
- select_file_button
Button to trigger file selection.
- Type:
UI button
- file_path_display
Label to display selected file path.
- Type:
UI label
- hdf_key_display
Label to display HDF key.
- Type:
UI label
- hdf_value_display
Label to display HDF value.
- Type:
UI label
- axis_list
Dropdown to select axis for slicing.
- Type:
UI select
- cmap_list
Dropdown to select color map for plots.
- Type:
UI select
- enable_zoom
Check-box to enable/disable image zoom.
- Type:
UI checkbox
- zoom_list
Dropdown to select zooming ratio.
- Type:
UI select
- enable_profile
Check-box to enable/disable the intensity-profile plot
- Type:
UI checkbox
- profile_list
Dropdown to select the direction of the intensity profile.
- Type:
UI select
- save_image_button
Button to save current image.
- Type:
UI button
- display_type
Dropdown to choose the display type (plot or table).
- Type:
UI select
- marker_list
Dropdown to select marker type for plots.
- Type:
UI select
- save_data_button
Button to save current data.
- Type:
UI button
- main_slider
Slider to navigate through slices of 3D data.
- Type:
UI slider
- main_table
Table to display data in tabular form.
- Type:
UI table
- main_plot
Matplotlib element to display plots.
- Type:
UI matplotlib
- zoom_profile_plot
Pyplot element to display zooming of an image or intensity-profile.
- Type:
UI pyplot
- min_slider
Slider to adjust the minimum value for image contrast.
- Type:
UI slider
- max_slider
Slider to adjust the maximum value for image contrast.
- Type:
UI slider
- reset_button
Button to reset adjustments.
- Type:
UI button
- histogram_plot
Pyplot element to display histogram of an image.
- Type:
UI pyplot
- image_info_table
Table to display statistical information of an image.
- Type:
UI table
- class broh5.lib.rendering.FilePicker(*args: Any, **kwargs: Any)[source]
Bases:
dialogA dialog class for file picking in the GUI. Codes are adapted from an example of NiceGUI: https://github.com/zauberzeug/nicegui/tree/main/examples/local_file_picker
Allows users to browse and select files from the local filesystem where the application is running.
- Parameters:
directory (str) – The starting directory for the file picker.
upper_limit (str, optional) – The upper directory limit for browsing. None by default.
show_hidden_files (bool, optional) – Flag to show hidden files. False by default.
allowed_extensions (List of str, optional) – List of allowed file extensions for filtering. None by default.
- class broh5.lib.rendering.FileSaver(*args: Any, **kwargs: Any)[source]
Bases:
dialogA dialog class for saving files in the GUI.
Allows users to specify a file name and directory for saving files.
- Parameters:
directory (str) – Starting directory for the file saver.
upper_limit (str, optional) – Upper directory limit for browsing. None by default.
show_hidden_files (bool, optional) – Flag to show hidden files. False by default.
title (str, optional) – Title for the file-name input-field. ‘File name’ by default.