Generic results dialog

class Sisyphe.gui.dialogGenericResults.DialogGenericResults(parent=None)

DialogGenericResults class

Description

Generic dialog to display statistical results.

Inheritance

QDialog -> DialogGenericResults

Creation: 25/11/2022 Last revision: 18/09/2025

addTreeWidgetRow(index: int, row: list | tuple | ndarray, d: int | None = None) None

Add a new row of data to a tree widget.

Parameters

indexint

The tab index.

rowlist | tuple | ndarray

The data for the new row.

dint | None, optional

Number of decimals for formatting float values. Auto-detected if None.

autoSize(index: int) None

Automatically resize the dialog width to fit the tree widget content.

Parameters

indexint

The tab index containing the tree widget to measure.

chartBarFromTreeWidgetColumn(index: int, col: int) None

Generate and display a bar chart from a tree widget column.

Parameters

indexint

The tab index.

colint

The column index to plot.

chartBoxplotFromTreeWidgetColumn(index: int, col: int) None

Generate and display a boxplot from a tree widget column.

Parameters

indexint

The tab index.

colint

The column index to plot.

chartPieFromTreeWidgetColumn(index: int, col: int) None

Generate and display a pie chart from a tree widget column.

Parameters

indexint

The tab index.

colint

The column index to plot.

chartPlotFromTreeWidgetColumn(index: int, col: int) None

Generate and display a line plot from a tree widget column.

Parameters

indexint

The tab index.

colint

The column index to plot.

clear() None

Clear all tabs and data from the dialog.

clearColumnCharts(index: int) None

Clear the chart type for all columns in a tree widget.

Parameters

indexint

The tab index.

clearColumnUnits(index: int) None

Clear the units for all columns in a tree widget.

Parameters

indexint

The tab index.

getFigure(index: str | int) Figure

Get the Matplotlib figure from a specific tab.

Parameters

indexstr | int

The tab index or title.

Returns

Figure

The Matplotlib figure from the specified tab.

getTabCount() int

Get the number of tabs in the dialog.

Returns

int

The total number of tabs.

getTreeWidget(index: str | int) QTreeWidget

Get the tree widget from a specific tab.

Parameters

indexstr | int

The tab index or title.

Returns

QTreeWidget

The tree widget from the specified tab.

hideFigure(index: str | int) None

Hide the figure canvas in a specific tab.

Parameters

indexstr | int

The tab index or title.

hideTree(index: str | int) None

Hide the tree widget in a specific tab.

Parameters

indexstr | int

The tab index or title.

isFigureVisible(index: str | int) bool

Check if the figure canvas in a specific tab is visible.

Parameters

indexstr | int

The tab index or title.

Returns

bool

True if the figure is visible, False otherwise.

isTreeVisible(index: str | int) bool

Check if the tree widget in a specific tab is visible.

Parameters

indexstr | int

The tab index or title.

Returns

bool

True if the tree widget is visible, False otherwise.

newDescriptiveStatisticsTab(labels: list[str], data: list[ndarray], title: str = '', units: str = '', decimals: int | None = None, capture: bool = True, clipbrd: bool = True, scrshot: ScreenshotsGridWidget | None = None, dataset: bool = True) int

Create a new tab to display descriptive statistics. Calculates and displays statistics (min, max, mean, std, etc.) in a tree widget and shows a corresponding boxplot.

Parameters

labelslist[str]

Labels for the data series.

datalist[ndarray]

A list of numpy arrays containing the data.

titlestr, optional

Base title for the tab.

unitsstr, optional

Units for the data values.

decimalsint | None, optional

Number of decimals for display. Auto-detected if None.

capturebool, optional

If True, enables the figure canvas and save/copy buttons.

clipbrdbool, optional

If True, enables the copy to clipboard button.

scrshotScreenshotsGridWidget | None, optional

A ScreenshotsGridWidget instance to enable copying to it.

datasetbool, optional

If True, enables the tree widget and save dataset button.

Returns

int

The index of the newly created tab.

newHistogramTab(data: ndarray, bins: int | None = 32, cumulative: bool = False, label: str = '', units: str = '', capture: bool = True, clipbrd: bool = True, scrshot: ScreenshotsGridWidget | None = None, dataset: bool = True) int

