Progress & wait dialog
- class Sisyphe.gui.dialogWait.DialogWait(title: str = '', info: str = '', progress: bool = False, progressmin: int | None = None, progressmax: int | None = None, progresstxt: bool = False, chart: bool = False, cancel: bool = False, parent: QWidget | None = None)
DialogWait class
Description
Wait and progress dialog.
Inheritance
QWidget - > QDialog -> DialogWait
Last revision: 17/07/2025
- FigureVisibilityOff() None
Hides the Matplotlib figure canvas. Adjusts dialog size and centers it.
- FigureVisibilityOn() None
Makes the Matplotlib figure canvas visible. Adjusts dialog size and centers it.
- addInformationText(txt: str = '') None
Appends additional information text to the current display. If txt is empty, it resets to the base information. Adjusts dialog size and centers it.
Parameters
- txtstr, optional
The additional text to append. Defaults to ‘’.
- addSimpleITKFilterIterationCommand(niter: int) None
Configures the dialog to monitor a SimpleITK filter’s iteration events. Sets progress bar range and attaches event commands.
Parameters
- niterint
The total number of iterations for the process.
- addSimpleITKFilterProcessCommand() None
Configures the dialog to monitor a SimpleITK filter’s progress events. Sets progress bar range and attaches event commands.
- buttonEnabled(v: bool) None
Enables or disables the cancel button. Processes pending GUI events.
Parameters
- vbool
True to enable, False to disable.
- buttonVisibilityOff() None
Hides the cancel button. Adjusts dialog size and centers it.
- buttonVisibilityOn() None
Makes the cancel button visible. Adjusts dialog size and centers it.
- getButtonVisibility() bool
Checks if the cancel button is visible.
Returns
- bool
True if the button is visible, False otherwise.
- getCurrentProgressValue() int
Retrieves the current value of the progress bar.
Returns
- int
The current progress bar value.
- getFigure() Figure
Retrieves the Matplotlib Figure object used by the dialog.
Returns
- Figure
The Matplotlib Figure instance.
- getFigureVisibility() None
Checks if the Matplotlib figure canvas is visible.
Returns
- bool
True if the figure canvas is visible, False otherwise.
- getInformationText() str
Retrieves the currently displayed information text.
Returns
- str
The current information text.
- getProgressMaximum() int
Retrieves the maximum value of the progress bar.
Returns
- int
The maximum progress bar value.
- getProgressMinimum() int
Retrieves the minimum value of the progress bar.
Returns
- int
The minimum progress bar value.
- getProgressRange() tuple[int, int]
Retrieves the current minimum and maximum values of the progress bar.
Returns
- tuple[int, int]
A tuple containing (minimum_value, maximum_value).
- getProgressTextVisibility() bool
Checks if the progress bar text is visible.
Returns
- bool
True if the progress bar text is visible, False otherwise.
- getProgressVisibility() bool
Checks if the progress bar is visible.
Returns
- bool
True if the progress bar is visible, False otherwise.
- getStopped() bool
Returns the current state of the stopped flag.
Returns
- bool
True if the process is stopped, False otherwise.
- incCurrentProgressValue() None
Increments the current value of the progress bar by one, if it’s less than the maximum value. Processes pending GUI events.
- messageFromDictProxyManager(mng: dict[str, str | int | None]) None
Updates the dialog’s state based on a dictionary from a proxy manager. Handles updates for information text, progress bar range, and current value. Processes pending GUI events.
Parameters
- mngdict[str, str | int | None]
A dictionary containing update commands (e.g., ‘msg’, ‘amsg’, ‘max’, ‘value’, ‘inc’).
- open() None
Opens the dialog. On macOS, it overrides the default open() to handle title bar display.
- progressTextVisibilityOff() None
Hides the progress bar text. Adjusts dialog size and centers it.
- progressTextVisibilityOn() None
Makes the progress bar text visible. Adjusts dialog size and centers it.
- progressVisibilityOff() None
Hides the progress bar. Adjusts dialog size and centers it.
- progressVisibilityOn() None
Makes the progress bar visible. Adjusts dialog size and centers it.
- reset() None
Resets the dialog’s internal state, including the SimpleITK filter, stopped flag, current iteration, and base information text.
- resetStopped() None
Resets the internal stopped flag to False.
- setButtonVisibility(v: bool) None
Sets the visibility of the cancel button. Adjusts dialog size and centers it.
Parameters
- vbool
True to show the button, False to hide it.
- setCurrentProgressValue(v: int) None
Sets the current value of the progress bar. Clamps the value within the defined minimum and maximum range. Processes pending GUI events.
Parameters
- vint
The value to set.
- setCurrentProgressValuePercent(v: float | int, dummy: Any) None
Sets the current value of the progress bar as a percentage (0-100). Processes pending GUI events.
Parameters
- vfloat | int
The percentage value. Can be a float (0.0-1.0) or an int (0-100).
- dummyAny
A placeholder parameter (unused).
- setCurrentProgressValueToMaximum() None
Sets the current progress bar value to its maximum. Processes pending GUI events.
- setCurrentProgressValueToMinimum() None
Sets the current progress bar value to its minimum. Processes pending GUI events.
- setFigureVisibility(v: bool) None
Sets the visibility of the Matplotlib figure canvas. Adjusts dialog size and centers it.
Parameters
- vbool
True to show the figure, False to hide it.
- setInformationText(txt: str) None
Sets the main information text displayed in the dialog. Adjusts dialog size and centers it.
Parameters
- txtstr
The text to display.
- setProgressMaximum(v: int) None
Sets the maximum value of the progress bar. The dialog’s visibility is also set based on whether v > 1.
Parameters
- vint
The maximum value.
- setProgressMinimum(v: int) None
Sets the minimum value of the progress bar and updates its current value.
Parameters
- vint
The minimum value.
- setProgressRange(vmin: int, vmax: int) None
Sets the minimum and maximum values for the progress bar. Ensures vmin is not greater than vmax by swapping if necessary.
Parameters
- vminint
The minimum value.
- vmaxint
The maximum value.
- setProgressTextVisibility(v: bool) None
Sets the visibility of the text displayed on the progress bar. Adjusts dialog size and centers it.
Parameters
- vbool
True to show progress text, False to hide it.
- setProgressVisibility(v: bool) None
Sets the visibility of the progress bar. Adjusts dialog size and centers it.
Parameters
- vbool
True to show the progress bar, False to hide it.
- setSimpleITKFilter(filtr: ImageFilter) None
Sets the SimpleITK image filter to monitor.
Parameters
- filtrsitkImageFilter
The SimpleITK image filter instance.
- setStopped() None
Manually sets the internal stopped flag to True.