roi_histogram

class pdsspect.roi_histogram.ROIHistogramModel(image_set)[source]

Bases: pdsspect.roi_plot.ROIPlotModel

Model for ROI histogram and accompanying widget

add_selected_color(color)

Select a color and inform views to display new color

Parameters:color (str) – The color to add
compare_data

bool – True if image_index is not -1

has_multiple_views

bool – True if there are multiple views, False otherwise

image_index

int – The index of the image to which to compare data with

When setting image_index, it may be changed to -1 if the image is the same as the current image. Furthermore, when setting the view_index, the image_index may be changed to -1 if the view_index and the current_image_index are the same.

image_set

PDSSpectImageSet – Image set that corresponds with the current view

image_sets

list – All the image sets, including the current one

register(view)

Register view with the model

remove_selected_color(color)

Remove a selected color and inform views to not display the color

Parameters:color (str) – The color to remove
unit

str – Latex version of pdsspect_image_set.PDSSpectImageSet.unit

unregister(view)

Unregister view with the model

view_index

int – The index of the view to display the ROI data

If there are not multiple views, view_index is automatically -1.

xdata(color)[source]

Data inside a ROI with the given color for the current image

Parameters:color (str) – The color of the ROI
Returns:data – Data in ROI color for the xaxis
Return type:numpy.ndarray
xlim

list of two float – min max of current image’s data

ydata(color)[source]

Data inside a ROI with the given color for the image in the menu

Parameters:color (str) – The color of the ROI
Returns:data – Data in ROI color for the yaxis
Return type:numpy.ndarray
ylim

list of two float – min max of yaxis image

class pdsspect.roi_histogram.ROIHistogramController(model, view)[source]

Bases: pdsspect.roi_plot.ROIPlotController

Controller for ROI histogram and accompanying widget

Parameters:
model

ROIHistogramModel – The model

view

ROIHistogramWidget or ROIHistogram – The view

color_state_changed(color)

Select or remove the color when a checkbox color changes

Parameters:color (str) – The name of the checkbox whose state changed
remove_color(color)

Remove a given color

Parameters:color (str) – The color to remove
select_color(color)

Selected a given color

Parameters:color (str) – The color to select
set_image_index(index)[source]

Set the index of the image in the menu

Parameters:index (int) – Index of the image menu
set_view_index(index)

Set the index of the view

Parameters:index (int) – Index of the view
class pdsspect.roi_histogram.ROIHistogramWidget(model)[source]

Bases: pdsspect.roi_plot.ROIPlotWidget

Widget to hold the histogram and check boxes

Parameters:model (ROIHistogramModel) – The model
model

ROIHistogramModel – The model

controller

ROIHistogramController – The controller

image_menu

QtWidgets.QComboBox – Menu to select image for y axis

select_image(index)[source]

Select an image when image is selected in the menu

Parameters:index (int) – The index of the selected image
class pdsspect.roi_histogram.ROIHistogram(model)[source]

Bases: pdsspect.roi_plot.ROIPlot

Histogram view of the data in each ROI color

Parameters:model (ROIHistogramModel) – The model
model

ROIHistogramModel – The model

set_data()[source]

Set the data of the selected colors on the histogram

set_image()[source]

Set data when image is changed