8.6.6.1.6. pymodaq_gui.plotting.data_viewers.viewer2D module

class pymodaq_gui.plotting.data_viewers.viewer2D.Histogrammer(histogram_container, histogram_refs=['red', 'green', 'blue'])[source]

Bases: QObject

Attributes:
autolevels

Methods

set_gradient([histo, gradient])

Change the color gradient of the specified histogram :type histo: (str) either 'red', 'green', 'blue', 'spread' or 'all' :param histo: :type histo: (str) either 'red', 'green', 'blue', 'spread' or 'all' :type gradient: (str or Gradient) :param gradient: :type gradient: (str or Gradient)

activated

add_histogram

affect_histo_to_imageitems

get_histogram

get_histograms

gradient_changed

set_autolevels

setup_histograms

show_hide_histogram

activated(histo_action_checked)[source]
add_histogram(histogram)[source]
affect_histo_to_imageitems(image_items)[source]
get_histogram(name)[source]
get_histograms()[source]
set_autolevels(isautolevels=True)[source]
set_gradient(histo='red', gradient='grey')[source]

Change the color gradient of the specified histogram :type histo: (str) either 'red', 'green', 'blue', 'spread' or 'all' :param histo: :type histo: (str) either 'red', 'green', 'blue', 'spread' or 'all' :type gradient: (str or Gradient) :param gradient: :type gradient: (str or Gradient)