Create a new tab to display a histogram.

Parameters

datandarray

The 1D data to be plotted.

binsint | None, optional

Number of histogram bins. Defaults to 32.

cumulativebool, optional

If True, create a cumulative histogram. Defaults to False.

labelstr, optional

Label for the data.

unitsstr, optional

Units for the data values.

capturebool, optional

If True, enables the figure canvas and save/copy buttons.

clipbrdbool, optional

If True, enables the copy to clipboard button.

scrshotScreenshotsGridWidget | None, optional

A ScreenshotsGridWidget instance to enable copying to it.

datasetbool, optional

If True, enables the tree widget and save dataset button.

Returns

int

The index of the newly created tab.

newImageHistogramTab(vol: SisypheVolume, bins: int | None = 128, cumulative: bool = False, capture: bool = True, clipbrd: bool = True, scrshot: ScreenshotsGridWidget | None = None)

Create a new tab to display a histogram of a SisypheVolume.

Parameters

volSisypheVolume

The volume to analyze.

binsint | None, optional

Number of histogram bins. Defaults to 128.

cumulativebool, optional

If True, create a cumulative histogram. Defaults to False.

capturebool, optional

If True, enables the figure canvas and save/copy buttons.

clipbrdbool, optional

If True, enables the copy to clipboard button.

scrshotScreenshotsGridWidget | None, optional

A ScreenshotsGridWidget instance to enable copying to it.

Returns

int

The index of the newly created tab.

newTab(title: str = '', capture: bool = True, clipbrd: bool = True, scrshot: ScreenshotsGridWidget | None = None, dataset: bool = True) int

Create and add a new tab to the dialog.

Parameters

titlestr, optional

Title of the tab.

capturebool, optional

If True, enables the figure canvas and save/copy buttons.

clipbrdbool, optional

If True, enables the copy to clipboard button.

scrshotScreenshotsGridWidget | None, optional

A ScreenshotsGridWidget instance to enable copying to it.

datasetbool, optional

If True, enables the tree widget and save dataset button.

Returns

int

The index of the newly created tab.

setColumnChart(index: int, col: int, chart: str = '') None

Set the chart type for a specific column in a tree widget.

Parameters

indexint

The tab index.

colint

The column index.

chartstr, optional

The chart type (‘bar’, ‘plot’, ‘boxplot’, ‘pie’). Defaults to ‘’.

setColumnUnit(index: int, col: int, unit: str = '') None

Set the unit for a specific column in a tree widget.

Parameters

indexint

The tab index.

colint

The column index.

unitstr, optional

The unit string. Defaults to ‘’.

setTreeWidgetArray(index: int, arr: ndarray | DataFrame, d: int | None = None, rows: list[str] | None = None) None

Populate a tree widget from a NumPy array or pandas DataFrame.

Parameters

indexint

The tab index.

arrndarray | DataFrame

The data to populate the widget with.

dint | None, optional

Number of decimals for formatting float values. Auto-detected if None.

rowslist[str] | None, optional

Labels for the rows. If provided, they are placed in the first column.

setTreeWidgetDict(index: int, arr: dict, d: int | None = None)

Populate a tree widget from a dictionary.

Parameters

indexint

The tab index.

arrdict

The data dictionary. Keys are used as headers, and values are lists of column data.

dint | None, optional

Number of decimals for formatting float values. Auto-detected if None.

setTreeWidgetHeaderLabels(index: int, labels: list[str], units: list[str] | None = None, charts: list[str] | None = None) None

Set the header labels, units, and chart types for a tree widget.

Parameters

indexint

The tab index.

labelslist[str]

List of column header labels.

unitslist[str] | None, optional

List of units for each column.

chartslist[str] | None, optional

List of chart types for each column (‘bar’, ‘plot’, ‘boxplot’, ‘pie’).

showEvent(a0)

Reimplementation of QWidget.showEvent to adjust dialog size on show.

Parameters

a0QShowEvent

The show event.

showFigure(index: str | int) None

Show the figure canvas in a specific tab.

Parameters

indexstr | int

The tab index or title.

showTree(index: str | int) None

Show the tree widget in a specific tab.

Parameters

indexstr | int

The tab index or title.