8.3.4. Data Viewers

The data viewers are classes devoted to data display from scalar data up to 4 dimensions data. All the viewers inherits from the base class ViewerBase and then offers options and interactions depending their dimensionality

Summary of the data viewers classes

pymodaq_gui.plotting.data_viewers.base.ViewerBase([...])

Base Class for data viewers implementing all common functionalities

pymodaq_gui.plotting.data_viewers.viewer0D.Viewer0D([...])

this plots 0D data on a plotwidget with history.

pymodaq_gui.plotting.data_viewers.viewer1D.Viewer1D([...])

DataWithAxis of type Data1D can be plotted using this data viewer

pymodaq_gui.plotting.data_viewers.viewer2D.Viewer2D([...])

Object managing plotting and manipulation of 2D data using a View2D

pymodaq_gui.plotting.data_viewers.viewerND.ViewerND([...])

class pymodaq_gui.plotting.data_viewers.base.ViewerBase(parent=None, title='')[source]

Base Class for data viewers implementing all common functionalities

Parameters:
  • parent (QWidget)

  • title (str)

view

Ui interface of the viewer

Type:

QObject

data_to_export_signal
Type:

pyqtSignal

ROI_changed
Type:

pyqtSignal

crosshair_dragged
Type:

pyqtSignal, float]

crosshair_clicked
Type:

pyqtSignal

sig_double_clicked
Type:

pyqtSignal, float]

status_signal
Type:

pyqtSignal

Attributes:
get_action

Convenience method

has_action

Convenience method

is_action_checked

Convenience method

is_action_visible

Convenience method

roi_target

To be implemented if necessary (Viewer1D and above)

set_action_checked

Convenience method

set_action_visible

Convenience method

toolbar

Convenience property

viewer_type

str: the viewer data type see DATA_TYPES

Methods

activate_roi([activate])

Activate the Roi manager using the corresponding action

add_attributes_from_view()

Convenience function to add attributes from the view to self

move_roi_target([pos])

move a specific read only ROI at the given position on the viewer

setVisible([show])

convenience method to show or hide the parent widget

show_data(data, **kwargs)

Entrypoint to display data into the viewer

show_data_temp(data, **kwargs)

Entrypoint to display temporary data into the viewer

show_roi_target([show])

Show/Hide a specific read only ROI

trigger_action(action_name)

Convenience function to trigger programmatically one of the action of the related view

ROI_changed

ROI_select_signal

crosshair_clicked

crosshair_dragged

data_to_export_signal

roi_select_signal

sig_double_clicked

status_signal

activate_roi(activate=True)[source]

Activate the Roi manager using the corresponding action

add_attributes_from_view()[source]

Convenience function to add attributes from the view to self

move_roi_target(pos=None, **kwargs)[source]

move a specific read only ROI at the given position on the viewer

setVisible(show=True)[source]

convenience method to show or hide the parent widget

show_data(data, **kwargs)[source]

Entrypoint to display data into the viewer

Parameters:

data (DataWithAxes)

show_data_temp(data, **kwargs)[source]

Entrypoint to display temporary data into the viewer

No processed data signal is emitted from the viewer

Parameters:

data (DataWithAxes)

show_roi_target(show=True)[source]

Show/Hide a specific read only ROI

trigger_action(action_name)[source]

Convenience function to trigger programmatically one of the action of the related view

property get_action

Convenience method

property has_action

Convenience method

property is_action_checked

Convenience method

property is_action_visible

Convenience method

property roi_target: InfiniteLine | ROI

To be implemented if necessary (Viewer1D and above)

property set_action_checked

Convenience method

property set_action_visible

Convenience method

property toolbar

Convenience property

property viewer_type

the viewer data type see DATA_TYPES

Type:

str

class pymodaq_gui.plotting.data_viewers.viewer0D.Viewer0D(parent=None, title='', show_toolbar=True, no_margins=False)[source]

this plots 0D data on a plotwidget with history. Display as numbers in a table is possible.

Datas and measurements are then exported with the signal data_to_export_signal

Attributes:
labels

Methods

update_colors

class pymodaq_gui.plotting.data_viewers.viewer1D.Viewer1D(parent=None, title='', show_toolbar=True, no_margins=False, flip_axes=False)[source]

DataWithAxis of type Data1D can be plotted using this data viewer

show_data:

parameter: * dwa: a DataWithaxis * scatter_dwa: an optional extra DataWithAxis to be plotted with scatter points

it could define extra_attributes such as symbol: str (to define the symbol layout default: ‘o’) and symbol_size: int (to define the symbol size)

Attributes:
crosshair

Convenience method

labels
roi_manager

Convenience method

roi_target

To be implemented if necessary (Viewer1D and above)

Methods

activate_roi([activate])

move_roi_target([pos])

move a specific read only ROI at the given position on the viewer

set_crosshair_position(xpos[, ypos])

Convenience method to set the crosshair positions

add_plot_item

crosshair_changed

double_clicked

get_axis_from_view

prepare_connect_ui

process_crosshair_lineouts

process_roi_lineouts

roi_changed

selected_region_changed

update_colors

update_status

move_roi_target(pos=None)[source]

move a specific read only ROI at the given position on the viewer

set_crosshair_position(xpos, ypos=0)[source]

Convenience method to set the crosshair positions

property crosshair

Convenience method

property roi_manager

Convenience method

class pymodaq_gui.plotting.data_viewers.viewer2D.Viewer2D(parent=None, title='')[source]

Object managing plotting and manipulation of 2D data using a View2D

Attributes:
crosshair

Convenience method

image_widget

Convenience method

roi_manager

Convenience method

roi_target

To be implemented if necessary (Viewer1D and above)

x_axis
y_axis

Methods

activate_roi([activate])

Activate the Roi manager using the corresponding action

get_axes_from_view(data)

Obtain axes info from the view

get_data_at()

Convenience method

move_roi_target([pos, size])

move a specific read only ROI at the given position on the viewer

set_crosshair_position(xpos, ypos)

Convenience method to set the crosshair positions

set_gradient(image_key, gradient)

convenience function

set_image_transform()

Deactivate some tool buttons if data type is "spread" then apply transform_image

show_roi([show, show_roi_widget])

convenience function to control roi

autolevels_first

crosshair_changed

double_clicked

prepare_connect_ui

process_crosshair_lineouts

process_roi_lineouts

roi_changed

selected_region_changed

set_visible_items

transform_image

update_crosshair_data

update_data

activate_roi(activate=True)[source]

Activate the Roi manager using the corresponding action

get_axes_from_view(data)[source]

Obtain axes info from the view

Only for uniform data

get_data_at()[source]

Convenience method

move_roi_target(pos=None, size=(1, 1))[source]

move a specific read only ROI at the given position on the viewer

set_crosshair_position(xpos, ypos)[source]

Convenience method to set the crosshair positions

set_gradient(image_key, gradient)[source]

convenience function

set_image_transform()[source]

Deactivate some tool buttons if data type is “spread” then apply transform_image

Return type:

DataRaw

show_roi(show=True, show_roi_widget=True)[source]

convenience function to control roi

property crosshair

Convenience method

property image_widget

Convenience method

property roi_manager

Convenience method

class pymodaq_gui.plotting.data_viewers.viewerND.ViewerND(parent=None, title='')[source]

Methods

setup_actions()

connect_things

prepare_ui

reshape_data

set_data_test

setup_widgets

show_settings

update_data_dim

update_data_displayer

update_filters

update_widget_visibility