7.5.5.1.6. pymodaq_gui.plotting.data_viewers.viewer2D module
- class pymodaq_gui.plotting.data_viewers.viewer2D.Histogrammer(histogram_container: QWidget, histogram_refs=['red', 'green', 'blue'])[source]
Bases:
QObject- Attributes:
- autolevels
Methods
set_gradient([histo, gradient])Change the color gradient of the specified histogram :param histo: :type histo: (str) either 'red', 'green', 'blue', 'spread' or 'all' :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
- set_gradient(histo='red', gradient='grey')[source]
Change the color gradient of the specified histogram :param histo: :type histo: (str) either ‘red’, ‘green’, ‘blue’, ‘spread’ or ‘all’ :param gradient: :type gradient: (str or Gradient)
- property autolevels
- gradient_changed
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class pymodaq_gui.plotting.data_viewers.viewer2D.ImageDisplayer(plotitem, data_distribution: DataDistribution)[source]
Bases:
QObjectThis Object deals with the display of 2D data with a plotitem
- Attributes:
- autolevels
- labels
- legend
Methods
get_image
get_images
set_autolevels
show_legend
update_data
update_display_items
update_image_visibility
updated_item
- update_data(dwa: DataWithAxes)[source]
- property autolevels
- property labels
- property legend
- updated_item
int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- Type:
str = …, revision
- class pymodaq_gui.plotting.data_viewers.viewer2D.IsoCurver(image_source, histogram_parent)[source]
Bases:
QObjectMethods
set_isocurve_data
setup_iso_curve
show_hide_iso
update_histogram_parent
update_image_source
update_isocurve
- class pymodaq_gui.plotting.data_viewers.viewer2D.View2D(parent_widget=None)[source]
Bases:
ActionManager,QObject- Attributes:
- plotitem
Methods
Convenience function from the Crosshair
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 :param pos: :type pos: (iterable) setting the central position of the ROI in the view :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 :param position: :type position: (str) any of AXIS_POSITIONS :param label: :type label: (str) text 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 pixels to real coordinates :param position: :type position: (str) axis position either one of AXIS_POSITIONS :param scaling: :type scaling: (float) scaling of the axis :param offset: :type offset: (float) offset of the axis :param label: :type label: (str) text of the axis label :param units: :type units: (str) units of the axis label
set_crosshair_position(*positions)Convenience function from the Crosshair
Method where to create actions to be subclassed.
unscale_axis(xaxis, yaxis)scale view coordinates from the scaled/offset axes to the regular ones
update_roi_channels(index[, roi_type])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_view_range
get_visible_images
lock_aspect_ratio
move_left_splitter
move_right_splitter
notify_visibility_data_displayer
prepare_image_widget_for_lineouts
prepare_ui
remove_roi_displayer
roi_clicked
set_image_displayer
set_image_labels
setup_graphs
setup_widgets
show_ROI_select
show_hide_crosshair
show_hide_histogram
show_legend
show_lineout_widgets
show_roi_target
update_colors
- display_crosshair_lineouts(crosshair_dte: DataToExport)[source]
- display_roi_lineouts(roi_dte: DataToExport)[source]
- get_axis(position='left') AxisItem_Scaled[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 :param pos: :type pos: (iterable) setting the central position of the ROI in the view :param size: :type size: (iterable) setting the size of the ROI
- 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 :param position: :type position: (str) any of AXIS_POSITIONS :param label: :type label: (str) text 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='Pxls')[source]
Method used to update the scaling of the right and top axes in order to translate pixels to real coordinates :param position: :type position: (str) axis position either one of AXIS_POSITIONS :param scaling: :type scaling: (float) scaling of the axis :param offset: :type offset: (float) offset of the axis :param label: :type label: (str) text of the axis label :param units: :type units: (str) units of the axis label
- set_image_displayer(data_distribution: DataDistribution)[source]
- setup_actions()[source]
Method where to create actions to be subclassed. Mandatory
Examples
>>> self.add_action('Quit', 'close2', "Quit program") >>> self.add_action('Grab', 'camera', "Grab from camera", checkable=True) >>> self.add_action('Load', 'Open', "Load target file (.h5, .png, .jpg) or data from camera", checkable=False) >>> self.add_action('Save', 'SaveAs', "Save current data", checkable=False)
See also
ActionManager.add_action
- unscale_axis(xaxis, yaxis)[source]
scale view coordinates from the scaled/offset axes to the regular ones
- update_roi_channels(index, roi_type='')[source]
Update the use_channel setting each time a ROI is added
- lineout_types = ['hor', 'ver', 'int']
- property plotitem
- class pymodaq_gui.plotting.data_viewers.viewer2D.Viewer2D(parent: QWidget = None, title='')[source]
Bases:
ViewerBaseObject managing plotting and manipulation of 2D data using a View2D
- Attributes:
crosshairConvenience method
image_widgetConvenience method
roi_managerConvenience method
roi_targetTo 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
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
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
- get_axes_from_view(data: DataWithAxes)[source]
Obtain axes info from the view
Only for uniform data
- move_roi_target(pos: Iterable[float] = None, size: Iterable[float] = (1, 1))[source]
move a specific read only ROI at the given position on the viewer
- process_roi_lineouts(roi_dte: DataToExport)[source]
- set_image_transform() DataRaw[source]
Deactivate some tool buttons if data type is “spread” then apply transform_image
- transform_image(dwa: DataWithAxes)[source]
- update_crosshair_data(crosshair_dte: DataToExport)[source]
- property crosshair
Convenience method
- property image_widget
Convenience method
- property roi_manager
Convenience method
- property roi_target: ROI
To be implemented if necessary (Viewer1D and above)
- property x_axis
- property y_axis
- 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 :param image_item: :type image_item: (ImageItem) the image item to be linked with the histogram :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', pen='r')[source]