Plot handler#

The cdl.core.gui.plothandler module provides plot handlers for signal and image panels, that is, classes handling PlotPy plot items for representing signals and images.

Signal plot handler#

class cdl.core.gui.plothandler.SignalPlotHandler(panel: BaseDataPanel, plotwidget: PlotWidget)#

Object handling signal plot items, plot dialogs, plot options

toggle_anti_aliasing(state: bool) None#

Toggle anti-aliasing

Parameters:

state – if True, enable anti-aliasing

get_current_plot_options() PlotOptions#

Return standard signal/image plot options

add_shapes(oid: str, do_autoscale: bool = False) None#

Add geometric shape items associated to computed results and annotations, for the object with the given uuid

cleanup_dataview() None#

Clean up data view

clear() None#

Clear plot items

get(key: str, default: CurveItem | MaskedImageItem | None = None) CurveItem | MaskedImageItem | None#

Return item associated to object uuid. If the key is not found, default is returned if given, otherwise None is returned.

get_obj_from_item(item: CurveItem | MaskedImageItem) SignalObj | ImageObj | None#

Return object associated to plot item

Parameters:

item – plot item

Returns:

Object associated to plot item

refresh_plot(what: str, update_items: bool = True, force: bool = False) None#

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, except if the option “Use reference item LUT range” is enabled and more than one item is selected). Defaults to True.

  • force – if True, force refresh even if auto refresh is disabled.

Raises:

ValueError – if what is not a valid value

remove_all_shape_items() None#

Remove all geometric shapes associated to result items

remove_item(oid: str) None#

Remove plot item associated to object uuid

set_auto_refresh(auto_refresh: bool) None#

Set auto refresh mode.

Parameters:

auto_refresh – if True, refresh plot items automatically

set_show_first_only(show_first_only: bool) None#

Set show first only mode.

Parameters:

show_first_only – if True, show only the first selected item

static update_item_according_to_ref_item(item: MaskedImageItem, ref_item: MaskedImageItem) None#

Update plot item according to reference item

update_resultproperty_from_plot_item(item: LabelItem) None#

Update result property from plot item

Image plot handler#

class cdl.core.gui.plothandler.ImagePlotHandler(panel: BaseDataPanel, plotwidget: PlotWidget)#

Object handling image plot items, plot dialogs, plot options

static update_item_according_to_ref_item(item: MaskedImageItem, ref_item: MaskedImageItem) None#

Update plot item according to reference item

refresh_plot(what: str, update_items: bool = True, force: bool = False) None#

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, except if the option “Use reference item LUT range” is enabled and more than one item is selected). Defaults to True.

  • force – if True, force refresh even if auto refresh is disabled.

Raises:

ValueError – if what is not a valid value

cleanup_dataview() None#

Clean up data view

get_current_plot_options() PlotOptions#

Return standard signal/image plot options

add_shapes(oid: str, do_autoscale: bool = False) None#

Add geometric shape items associated to computed results and annotations, for the object with the given uuid

clear() None#

Clear plot items

get(key: str, default: CurveItem | MaskedImageItem | None = None) CurveItem | MaskedImageItem | None#

Return item associated to object uuid. If the key is not found, default is returned if given, otherwise None is returned.

get_obj_from_item(item: CurveItem | MaskedImageItem) SignalObj | ImageObj | None#

Return object associated to plot item

Parameters:

item – plot item

Returns:

Object associated to plot item

remove_all_shape_items() None#

Remove all geometric shapes associated to result items

remove_item(oid: str) None#

Remove plot item associated to object uuid

set_auto_refresh(auto_refresh: bool) None#

Set auto refresh mode.

Parameters:

auto_refresh – if True, refresh plot items automatically

set_show_first_only(show_first_only: bool) None#

Set show first only mode.

Parameters:

show_first_only – if True, show only the first selected item

update_resultproperty_from_plot_item(item: LabelItem) None#

Update result property from plot item