setup_histograms()[source]
show_hide_histogram(checked, are_items_visible)[source]
property autolevels
gradient_changed
staticMetaObject = PySide6.QtCore.QMetaObject("Histogrammer" inherits "QObject": Methods:   #4 type=Signal, signature=gradient_changed()   #5 type=Slot, signature=set_autolevels(bool), parameters=bool   #6 type=Slot, signature=activated(bool), parameters=bool )
class pymodaq_gui.plotting.data_viewers.viewer2D.ImageDisplayer(plotitem, data_distribution)[source]

Bases: QObject

This Object deals with the display of 2D data with a plotitem

Attributes:
autolevels
labels
legend
levels_sym

Methods

get_image

get_images

set_autolevels

set_composition

set_levels_sym

show_legend

update_data

update_display_items

update_image_visibility

updated_item

get_image(name)[source]
get_images()[source]
set_autolevels(isautolevel)[source]
set_composition(images=None)[source]
set_levels_sym(levels_sym)[source]
show_legend(show=True)[source]
update_data(dwa)[source]
update_display_items(labels=None)[source]
update_image_visibility(are_items_visible)[source]
property autolevels
property labels
property legend
property levels_sym: bool
staticMetaObject = PySide6.QtCore.QMetaObject("ImageDisplayer" inherits "QObject": Methods:   #4 type=Signal, signature=updated_item(QVariantMap), parameters=QVariantMap )
updated_item
class pymodaq_gui.plotting.data_viewers.viewer2D.IsoCurver(image_source, histogram_parent)[source]

Bases: QObject

Methods

set_isocurve_data

setup_iso_curve

show_hide_iso

update_histogram_parent

update_image_source

update_isocurve

set_isocurve_data(data)[source]
setup_iso_curve(parent_image_item='red')[source]
show_hide_iso(show=True)[source]
update_histogram_parent(histogram)[source]
update_image_source(image_source)[source]
update_isocurve()[source]
staticMetaObject = PySide6.QtCore.QMetaObject("IsoCurver" inherits "QObject": Methods:   #4 type=Slot, signature=show_hide_iso(bool), parameters=bool )
class pymodaq_gui.plotting.data_viewers.viewer2D.View2D(parent_widget=None, title='', rois_dock=None)[source]

Bases: ActionManager, QObject

Attributes:
plotitem
title

Methods

get_crosshair_position()

Convenience function from the Crosshair

get_crosshair_signal()

Convenience function from the Crosshair

move_scale_roi_target([pos, size])

Move and scale the target ROI (used to display a particular area, for instance the currently scanned points during a scan :type pos: (iterable) setting the central position of the ROI in the view :param pos: :type pos: (iterable) setting the central position of the ROI in the view :type size: (iterable) setting the size of the ROI :param size: :type size: (iterable) setting the size of the ROI

scale_axis(xaxis, yaxis)

scale view coordinates from the regular axes to the scaled/offset ones

set_axis_label(position[, label, units])

Convenience method to set label and unit of any view axes :type position: (str) any of AXIS_POSITIONS :param position: :type position: (str) any of AXIS_POSITIONS :type label: (str) text of the axis label :param label: :type label: (str) text of the axis label :type units: (str) units of the axis label :param units: :type units: (str) units of the axis label

set_axis_scaling([position, scaling, ...])

Method used to update the scaling of the right and top axes in order to translate indices to real coordinates :type position: (str) axis position either one of AXIS_POSITIONS :param position: :type position: (str) axis position either one of AXIS_POSITIONS :type scaling: (float) scaling of the axis :param scaling: :type scaling: (float) scaling of the axis :type offset: (float) offset of the axis :param offset: :type offset: (float) offset of the axis :type label: (str) text of the axis label :param label: :type label: (str) text of the axis label :type units: (str) units of the axis label :param units: :type units: (str) units of the axis label

set_crosshair_position(*positions)

Convenience function from the Crosshair

setup_actions()

setup_view_box()

create and axis-sync a viewbox for the top and right axes, and add the ROIselect

unscale_axis(xaxis, yaxis)

scale view coordinates from the scaled/offset axes to the regular ones

update_roi_channels(roi_index)

Update the use_channel setting each time a ROI is added

add_roi_displayer

clear_plot_item

collapse_lineout_widgets

connect_things

display_crosshair_lineouts

display_images

display_roi_lineouts

get_axis

get_axis_label

get_data_at

get_double_clicked

get_image_item

get_theme

get_view_range

get_visible_images

link_lineouts

lock_aspect_ratio

move_left_splitter

move_right_splitter

move_scale_roi

notify_visibility_data_displayer

prepare_image_widget_for_lineouts

prepare_ui

remove_roi_displayer

roi_clicked

set_image_displayer

set_image_labels

set_transform

setup_graphs

setup_lineouts

setup_widgets

show_ROI_select

show_hide_crosshair

show_hide_histogram

show_hide_link_lineouts

show_legend

show_lineout_widgets

show_roi_target

update_colors

update_view_box

static get_theme(name=None)[source]
Return type:

Theme

add_roi_displayer(roi_index)[source]
clear_plot_item()[source]
collapse_lineout_widgets()[source]
connect_things()[source]
display_crosshair_lineouts(crosshair_dte)[source]
display_images(datas)[source]
display_roi_lineouts(roi_dte)[source]
get_axis(position='left')[source]
Return type:

AxisItemScaled

get_axis_label(position)[source]
get_crosshair_position()[source]

Convenience function from the Crosshair

get_crosshair_signal()[source]

Convenience function from the Crosshair

get_data_at(name='red', xy=(0, 0))[source]
get_double_clicked()[source]
get_image_item(color='red')[source]
get_view_range()[source]
get_visible_images()[source]
lock_aspect_ratio()[source]
move_left_splitter(pos, index)[source]
move_right_splitter(pos, index)[source]
move_scale_roi(roi, pos=None, size=None)[source]
move_scale_roi_target(pos=None, size=None)[source]

Move and scale the target ROI (used to display a particular area, for instance the currently scanned points during a scan :type pos: (iterable) setting the central position of the ROI in the view :param pos: :type pos: (iterable) setting the central position of the ROI in the view :type size: (iterable) setting the size of the ROI :param size: :type size: (iterable) setting the size of the ROI

notify_visibility_data_displayer()[source]
prepare_image_widget_for_lineouts(ratio=0.7)[source]
prepare_ui()[source]
remove_roi_displayer(roi_index)[source]
roi_clicked(isroichecked=True)[source]
scale_axis(xaxis, yaxis)[source]

scale view coordinates from the regular axes to the scaled/offset ones

set_axis_label(position, label='', units='')[source]

Convenience method to set label and unit of any view axes :type position: (str) any of AXIS_POSITIONS :param position: :type position: (str) any of AXIS_POSITIONS :type label: (str) text of the axis label :param label: :type label: (str) text of the axis label :type units: (str) units of the axis label :param units: :type units: (str) units of the axis label

set_axis_scaling(position='top', scaling=1, offset=0, label='', units='index')[source]

Method used to update the scaling of the right and top axes in order to translate indices to real coordinates :type position: (str) axis position either one of AXIS_POSITIONS :param position: :type position: (str) axis position either one of AXIS_POSITIONS :type scaling: (float) scaling of the axis :param scaling: :type scaling: (float) scaling of the axis :type offset: (float) offset of the axis :param offset: :type offset: (float) offset of the axis :type label: (str) text of the axis label :param label: :type label: (str) text of the axis label :type units: (str) units of the axis label :param units: :type units: (str) units of the axis label

set_crosshair_position(*positions)[source]

Convenience function from the Crosshair

set_image_displayer(data_distribution)[source]
set_image_labels(labels)[source]
set_transform(xaxis, yaxis)[source]
setup_actions()[source]
setup_graphs(graphs_layout)[source]
setup_lineouts()[source]
setup_view_box()[source]

create and axis-sync a viewbox for the top and right axes, and add the ROIselect

The ROIselect is added to the main plotitem (as in the Viewer1D), above the image items, so that it is drawn on top of the images

setup_widgets()[source]
show_ROI_select(pos=None, size=None)[source]
show_hide_crosshair(show=True)[source]
show_hide_histogram(show=True)[source]
show_legend(show=True)[source]
show_lineout_widgets()[source]
show_roi_target(show=True)[source]
unscale_axis(xaxis, yaxis)[source]

scale view coordinates from the scaled/offset axes to the regular ones

update_colors(colors)[source]
update_roi_channels(roi_index)[source]

Update the use_channel setting each time a ROI is added

update_view_box()[source]
data_displayer: ImageDisplayer
isocurver: IsoCurver
lineout_types = ['hor', 'ver', 'int']
lineout_viewers: Dict[str, Viewer1D]
property plotitem
roi_target: ROI | Crosshair
roi_vb: ViewBox
staticMetaObject = PySide6.QtCore.QMetaObject("View2D" inherits "QObject": Methods:   #4 type=Slot, signature=display_images(PyObject), parameters=PyObject   #5 type=Slot, signature=roi_clicked(bool), parameters=bool   #6 type=Slot, signature=show_hide_histogram(bool), parameters=bool   #7 type=Slot, signature=move_left_splitter(int,int), parameters=int, int   #8 type=Slot, signature=move_right_splitter(int,int), parameters=int, int   #9 type=Slot, signature=show_hide_crosshair(bool), parameters=bool )
property title: str
class pymodaq_gui.plotting.data_viewers.viewer2D.Viewer2D(parent=None, title='', rois_dock=None)[source]

Bases: ViewerBase

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

Attributes:
crosshair

Convenience method

image_widget

Convenience method

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

autolevels_first()[source]
crosshair_changed()[source]
double_clicked(posx, posy)[source]
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

prepare_connect_ui()[source]
process_crosshair_lineouts(dte)[source]
process_roi_lineouts(roi_dte)[source]
roi_changed(*args, **kwargs)[source]
selected_region_changed()[source]
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

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

convenience function to control roi

transform_image(dwa)[source]
update_crosshair_data(crosshair_dte)[source]
update_data()[source]
property crosshair

Convenience method

property image_widget

Convenience method

staticMetaObject = PySide6.QtCore.QMetaObject("Viewer2D" inherits "ViewerBase": Methods:   #13 type=Slot, signature=double_clicked(double,double), parameters=double, double   #14 type=Slot, signature=process_crosshair_lineouts(PyObject), parameters=PyObject )
view: View2D
property x_axis
property y_axis
pymodaq_gui.plotting.data_viewers.viewer2D.generate_uniform_data()[source]
Return type:

DataRaw

pymodaq_gui.plotting.data_viewers.viewer2D.histogram_factory(image_item=None, gradient='red')[source]

Create a pyqtgraph HistogramLUTWidget widget (histogram) and link it to the corresponding image_item :type image_item: (ImageItem) the image item to be linked with the histogram :param image_item: :type image_item: (ImageItem) the image item to be linked with the histogram :type gradient: (str) either 'red', 'green', 'blue', 'spread' or one of the Gradients :param gradient: :type gradient: (str) either 'red', 'green', 'blue', 'spread' or one of the Gradients

Return type:

HistogramLUTWidget instance

pymodaq_gui.plotting.data_viewers.viewer2D.image_item_factory(item_type='uniform', axisOrder='row-major')[source]
Return type:

Union[UniformImageItem, SpreadImageItem]

pymodaq_gui.plotting.data_viewers.viewer2D.main(data_distribution='uniform')[source]

either ‘uniform’ or ‘spread’

pymodaq_gui.plotting.data_viewers.viewer2D.main_spread()[source]
pymodaq_gui.plotting.data_viewers.viewer2D.main_view()[source]
pymodaq_gui.plotting.data_viewers.viewer2D.plot_data(viewer2D, ndata=2)[source]
pymodaq_gui.plotting.data_viewers.viewer2D.print_roi_select(rect)[source]