Panel#
The datalab.gui.panel package provides the panel objects
for signals and images.
Three types of panels are available:
datalab.gui.panel.signal.SignalPanel: Signal paneldatalab.gui.panel.image.ImagePanel: Image paneldatalab.gui.panel.macro.MacroPanel: Macro panel
Signal and Image Panels are called Data Panels and are used to display and handle signals and images in the main window of DataLab.
Data Panels rely on the datalab.gui.panel.base.ObjectProp class (managing
the object properties) and a set of modules to handle the GUI features:
datalab.gui.actionhandler: Application actions (menus, toolbars, context menu)datalab.gui.objectview: Widgets to display object (signal/image) treesdatalab.gui.plothandler: PlotPy items for representing signals and imagesdatalab.gui.processor: Processor (computation)datalab.gui.panel.roieditor: ROI editor
The Macro Panel is used to display and run macros. It relies on the
datalab.gui.macroeditor module to handle the macro edition and execution.
Base features#
- datalab.gui.panel.base.is_plot_item_serializable(item: Any) bool[source]#
Return True if plot item is serializable
- datalab.gui.panel.base.is_hdf5_file(filename: str, check_content: bool = False) bool[source]#
Return True if filename has an HDF5 extension or is an HDF5 file.
- Parameters:
filename β Path to the file to check
check_content β If True, also attempts to open the file to verify itβs a valid HDF5 file. If False, only checks the file extension.
- Returns:
True if the file is (likely) an HDF5 file, False otherwise.
- class datalab.gui.panel.base.ProcessingReport(success: bool, obj_uuid: str | None = None, message: str | None = None)[source]#
Report of processing operation
- Parameters:
success β True if processing succeeded
obj_uuid β UUID of the processed object
message β Optional message (error or info)
- class datalab.gui.panel.base.ObjectProp(panel: BaseDataPanel, objclass: SignalObj | ImageObj)[source]#
Object handling panel properties
- Parameters:
panel β parent data panel
objclass β class of the object handled by the panel (SignalObj or ImageObj)
- display_analysis_parameters(obj: SignalObj | ImageObj) bool[source]#
Set analysis parameter label.
- Parameters:
obj β Signal or Image object
- Returns:
True if analysis parameters were found and displayed, False otherwise.
- display_processing_history(obj: SignalObj | ImageObj) bool[source]#
Display processing history.
- Parameters:
obj β Signal or Image object
- Returns:
True if processing history was found and displayed, False otherwise.
- update_properties_from(obj: SignalObj | ImageObj | None = None, force_tab: Literal['creation', 'processing', 'analysis', None] | None = None) None[source]#
Update properties panel (properties, creation, processing) from object.
- Parameters:
obj β Signal or Image object
force_tab β Force a specific tab to be current
- mark_as_newly_created(obj: SignalObj | ImageObj) None[source]#
Mark object to show Creation tab on next selection.
- Parameters:
obj β Object to mark
- mark_as_freshly_processed(obj: SignalObj | ImageObj) None[source]#
Mark object to show Processing tab on next selection.
- Parameters:
obj β Object to mark
- mark_as_fresh_analysis(obj: SignalObj | ImageObj) None[source]#
Mark object to show Analysis tab on next selection.
- Parameters:
obj β Object to mark
- get_changed_properties() dict[str, Any][source]#
Get dictionary of properties that have changed from original values.
- Returns:
Dictionary mapping property names to their new values, containing only the properties that were modified by the user.
- update_original_values() None[source]#
Update the stored original values to the current dataset values.
This should be called after applying changes to reset the baseline for detecting future changes.
- setup_creation_tab(obj: SignalObj | ImageObj, set_current: bool = False) bool[source]#
Setup the Creation tab with parameter editor for interactive object creation.
- Parameters:
obj β Signal or Image object
set_current β If True, set the Creation tab as current after creation
- Returns:
True if Creation tab was set up, False otherwise
- apply_creation_parameters() None[source]#
Apply creation parameters: recreate object with updated parameters.
- setup_processing_tab(obj: SignalObj | ImageObj, reset_params: bool = True, set_current: bool = False) bool[source]#
Setup the Processing tab with parameter editor for re-processing.
- Parameters:
obj β Signal or Image object
reset_params β If True, call update_from_obj() to reset parameters from source object. If False, use parameters as stored in metadata.
set_current β If True, set the Processing tab as current after creation
- Returns:
True if Processing tab was set up, False otherwise
- apply_processing_parameters(obj: SignalObj | ImageObj | None = None, interactive: bool = True) ProcessingReport[source]#
Apply processing parameters: re-run processing with updated parameters.
- Parameters:
obj β Signal or Image object to reprocess. If None, uses the current object.
interactive β If True, show progress and error messages in the UI.
- Returns:
ProcessingReport with success status, object UUID, and optional message.
- class datalab.gui.panel.base.AbstractPanelMeta(name, bases, namespace, **kwargs)[source]#
Mixed metaclass to avoid conflicts
- class datalab.gui.panel.base.AbstractPanel(parent)[source]#
Object defining DataLab panel interface, based on a vertical QSplitter widget
A panel handle an object list (objects are signals, images, macrosβ¦). Each object must implement
datalab.gui.ObjItfinterface- serialize_object_to_hdf5(obj: ObjItf, writer: NativeH5Writer) None[source]#
Serialize object to HDF5 file
- deserialize_object_from_hdf5(reader: NativeH5Reader, name: str, reset_all: bool = False) ObjItf[source]#
Deserialize object from a HDF5 file
- Parameters:
reader β HDF5 reader
name β Object name in HDF5 file
reset_all β If True, preserve original UUIDs (workspace reload). If False, regenerate UUIDs (importing objects).
- abstract serialize_to_hdf5(writer: NativeH5Writer) None[source]#
Serialize whole panel to a HDF5 file
- class datalab.gui.panel.base.PasteMetadataParam[source]#
Paste metadata parameters
- keep_roi#
Default: True.
- keep_geometry#
Default: False.
- keep_tables#
Default: False.
- keep_other#
Default: True.
- classmethod create(keep_roi: bool, keep_geometry: bool, keep_tables: bool, keep_other: bool) datalab.gui.panel.base.PasteMetadataParam#
Returns a new instance of
PasteMetadataParamwith the fields set to the given values.- Parameters:
- Returns:
New instance of
PasteMetadataParam.
- class datalab.gui.panel.base.NonModalInfoDialog(parent: QWidget, title: str, text: str)[source]#
Non-modal information message box with selectable text.
This widget displays an information message in a message dialog box, allowing users to select and copy the text content.
- class datalab.gui.panel.base.SaveToDirectoryGUIParam[source]#
Save to directory parameters
- directory#
Default: ββ.
- basename#
Basename pattern. Python format string. See description for details. Default: β{title}β.
- help#
Default: None.
- extension#
Default: None.
- overwrite#
Overwrite existing files. Default: False.
- preview#
String, regexp:
^(?!invalid).\*. Default: None.
- classmethod create(directory: str, basename: str, help: type, extension: Any, overwrite: bool, preview: str) datalab.gui.panel.base.SaveToDirectoryGUIParam#
Returns a new instance of
SaveToDirectoryGUIParamwith the fields set to the given values.- Parameters:
directory (str) β Default: ββ.
basename (str) β Basename pattern. Python format string. See description for details. Default: β{title}β.
help (type) β Default: None.
extension (Any) β Default: None.
overwrite (bool) β Overwrite existing files. Default: False.
preview (str) β String, regexp:
^(?!invalid).\*. Default: None.
- Returns:
New instance of
SaveToDirectoryGUIParam.
- on_button_click(_item: ButtonItem, _value: None, parent: QWidget) None[source]#
Help button callback.
- get_extension_choices(_item=None, _value=None)[source]#
Return list of available extensions for choice item.
- build_filenames(objs: list[TypeObj] | None = None) list[str][source]#
Build filenames according to current parameters.
- class datalab.gui.panel.base.AddMetadataParam[source]#
Add metadata parameters
- metadata_key#
The key name for the metadata item. String, not empty, regexp:
^[a-za-z_][a-za-z0-9_]\*$. Default: βcustom_keyβ.
- value_pattern#
Python format string. See description for details. Default: β{index}β.
- help#
Default: None.
- conversion#
Default: βstringβ.
- preview#
String, regexp:
^(?!invalid).\*. Default: ββ.
- classmethod create(metadata_key: str, value_pattern: str, help: type, conversion: Any, preview: str) datalab.gui.panel.base.AddMetadataParam#
Returns a new instance of
AddMetadataParamwith the fields set to the given values.- Parameters:
metadata_key (str) β The key name for the metadata item. String, not empty, regexp:
^[a-za-z_][a-za-z0-9_]\*$. Default: βcustom_keyβ.value_pattern (str) β Python format string. See description for details. Default: β{index}β.
help (type) β Default: None.
conversion (Any) β Default: βstringβ.
preview (str) β String, regexp:
^(?!invalid).\*. Default: ββ.
- Returns:
New instance of
AddMetadataParam.
- on_help_button_click(_item: ButtonItem, _value: None, parent: QWidget) None[source]#
Help button callback.
- get_conversion_choices(_item=None, _value=None)[source]#
Return list of available conversion choices.
- class datalab.gui.panel.base.BaseDataPanel(parent: QWidget)[source]#
Object handling the item list, the selected item properties and plot
- plot_item_parameters_changed(item: CurveItem | MaskedXYImageItem | LabelItem) None[source]#
Plot items changed: update metadata of all objects from plot items
- plot_item_moved(item: LabelItem, x0: float, y0: float, x1: float, y1: float) None[source]#
Plot item moved: update metadata of all objects from plot items
- Parameters:
item β Plot item
x0 β new x0 coordinate
y0 β new y0 coordinate
x1 β new x1 coordinate
y1 β new y1 coordinate
- serialize_object_to_hdf5(obj: TypeObj, writer: NativeH5Writer) None[source]#
Serialize object to HDF5 file
- deserialize_from_hdf5(reader: NativeH5Reader, reset_all: bool = False) None[source]#
Deserialize whole panel from a HDF5 file
- Parameters:
reader β HDF5 reader
reset_all β If True, preserve original UUIDs (workspace reload). If False, regenerate UUIDs (importing objects).
- create_object() TypeObj[source]#
Create object (signal or image)
- Returns:
SignalObj or ImageObj object
- add_object(obj: TypeObj, group_id: str | None = None, set_current: bool = True) None[source]#
Add object
- Parameters:
obj β SignalObj or ImageObj object
group_id β group id to which the object belongs. If None or empty string, the object is added to the current group.
set_current β if True, set the added object as current
- refresh_plot(what: str, update_items: bool = True, force: bool = False, only_visible: bool = True, only_existing: bool = False) None[source]#
Refresh plot.
- Parameters:
what β string describing the objects to refresh. Valid values are βselectedβ (refresh the selected objects), βallβ (refresh all objects), βexistingβ (refresh existing plot items), or an object uuid.
update_items β if True, update the items. If False, only show the items (do not update them). Defaults to True.
force β if True, force refresh even if auto refresh is disabled. Defaults to False.
only_visible β if True, only refresh visible items. Defaults to True. Visible items are the ones that are not hidden by other items or the items except the first one if the option βShow first onlyβ is enabled. This is useful for images, where the last image is the one that is shown. If False, all items are refreshed.
only_existing β if True, only refresh existing items. Defaults to False. Existing items are the ones that have already been created and are associated to the object uuid. If False, create new items for the objects that do not have an item yet.
- Raises:
ValueError β if what is not a valid value
- get_category_actions(category: ActionCategory) list[QAction][source]#
Return actions for category
Update and return context menu
- add_group(title: str, select: bool = False) ObjectGroup[source]#
Add group
- Parameters:
title β group title
select β if True, select the group in the tree view. Defaults to False.
- Returns:
Created group object
- paste_metadata(param: PasteMetadataParam | None = None) None[source]#
Paste metadata to selected object(s)
- add_metadata(param: AddMetadataParam | None = None) None[source]#
Add metadata item to selected object(s)
- Parameters:
param β Add metadata parameters
- remove_object(force: bool = False) None[source]#
Remove signal/image object
- Parameters:
force β if True, remove object without confirmation. Defaults to False.
- delete_metadata(refresh_plot: bool = True, keep_roi: bool | None = None) None[source]#
Delete metadata of selected objects
- Parameters:
refresh_plot β Refresh plot. Defaults to True.
keep_roi β Keep regions of interest, if any. Defaults to None (ask user).
- add_annotations_from_items(items: list, refresh_plot: bool = True) None[source]#
Add object annotations (annotation plot items).
- Parameters:
items β annotation plot items
refresh_plot β refresh plot. Defaults to True.
- rename_selected_object_or_group(new_name: str | None = None) None[source]#
Rename selected object or group
- Parameters:
new_name β new name (default: None, i.e. ask user)
- abstract get_newparam_from_current(newparam: NewSignalParam | NewImageParam | None = None) NewSignalParam | NewImageParam | None[source]#
Get new object parameters from the current object.
- Parameters:
newparam β new object parameters. If None, create a new one.
- Returns:
New object parameters
- abstract new_object(param: NewSignalParam | NewImageParam | None = None, edit: bool = False, add_to_panel: bool = True) TypeObj | None[source]#
Create a new object (signal/image).
- Parameters:
param β new object parameters
edit β Open a dialog box to edit parameters (default: False). When False, the object is created with default parameters and creation parameters are stored in metadata for interactive editing.
add_to_panel β Add object to panel (default: True)
- Returns:
New object
- load_from_directory(directory: str | None = None) list[TypeObj][source]#
Open objects from directory (signals or images, depending on the panel), add them to DataLab and return them. If the directory is not specified, ask the user to select a directory.
- Parameters:
directory β directory name
- Returns:
list of new objects
- load_from_files(filenames: list[str] | None = None, create_group: bool = False, add_objects: bool = True, ignore_errors: bool = False) list[TypeObj][source]#
Open objects from file (signals/images), add them to DataLab and return them.
- Parameters:
filenames β File names
create_group β if True, create a new group if more than one object is loaded for a single file. Defaults to False: all objects are added to the current group.
add_objects β if True, add objects to the panel. Defaults to True.
ignore_errors β if True, ignore errors when loading files. Defaults to False.
- Returns:
list of new objects
- save_to_files(filenames: list[str] | str | None = None) None[source]#
Save selected objects to files (signal/image).
- Parameters:
filenames β File names
- save_to_directory(param: SaveToDirectoryParam | None = None) None[source]#
Save signals or images to directory using a filename pattern.
Opens a dialog to select the output directory, the basename pattern and the extension.
- Parameters:
param β parameters.
- handle_dropped_files(filenames: list[str] | None = None) None[source]#
Handle dropped files
- Parameters:
filenames β File names
- Returns:
None
- import_metadata_from_file(filename: str | None = None) None[source]#
Import metadata from file (JSON).
- Parameters:
filename β File name
- export_metadata_from_file(filename: str | None = None) None[source]#
Export metadata to file (JSON).
- Parameters:
filename β File name
- import_annotations_from_file(filename: str | None = None) None[source]#
Import annotations from file (JSON).
- Parameters:
filename β File name
- export_annotations_from_file(filename: str | None = None) None[source]#
Export annotations to file (JSON).
- Parameters:
filename β File name
- import_roi_from_file(filename: str | None = None) None[source]#
Import regions of interest from file (JSON).
- Parameters:
filename β File name
- export_roi_to_file(filename: str | None = None) None[source]#
Export regions of interest to file (JSON).
- Parameters:
filename β File name
- selection_changed(update_items: bool = False) None[source]#
Object selection changed: update object properties, refresh plot and update object view.
- Parameters:
update_items β Update plot items (default: False)
- properties_changed() None[source]#
The properties βApplyβ button was clicked: update object properties, refresh plot and update object view.
- recompute_processing() None[source]#
Recompute/rerun selected objects or group with stored processing parameters.
This method handles both single objects and groups. For each object, it checks if it has 1-to-1 processing parameters that can be recomputed. Objects without recomputable parameters are skipped.
- select_source_objects() None[source]#
Select source objects associated with the selected objectβs processing.
This method retrieves the source object UUIDs from the selected objectβs processing parameters and selects them in the object view.
- add_plot_items_to_dialog(dlg: PlotDialog, oids: list[str]) None[source]#
Add plot items to dialog
- Parameters:
dlg β Dialog
oids β Object IDs
- open_separate_view(oids: list[str] | None = None, edit_annotations: bool = False) PlotDialog | None[source]#
Open separate view for visualizing selected objects
- Parameters:
oids β Object IDs (default: None)
edit_annotations β Edit annotations (default: False)
- Returns:
Instance of PlotDialog
- view_images_side_by_side(oids: list[str] | None = None) None[source]#
View selected images side-by-side in a grid layout
- Parameters:
oids β Object IDs (default: None, uses selected objects)
- create_new_dialog(edit: bool = False, toolbar: bool = True, title: str | None = None, name: str | None = None, options: dict[str, Any] | None = None) PlotDialog | None[source]#
Create new pop-up signal/image plot dialog.
- Parameters:
edit β Edit mode
toolbar β Show toolbar
title β Dialog title
name β Dialog object name
options β Plot options
- Returns:
Plot dialog instance
- get_roi_editor_output(mode: Literal['apply', 'extract', 'define'] = 'apply') tuple[TypeROI, bool] | None[source]#
Get ROI data (array) from specific dialog box.
- Parameters:
mode β Mode of operation, either βapplyβ (define ROI, then apply it to selected objects), βextractβ (define ROI, then extract data from it), or βdefineβ (define ROI without applying or extracting).
- Returns:
A tuple containing the ROI object and a boolean indicating whether the dialog was accepted or not.
- get_objects_with_dialog(title: str, comment: str = '', nb_objects: int = 1, parent: QW.QWidget | None = None) TypeObj | None[source]#
Get object with dialog box.
- Parameters:
title β Dialog title
comment β Optional dialog comment
nb_objects β Number of objects to select
parent β Parent widget
- Returns:
Object(s) (signal(s) or image(s), or None if dialog was canceled)
- toggle_result_label_visibility(state: bool) None[source]#
Toggle the visibility of the merged result label on the plot.
- Parameters:
state β True to show the label, False to hide it
- plot_results(kind: str | None = None, xaxis: str | None = None, yaxis: str | None = None) None[source]#
Plot results
- Parameters:
kind β Plot kind. Either βone_curve_per_objectβ or βone_curve_per_titleβ. If None, show dialog to get parameters.
xaxis β X axis column name. If None, show dialog to get parameters.
yaxis β Y axis column name. If None, show dialog to get parameters.
- add_label_with_title(title: str | None = None, ignore_msg: bool = True) None[source]#
Add a label with object title on the associated plot
- Parameters:
title β Label title. Defaults to None. If None, the title is the object title.
ignore_msg β If True, do not show the information message. Defaults to True. If False, show a message box to inform the user that the label has been added as an annotation, and that it can be edited or removed using the annotation editing window.
Signal panel#
- class datalab.gui.panel.signal.SignalPanel(parent: QW.QWidget, dockableplotwidget: DockablePlotWidget, panel_toolbar: QW.QToolBar)[source]#
Object handling the item list, the selected item properties and plot, specialized for Signal objects
- PARAMCLASS#
Signal object
- title#
Signal title. Default: βUntitledβ.
- xydata#
Default: None.
- metadata#
Default: {}.
- annotations#
Default: ββ.
- xlabel#
Title. Default: ββ.
- xunit#
Default: ββ.
- ylabel#
Title. Default: ββ.
- yunit#
Default: ββ.
- autoscale#
Default: True.
- xscalelog#
Default: False.
- xscalemin#
Lower bound. Default: None.
- xscalemax#
Upper bound. Default: None.
- yscalelog#
Default: False.
- yscalemin#
Lower bound. Default: None.
- yscalemax#
Upper bound. Default: None.
alias of
SignalObj
- classmethod PARAMCLASS.create(title: str, xydata: numpy.ndarray, metadata: dict, annotations: str, xlabel: str, xunit: str, ylabel: str, yunit: str, autoscale: bool, xscalelog: bool, xscalemin: float, xscalemax: float, yscalelog: bool, yscalemin: float, yscalemax: float) sigima.objects.signal.object.SignalObj#
Returns a new instance of
SignalObjwith the fields set to the given values.- Parameters:
title (str) β Signal title. Default: βUntitledβ.
xydata (numpy.ndarray) β Default: None.
metadata (dict) β Default: {}.
annotations (str) β Default: ββ.
xlabel (str) β Title. Default: ββ.
xunit (str) β Default: ββ.
ylabel (str) β Title. Default: ββ.
yunit (str) β Default: ββ.
autoscale (bool) β Default: True.
xscalelog (bool) β Default: False.
xscalemin (float) β Lower bound. Default: None.
xscalemax (float) β Upper bound. Default: None.
yscalelog (bool) β Default: False.
yscalemin (float) β Lower bound. Default: None.
yscalemax (float) β Upper bound. Default: None.
- Returns:
New instance of
SignalObj.
- IO_REGISTRY#
alias of
SignalIORegistry
- static get_roieditor_class() Type[SignalROIEditor][source]#
Return ROI editor class
- get_newparam_from_current(newparam: NewSignalParam | None = None, title: str | None = None) NewSignalParam | None[source]#
Get new object parameters from the current object.
- Parameters:
newparam (guidata.dataset.DataSet) β new object parameters. If None, create a new one.
title β new object title. If None, use the current object title, or the default title.
- Returns:
New object parameters
- new_object(param: NewSignalParam | None = None, edit: bool = False, add_to_panel: bool = True) SignalObj | None[source]#
Create a new object (signal).
- Parameters:
param (guidata.dataset.DataSet) β new object parameters
edit (bool) β Open a dialog box to edit parameters (default: False). When False, the object is created with default parameters and creation parameters are stored in metadata for interactive editing.
add_to_panel (bool) β Add the new object to the panel (default: True)
- Returns:
New object
Image panel#
- class datalab.gui.panel.image.ImagePanel(parent: QW.QWidget, dockableplotwidget: DockablePlotWidget, panel_toolbar: QW.QToolBar)[source]#
Object handling the item list, the selected item properties and plot, specialized for Image objects
- PARAMCLASS#
Image object
- data#
Default: None.
- metadata#
Default: {}.
- annotations#
Default: ββ.
- is_uniform_coords#
Default: True.
- x0#
X0. Default: 0.0.
- y0#
Y0. Default: 0.0.
- dx#
Ξx. Default: 1.0.
- dy#
Ξy. Default: 1.0.
- xmin#
XMIN. Default: None.
- xmax#
XMAX. Default: None.
- ymin#
YMIN. Default: None.
- ymax#
YMAX. Default: None.
- xcoords#
X coordinates. Default: array([], dtype=float64).
- ycoords#
Y coordinates. Default: array([], dtype=float64).
- title#
Image title. Default: βUntitledβ.
- xlabel#
Title. Default: ββ.
- xunit#
Default: ββ.
- ylabel#
Title. Default: ββ.
- yunit#
Default: ββ.
- zlabel#
Title. Default: ββ.
- zunit#
Default: ββ.
- autoscale#
Default: True.
- xscalelog#
Default: False.
- xscalemin#
Lower bound. Default: None.
- xscalemax#
Upper bound. Default: None.
- yscalelog#
Default: False.
- yscalemin#
Lower bound. Default: None.
- yscalemax#
Upper bound. Default: None.
- zscalemin#
Lower bound. Default: None.
- zscalemax#
Upper bound. Default: None.
alias of
ImageObj
- classmethod PARAMCLASS.create(data: numpy.ndarray, metadata: dict, annotations: str, is_uniform_coords: bool, x0: float, y0: float, dx: float, dy: float, xmin: float, xmax: float, ymin: float, ymax: float, xcoords: numpy.ndarray, ycoords: numpy.ndarray, title: str, xlabel: str, xunit: str, ylabel: str, yunit: str, zlabel: str, zunit: str, autoscale: bool, xscalelog: bool, xscalemin: float, xscalemax: float, yscalelog: bool, yscalemin: float, yscalemax: float, zscalemin: float, zscalemax: float) sigima.objects.image.object.ImageObj#
Returns a new instance of
ImageObjwith the fields set to the given values.- Parameters:
data (numpy.ndarray) β Default: None.
metadata (dict) β Default: {}.
annotations (str) β Default: ββ.
is_uniform_coords (bool) β Default: True.
x0 (float) β X0. Default: 0.0.
y0 (float) β Y0. Default: 0.0.
dx (float) β Ξx. Default: 1.0.
dy (float) β Ξy. Default: 1.0.
xmin (float) β XMIN. Default: None.
xmax (float) β XMAX. Default: None.
ymin (float) β YMIN. Default: None.
ymax (float) β YMAX. Default: None.
xcoords (numpy.ndarray) β X coordinates. Default: array([], dtype=float64).
ycoords (numpy.ndarray) β Y coordinates. Default: array([], dtype=float64).
title (str) β Image title. Default: βUntitledβ.
xlabel (str) β Title. Default: ββ.
xunit (str) β Default: ββ.
ylabel (str) β Title. Default: ββ.
yunit (str) β Default: ββ.
zlabel (str) β Title. Default: ββ.
zunit (str) β Default: ββ.
autoscale (bool) β Default: True.
xscalelog (bool) β Default: False.
xscalemin (float) β Lower bound. Default: None.
xscalemax (float) β Upper bound. Default: None.
yscalelog (bool) β Default: False.
yscalemin (float) β Lower bound. Default: None.
yscalemax (float) β Upper bound. Default: None.
zscalemin (float) β Lower bound. Default: None.
zscalemax (float) β Upper bound. Default: None.
- Returns:
New instance of
ImageObj.
- IO_REGISTRY#
alias of
ImageIORegistry
- static get_roieditor_class() Type[ImageROIEditor][source]#
Return ROI editor class
- plot_lut_changed(plot: BasePlot) None[source]#
The LUT of the plot has changed: updating image objects accordingly
- Parameters:
plot β Plot object
- get_newparam_from_current(newparam: NewImageParam | None = None, title: str | None = None) NewImageParam | None[source]#
Get new object parameters from the current object.
- Parameters:
newparam (guidata.dataset.DataSet) β new object parameters. If None, create a new one.
title β new object title. If None, use the current object title, or the default title.
- Returns:
New object parameters
- new_object(param: NewImageParam | None = None, edit: bool = False, add_to_panel: bool = True) ImageObj | None[source]#
Create a new object (image).
- Parameters:
param (guidata.dataset.DataSet) β new object parameters
edit (bool) β Open a dialog box to edit parameters (default: False). When False, the object is created with default parameters and creation parameters are stored in metadata for interactive editing.
add_to_panel (bool) β Add the object to the panel (default: True)
- Returns:
New object
Macro panel#
- class datalab.gui.panel.macro.MacroTabs(parent=None)[source]#
Macro tabwidget
- Parameters:
parent (QWidget) β Parent widget
- add_tab(macro: Macro) int[source]#
Add tab
- Parameters:
macro β Macro object
- Returns:
Number of the tab (starting at 1)
- Return type:
- remove_tab(number: int) None[source]#
Remove tab
- Parameters:
number β Number of the tab (starting at 1)
- get_widget(number: int) CodeEditor[source]#
Return macro editor widget at number
- Parameters:
number β Number of the tab (starting at 1)
- Returns:
Macro editor widget
- set_current_number(number: int) None[source]#
Set current tab number
- Parameters:
number β Number of the tab (starting at 1)
- class datalab.gui.panel.macro.MacroPanel(parent: QMainWindow)[source]#
Macro Panel widget
- Parameters:
parent (QWidget) β Parent widget
- serialize_to_hdf5(writer: NativeH5Writer) None[source]#
Serialize whole panel to a HDF5 file
- Parameters:
writer β HDF5 writer
- deserialize_from_hdf5(reader: NativeH5Reader, reset_all: bool = False) None[source]#
Deserialize whole panel from a HDF5 file
- Parameters:
reader β HDF5 reader
reset_all β If True, preserve original UUIDs (workspace reload). If False, regenerate UUIDs (importing objects).
- get_macro(number_or_title: int | str | None = None) Macro | None[source]#
Return macro at number (if number is None, return current macro)
- Parameters:
number β Number of the macro (starting at 1) or title of the macro. Defaults to None (current macro).
- Returns:
Macro object or None (if not found)
- get_number_from_title(title: str) int | None[source]#
Return macro number from title
- Parameters:
title β Title of the macro
- Returns:
Number of the macro (starting at 1) or None (if not found)
- get_number_from_macro(macro: Macro) int | None[source]#
Return macro number from macro object
- Parameters:
macro β Macro object
- Returns:
Number of the macro (starting at 1) or None (if not found)
- run_macro(number_or_title: int | str | None = None) None[source]#
Run current macro
- Parameters:
number β Number of the macro (starting at 1). Defaults to None (run current macro, or does nothing if there is no macro).
- stop_macro(number_or_title: int | str | None = None) None[source]#
Stop current macro
- Parameters:
number β Number of the macro (starting at 1). Defaults to None (run current macro, or does nothing if there is no macro).
- macro_state_changed(orig_macro: Macro, state: bool) None[source]#
Macro state has changed (True: started, False: stopped)
- Parameters:
orig_macro β Macro object
state β State of the macro
- macro_name_changed(name: str) None[source]#
Macro name has been changed
- Parameters:
name β New name of the macro
- rename_macro(number: int | None = None, title: str | None = None) None[source]#
Rename macro
- Parameters:
number β Number of the macro (starting at 1). Defaults to None.
title β Title of the macro. Defaults to None.
- export_macro_to_file(number_or_title: int | str | None = None, filename: str | None = None) None[source]#
Export macro to file
- Parameters:
number_or_title β Number of the macro (starting at 1) or title of the macro. Defaults to None.
filename β Filename. Defaults to None.
- Raises:
ValueError β If title is not found