fsleyes.views.histogrampanel

This module provides the HistogramPanel, which is a FSLeyes view that plots the histogram of data from Image overlays.

class fsleyes.views.histogrampanel.HistogramPanel(parent, overlayList, displayCtx, frame)

Bases: fsleyes.views.plotpanel.OverlayPlotPanel

An OverlayPlotPanel which plots histograms from Image overlay data. A HistogramPanel looks something like this:

_images/histogrampanel.png

A HistogramPanel plots one or more HistogramSeries instances, each of which encapsulate histogram data from an Image overlay.

A couple of control panels may be shown on a HistogramPanel:

PlotListPanel The PlotListPanel is a FSLeyes control panel for use with OverlayPlotPanel views.
HistogramControlPanel The HistogramControlPanel is a FSLeyes control panel which allows the user to configure a HistogramPanel.

The following actions are provided, in addition to those already provided by the PlotPanel:

toggleHistogramToolBar Shows/hides a HistogramToolBar.
toggleHistogramControl Shows/hides a HistogramControlPanel.

Some tools are also available, to do various things:

addROIHistogram Runs an AddROIHistogramAction.
histType = <MagicMock name='mock.Choice()' id='140655055851648'>

The histogram type:

count The y axis represents the absolute number of values within each bin
probability The y axis represents the number of values within each bin, divided by the total number of values.
plotType = <MagicMock name='mock.Choice()' id='140655055851648'>

How histograms are plotted:

centre Plot one data point at the centre of each bin
edge Plot one data point at each bin edge - this produces a “stepped” plot.
__init__(parent, overlayList, displayCtx, frame)

Create a HistogramPanel.

Parameters:
destroy()

Removes some property listeners, and calls PlotPanel.destroy().

toggleHistogramControl(floatPane=False)

Shows/hides a HistogramControlPanel. See ViewPanel.togglePanel().

toggleHistogramToolBar()

Shows/hides a HistogramToolBar. See ViewPanel.togglePanel().

toggleHistogramOverlay()

Toggles the value of the HistogramSeries.showOverlay for the currently selected overlay (if possible).

addROIHistogram()

Runs an AddROIHistogramAction.

getActions()

Overrides ActionProvider.getActions(). Returns all of the actions that are defined on this HistogramPanel.

getTools()

Returns a list of tools to be added to the FSLeyesFrame for HistogramPanel views.

draw(*a)

Overrides PlotPanel.draw(). Passes some HistogramSeries instances to the PlotPanel.drawDataSeries() method.

createDataSeries(overlay)

Creates a HistogramSeries instance for the specified overlay.

_HistogramPanel__selectedOverlayChanged(*a)

Called when the OverlayList or the DisplayContext.selectedOverlay changes. Configures the toggleHistogramOverlay() action.

__module__ = 'fsleyes.views.histogrampanel'
prepareDataSeries(hs)

Overrides PlotPanel.prepareDataSeries().

Performs some pre-processing on the data contained in the given HistogramSeries instance.