ROIStatsWidget: Display a set of statistics for couples (plot items, roi)

An example of the usage is given in examples/plotRoiStats.py

This module provides widget for displaying statistics relative to a Region of interest and an item

ROIStatsWidget class

class ROIStatsWidget(parent=None, plot=None, stats=None, rois=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

Widget used to define stats item for a couple(roi, plotItem). Stats will be computing on a given item (curve, image…) in the given region of interest.

It also provide an interface for adding and removing items.

../../../_images/ROIStatsWidget.png
Parameters:
  • parent (Union[qt.QWidget,None]) – parent qWidget
  • plot (PlotWindow) – plot widget containing the items
  • stats – stats to display
  • rois (tuple) – tuple of rois to manage
registerROI(roi)[source]

For now there is no direct link between roi and plot. That is why we need to add/register them to be able to associate them

setPlot(plot)[source]

Define the plot to interact with

Parameters:plot (Union[PlotWidget,SceneWidget,None]) – The plot containing the items on which statistics are applied
setStats(stats)[source]

Set which stats to display and the associated formatting.

Parameters:statsHandler (StatsHandler) – Set the statistics to be displayed and how to format them using
getStatsHandler()[source]

Returns the StatsHandler in use.

Return type:StatsHandler
addItem(plotItem, roi)[source]

Add a row of statitstic regarding the couple (plotItem, roi)

Parameters:
  • plotItem (Item) – item to use for statistics
  • roi – region of interest to limit the statistic.
Type:

Union[ROI, RegionOfInterest]

Returns:

None of failed to add the item

Return type:

Union[None,ROIStatsItemHelper]

removeItem(plotItem, roi)[source]

Remove the row associated to the couple (plotItem, roi)

Parameters:
  • plotItem (Item) – item to use for statistics
  • roi – region of interest to limit the statistic.
Type:

Union[ROI,RegionOfInterest]

ROIStatsItemHelper class

class ROIStatsItemHelper(plot_item, roi)[source]

Bases: object

Item utils to associate a plot item and a roi

Display on one row statistics regarding the couple (Item (plot item) / roi).

Parameters:
  • plot_item (Item) – item for which we want statistics
  • Union[ROI,RegionOfInterest] – region of interest to use for statistics.
roi
roi_kind

roi class

item_kind()[source]

item kind

item_legend

legend of the plot Item

id_key()[source]

unique key to represent the couple (item, roi)