Multiple viewport widgets
- class Sisyphe.widgets.multiViewWidgets.MultiViewWidget(r: int = 1, c: int = 1, parent: QWidget | None = None)
MultiViewWidget class
Description
Base class that serves as a container for managing and displaying multiple, synchronized viewports in a grid layout. It provides the core infrastructure for creating complex, interactive multi-view displays by arranging instances of AbstractViewWidget subclasses.
The main features are as follows:
Grid-based Layout: arranges child widgets in a configurable grid of up to 4x4. It dynamically manages the visibility of widgets based on the specified number of rows and columns.
Comprehensive widget management: provides a full API for adding, removing, retrieving, moving, and swapping widgets within the grid. Widgets can be accessed by their coordinates or through helper methods like getFirstViewWidget() and getSelectedViewWidget().
View synchronization and control:
Ensures that only one view can be selected at a time across the entire grid.
Offers centralized methods to propagate settings—such as line colors, font styles, and popup menu states—to all contained views simultaneously.
Interactive display modes:
Expand View: allows a single widget to be temporarily expanded to fill the entire grid area, hiding all others for focused inspection.
Fullscreen mode: Toggles the entire widget container between normal and fullscreen display.
Grid capture functionality: built-in functionality to capture all visible views as a single montage image. The resulting image can be saved to a bitmap file or copied directly to the system clipboard.
VTK Finalization: provides an explicit finalize() method to ensure proper cleanup of VTK resources, preventing common rendering errors upon window closure, particularly on the Windows platform.
Inheritance
QWidget -> MultiViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- alignCentersOff() None
Disable automatic center alignment for overlays in all applicable view widgets.
- alignCentersOn() None
Enable automatic center alignment for overlays in all applicable view widgets.
- copyToClipboard() None
Copy a montage of all visible views to the system clipboard.
- expandViewWidget(widget: AbstractViewWidget) None
Expand a single view widget to fill the entire grid area, hiding all others.
Parameters
- widgetAbstractViewWidget
view widget to expand.
- finalize() None
Method to be called before MultiViewWidget instance destruction. It is used to avoid vtk error on windows platform (vtkWin32OpenGLRenderWindow error: ‘wglMakeCurrent failed in MakeCurrent()’).
- getAlignCenters() bool | None
Get the automatic center alignment policy.
Returns
- bool | None
True if alignment is enabled, False if disabled, or None if no applicable views exist.
- getCols() int
Get the number of visible columns in the grid.
Returns
- int
current number of visible columns.
- getExpandedViewWidget() AbstractViewWidget | None
Get the currently expanded view widget.
Returns
- AbstractViewWidget | None
expanded view widget, or None if no view is expanded.
- getFirstSliceViewWidget() SliceViewWidget | None
Get the first instance of a SliceViewWidget found in the grid.
Returns
- SliceViewWidget | None
first SliceViewWidget instance, or None if none are present.
- getFirstViewWidget() AbstractViewWidget | None
Get the view widget at the top-left position (0, 0).
Returns
- AbstractViewWidget | None
view widget at coordinate (0, 0), or None if it does not exist.
- getFirstVolumeViewWidget() VolumeViewWidget | None
Get the first instance of a VolumeViewWidget found in the grid.
Returns
- VolumeViewWidget | None
first VolumeViewWidget instance, or None if none are present.
- getNumberOfVisibleViews() int
Get the number of currently visible view widgets.
Returns
- int
count of visible views.
- getRows() int
Get the number of visible rows in the grid.
Returns
- int
current number of visible rows.
- getRowsAndCols() tuple[int, int]
Get the number of visible rows and columns in the grid.
Returns
- tuple[int, int]
(rows, columns) currently visible.
- getSelectedViewWidget() AbstractViewWidget | None
Get the currently selected view widget in the grid.
Returns
- AbstractViewWidget | None
selected view widget, or None if no widget is selected.
- getSliceViewWidgets() list[SliceViewWidget]
Get a list of all SliceViewWidget instances in the grid.
Returns
- list[SliceViewWidget]
list of all SliceViewWidget instances.
- getViewWidgetAt(r: int, c: int) AbstractViewWidget | None
Get the view widget at a specific row and column.
Parameters
- rint
row index.
- cint
column index.
Returns
- AbstractViewWidget | None
view widget at the specified coordinate, or None if no widget is present.
- getViewWidgetCoordinate(widget: AbstractViewWidget) tuple[int, int] | tuple[None, None]
Get the grid coordinate (row, column) of a specific view widget.
Parameters
- widgetAbstractViewWidget
view widget to locate.
Returns
- tuple[int, int] | tuple[None, None]
(row, column) coordinate of the widget, or (None, None) if not found.
- getViewWidgetCount() int
Get the total number of view widgets in the grid.
Returns
- int
total count of view widgets.
- getVisibilityControl() int
Get the master view index for visibility-related synchronizations (e.g., colorbar, cursor)
Returns
- int
index of the master view, or None if control applies to all views.
- getVolumeViewWidgets() list[VolumeViewWidget]
Get a list of all VolumeViewWidget instances in the grid.
Returns
- list[VolumeViewWidget]
list of all VolumeViewWidget instances.
- hideAction(name: str) None
Hide a specific action in the popup menu for all view widgets.
Parameters
- namestr
name of the action to hide.
- isEmpty() bool
Check if the grid contains any view widgets.
Returns
- bool
True if the grid is empty, False otherwise.
- isExpanded() bool
Check if any view widget is currently expanded.
Returns
- bool
True if a view is expanded, False otherwise.
- isFullScreenDisplay() bool
Check if the widget is currently in fullscreen display mode.
Returns
- bool
True if in fullscreen mode, False otherwise.
- isNotEmpty() bool
Check if the grid contains at least one view widget.
Returns
- bool
True if the grid is not empty, False otherwise.
- isRoundedCursorCoordinatesEnabled() bool
Check if cross-shaped cursor coordinate rounding is enabled.
Returns
- bool
True if rounding is enabled, False otherwise.
- moveViewWidget(r1: int, c1: int, r2: int, c2: int) None
Move a view widget from one grid coordinate to another. If the destination is occupied, the widgets are swapped.
Parameters
- r1int
source row index.
- c1int
source column index.
- r2int
destination row index.
- c2int
destination column index.
- popupMenuActionsDisabled() None
Disable the ‘Actions’ submenu in the popup menu for all view widgets.
- popupMenuActionsEnabled() None
Enable the ‘Actions’ submenu in the popup menu for all view widgets.
- popupMenuColorbarPositionDisabled() None
Disable the ‘Colorbar position’ submenu in the popup menu for all view widgets.
- popupMenuColorbarPositionEnabled() None
Enable the ‘Colorbar position’ submenu in the popup menu for all view widgets.
- popupMenuDisabled() None
Disable the popup context menu for all view widgets in the grid.
- popupMenuEnabled() None
Enable the popup context menu for all view widgets in the grid.
- popupMenuToolsDisabled() None
Disable the ‘Tools’ submenu in the popup menu for all view widgets.
- popupMenuToolsEnabled() None
Enable the ‘Tools’ submenu in the popup menu for all view widgets.
- popupMenuVisibilityDisabled() None
Disable the ‘Visibility’ submenu in the popup menu for all view widgets.
- popupMenuVisibilityEnabled() None
Enable the ‘Visibility’ submenu in the popup menu for all view widgets.
- removeViewWidget(widget: AbstractViewWidget) None
Remove a specific view widget instance from the grid.
Parameters
- widgetAbstractViewWidget
view widget instance to remove.
- removeViewWidgetFromCoordinate(r: int, c: int) None
Remove a view widget from the grid at a specified coordinate.
Parameters
- rint
row index of the widget to remove.
- cint
column index of the widget to remove.
- saveCapture() None
Save a montage of all visible views as a single image file. A file dialog is shown to select the destination and format (supported formats: BMP, JPG, PNG, TIFF).
- setActionVisibility(name: str, v: bool) None
Set the visibility of a specific action in the popup menu for all view widgets.
Parameters
- namestr
name of the action to modify.
- vbool
True to make the action visible, False to hide it.
- setAlignCenters(v: bool) None
Set the automatic center alignment policy for overlays in all applicable view widgets.
Parameters
- vbool
True to enable automatic alignment, False to disable.
- setCols(c: int) None
Set the number of visible columns in the grid.
Parameters
- cint
number of columns to display (0-3).
- setFontFamily(s: str) None
Set the font family for text in all view widgets.
Parameters
- sstr
font family name.
- setFontProperties(s: tuple[str | None, int | None, float | None]) None
Set multiple font properties (family, size, scale) for all view widgets.
Parameters
- stuple[str | None, int | None, float | None]
tuple containing font family, size, and scale.
- setFontScale(s: float) None
Set the font scaling factor for all view widgets.
Parameters
- sfloat
font scaling factor.
- setFontSize(s: int) None
Set the font size for text in all view widgets.
Parameters
- sint
font size in points.
- setFontSizeScale(s: tuple[int, float]) None
Set both the font size and scaling factor for all view widgets.
Parameters
- stuple[int, float]
tuple containing the font size and scaling factor.
- setFullScreenDisplay() None
Set the multi-view widget to fullscreen display mode.
- setLineColor(c: list[float] | tuple[float, float, float]) None
Set the line color for all view widgets.
Parameters
- clist[float] | tuple[float, float, float]
RGB color values (0.0-1.0).
- setLineOpacity(v: float) None
Set the line opacity for all view widgets.
Parameters
- vfloat
opacity value (0.0-1.0).
- setLineSelectedColor(c: list[float] | tuple[float, float, float]) None
Set the selected line color for all view widgets.
Parameters
- clist[float] | tuple[float, float, float]
RGB color values (0.0-1.0).
- setLineWidth(v: float) None
Set the line width for all view widgets.
Parameters
- vfloat
line width in pixels.
- setNormalDisplay() None
Restore the multi-view widget to its normal (non-fullscreen) display mode.
- setRoundedCursorCoordinatesDisabled() None
Disable rounding of cross-shaped cursor coordinates for all view widgets.
- setRoundedCursorCoordinatesEnabled() None
Enable rounding of cross-shaped cursor coordinates to the nearest voxel for all view widgets.
- setRows(r: int) None
Set the number of visible rows in the grid.
Parameters
- rint
number of rows to display (0-3).
- setRowsAndCols(r: int, c: int) None
Set the number of visible rows and columns in the grid.
Parameters
- rint
number of rows to display (0-3).
- cint
number of columns to display (0-3).
- setViewWidget(r: int, c: int, widget: AbstractViewWidget) None
Add a view widget to the grid at a specified coordinate. This method also configures the widget’s popup menu for grid-specific actions like capturing the entire grid.
Parameters
- rint
row index for the widget.
- cint
column index for the widget.
- widgetAbstractViewWidget
view widget to add to the grid.
- setVisibilityControlToAll() None
Set visibility control to apply to all views, rather than a single master view.
- setVisibilityControlToView(r: int, c: int) None
Set a specific view to be the master for visibility-related synchronizations (e.g., colorbar, cursor).
Parameters
- rint
row index of the master view.
- cint
column index of the master view.
- showAction(name: str) None
Show a specific action in the popup menu for all view widgets.
Parameters
- namestr
name of the action to show.
- swapViewWidgets(r1: int, c1: int, r2: int, c2: int) None
Swap the positions of two view widgets in the grid.
Parameters
- r1int
row index of the first widget.
- c1int
column index of the first widget.
- r2int
row index of the second widget.
- c2int
column index of the second widget.
- toggleDisplay() None
Toggle the display mode between fullscreen and normal.
- updateRender() None
Trigger a render update for all view widgets in the grid.
- class Sisyphe.widgets.multiViewWidgets.OrthogonalSliceViewWidget(parent: QWidget | None = None)
OrthogonalSliceViewWidget class
Description
Specialized subclass of the MultiViewWidget base class designed to display three synchronized orthogonal views of a SisypheVolume. It displays the axial, coronal, and sagittal planes side-by-side in a 1x3 grid.
The main features are as follows:
Standard orthogonal layout: provides three SliceOverlayViewWidget instances, pre-configured for axial, coronal, and sagittal orientations.
Full synchronization: all interactions are seamlessly synchronized across the three views. Changes to the cross-shaped cursor position, zoom level, window/level settings, or any added tools in one view are reflected in the others.
Centralized data management: providing a single API to load a primary SisypheVolume, add and manage overlay volumes, and display SisypheMeshCollection instances across all three views at once.
Direct view access: offers convenient helper methods (getAxialView, getCoronalView, getSagittalView) for direct access to each individual slice view widget, allowing for fine control when needed.
Inheritance
QWidget -> MultiViewWidget -> OrthogonalSliceViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- addOverlay(volume: SisypheVolume, alpha: float = 0.5) None
Add a SisypheVolume as an overlay to all three orthogonal view widgets.
Parameters
- volumeSisypheVolume
volume to add as an overlay.
- alphafloat, optional
opacity of the overlay (0.0-1.0, default 0.5).
- getAxialView() SliceViewWidget
Get the axial SliceViewWidget instance.
Returns
- SliceViewWidget
axial view widget.
- getCoronalView() SliceViewWidget
Get the coronal SliceViewWidget instance.
Returns
- SliceViewWidget
coronal view widget.
- getMeshCollection() SisypheMeshCollection
Get the current SisypheMeshCollection.
Returns
- SisypheMeshCollection
current collection of meshes.
- getOverlayFromIndex(index: int) None
Get an overlay by its index.
Parameters
- indexint
index of the overlay to retrieve.
Returns
- SisypheVolume
overlay volume at the specified index.
- getOverlayIndex(o: int | SisypheVolume) None
Get the index of a specific overlay.
Parameters
- oint | SisypheVolume
overlay to find, by index or instance.
Returns
- int
index of the overlay.
- getSagittalView() SliceViewWidget
Get the sagittal SliceViewWidget instance.
Returns
- SliceViewWidget
sagittal view widget.
- getVolume() SisypheVolume
Get the currently displayed SisypheVolume.
Returns
- SisypheVolume
currently displayed volume.
- hasOverlay() bool
Check if any overlays are present.
Returns
- bool
True if at least one overlay exists, False otherwise.
- hasVolume() bool
Check if a SisypheVolume is currently displayed in the views.
Returns
- bool
True if a SisypheVolume is displayed, False otherwise.
- removeAllOverlays() None
Remove all overlays from all three view widgets.
- removeOverlay(o: int | SisypheVolume) None
Remove a specific overlay from all three view widgets.
Parameters
- oint | SisypheVolume
overlay to remove, by index or instance.
- removeVolume() None
Remove the currently displayed SisypheVolume from all three view widgets.
- replaceVolume(volume: SisypheVolume) None
Replace the currently displayed SisypheVolume with a new one in all three view widgets. The new volume must have the same dimensions as the old one.
Parameters
- volumeSisypheVolume
new volume to display.
- setMeshCollection(meshes: SisypheMeshCollection) None
Set a SisypheMeshCollection for all three views.
Parameters
- meshesSisypheMeshCollection
collection of meshes to display.
- setVolume(volume: SisypheVolume) None
Set the SisypheVolume to be displayed in the three orthogonal view widgets.
Parameters
- volumeSisypheVolume
volume to display.
- class Sisyphe.widgets.multiViewWidgets.OrthogonalRegistrationViewWidget(parent: QWidget | None = None)
OrthogonalSliceViewWidget class
Description
Specialized subclass of the OrthogonalSliceViewWidget class designed for the visual assessment and manual refinement of image coregistration. It arranges three synchronized SliceRegistrationViewWidget instances in the standard axial, coronal, and sagittal layout, providing a comprehensive toolset for comparing a fixed and a moving volume.
The main features are as follows:
Interactive spyglass tool: a synchronized BoxWidget provides a “spyglass” effect across all three views. The moving volume is displayed exclusively inside the box, while the fixed volume is shown outside.
Manual registration tools: it enables interactive rigid transformations (translation and rotation) of the moving volume, allowing users to manually adjust the alignment in real-time. The moveoverlayflag is enabled by default for this purpose.
Automatic edge overlay: when adding an overlay (moving) volume, the widget automatically computes a gradient (edge) map of the fixed volume. This edge map is displayed as an additional overlay, providing an additional visual guide for aligning anatomical structures.
Synchronization: all registration-related properties—including the spyglass position, overlay transformations, and display modes—are fully synchronized across the three orthogonal views.
Inheritance
QWidget -> MultiViewWidget -> OrthogonalSliceViewWidget -> OrthogonalRegistrationViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- addOverlay(volume: SisypheVolume, alpha: float = 0.5) None
Add a SisypheVolume as an overlay for registration evaluation. This method also computes and adds a gradient (edge) version of the SisypheVolume for display. Currently, this method overrides the superclass’s implementation.
Parameters
- volumeSisypheVolume
volume to add as an overlay.
- alphafloat, optional
opacity of the overlay (0.0-1.0, default 0.5).
- class Sisyphe.widgets.multiViewWidgets.OrthogonalReorientViewWidget(parent: QWidget | None = None)
OrthogonalReorientViewWidget class
Description
Specialized subclass of the OrthogonalSliceViewWidget designed for interactively reorienting and reslicing a SisypheVolume. It provides a synchronized three-view layout (axial, coronal, and sagittal) with a set of tools for applying rigid transformations and/or defining a new field of view (FOV).
The main features are as follows:
Interactive reorientation: allows user to apply translations and rotations to the volume’s viewing planes in real-time. The effects of these transformations are visible across all three orthogonal views.
Field of view (FOV) manipulation: features a synchronized BoxWidget that visually represents the Field of View. User can interactively translate and resize this box to define a new volume orientation, size, and spacing for reslicing operations.
Synchronized reslice cursor: a reslice cursor visually represents the current orientation and intersection of the three planes, providing a consistent frame of reference during manipulation.
Customizable tools: offers full control over the appearance of the reslice cursor and the FOV box, including their color, opacity, and line width.
Synchronization: all transformations—including translations, rotations, and changes to the FOV box—are seamlessly synchronized across the axial, coronal, and sagittal views.
Inheritance
QWidget -> MultiViewWidget -> OrthogonalSliceViewWidget -> OrthogonalReorientViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- getFOVBoxVisibility() bool
Get the visibility of the Field of View (FOV) box in all three reorient view widgets.
Returns
- bool
True if the FOV box is visible, False otherwise.
- getFovBoxColor() tuple[float, float, float]
Get the color of the FOV box in all three reorient view widgets.
Returns
- tuple[float, float, float]
current RGB color of the FOV box.
- getFovBoxLineWidth() float
Get the line width of the FOV box in all three reorient view widgets.
Returns
- float
current line width of the FOV box.
- getFovBoxOpacity() float
Get the opacity of the FOV box in all three reorient view widgets.
Returns
- float
current opacity of the FOV box.
- getResliceCursorColor() tuple[float, float, float]
Get the color of the reslice cursor in all three reorient view widgets.
Returns
- tuple[float, float, float]
current RGB color of the reslice cursor.
- getResliceCursorLineWidth() float
Get the line width of the reslice cursor in all three reorient view widgets.
Returns
- float
current line width of the reslice cursor.
- getResliceCursorOpacity() float
Get the opacity of the reslice cursor in all three reorient view widgets.
Returns
- float
current opacity of the reslice cursor.
Check if slice navigation is enabled.
Returns
- bool
True if slice navigation is enabled, False otherwise.
- rotationXDisabled() None
Disable rotation around the x-axis for all three reorient view widgets.
- rotationXEnabled() None
Enable rotation around the x-axis for all three reorient view widgets.
- rotationYDisabled() None
Disable rotation around the y-axis for all three reorient view widgets.
- rotationYEnabled() None
Enable rotation around the y-axis for all three reorient view widgets.
- rotationZDisabled() None
Disable rotation around the z-axis for all three reorient view widgets.
- rotationZEnabled() None
Enable rotation around the z-axis for all three reorient view widgets.
- rotationsDisabled() None
Disable rotation interaction mode for all three reorient view widgets.
- rotationsEnabled() None
Enable rotation interaction mode for all three reorient view widgets.
- setFOVBoxVisibility(v: bool) None
Set the visibility of the Field of View (FOV) box in all three reorient view widgets.
Parameters
- vbool
True to show the FOV box, False to hide it.
- setFovBoxColor(rgb: list[float] | tuple[float, float, float]) None
Set the color of the FOV box in all three reorient view widgets.
Parameters
- rgblist[float] | tuple[float, float, float]
RGB color values (0.0-1.0).
- setFovBoxLineWidth(v: float) None
Set the line width of the FOV box in all three reorient view widgets.
Parameters
- vfloat
line width in pixels.
Raises
- TypeError
If the v parameter is not a float.
- setFovBoxOpacity(v: float) None
Set the opacity of the FOV box in all three reorient view widgets.
Parameters
- vfloat
opacity value (0.0-1.0).
Raises
- TypeError
If the v parameter is not a float.
- setResliceCursorColor(rgb: list[float] | tuple[float, float, float]) None
Set the color of the reslice cursor in all three reorient view widgets.
Parameters
- rgblist[float] | tuple[float, float, float]
RGB color values (0.0-1.0).
- setResliceCursorLineWidth(v: float) None
Set the line width of the reslice cursor in all three reorient view widgets.
Parameters
- vfloat
line width in pixels.
- setResliceCursorOpacity(v: float) None
Set the opacity of the reslice cursor in all three reorient view widgets.
Parameters
- vfloat
opacity value (0.0-1.0).
Disable slice navigation (scrolling) in all three reorient view widgets.
Enable slice navigation (scrolling) in all three reorient view widgets.
- translationsDisabled() None
Disnable translation interaction mode for all three reorient view widgets.
- translationsEnabled() None
Enable translation interaction mode for all three reorient view widgets.
- class Sisyphe.widgets.multiViewWidgets.OrthogonalSliceVolumeViewWidget(parent: QWidget | None = None)
OrthogonalSliceVolumeViewWidget class
Description
Specialized subclass of the MultiViewWidget base class, which is a composite widget that provides an integrated 2D and 3D visualization environment. It arranges four synchronized viewports in a 2x2 grid, combining three orthogonal slice views (axial, coronal, and sagittal) with a full 3D volume rendering view.
The main features are as follows:
Combined 2D/3D layout: displays a VolumeViewWidget alongside three SliceOverlayViewWidget instances.
Synchronization: all views are tightly coupled. The 3D cursor position is linked across all four views, and interactions like zooming are synchronized between the 2D slice views.
Unified data management: a single API for loading a primary SisypheVolume, which is simultaneously rendered in the 3D view and displayed in the three slice views. It also supports adding overlay volumes to the 2D views.
Integrated mesh and tractography Display: manages and displays SisypheMeshCollection (3D models) across all four views and SisypheTractCollection (streamlines) within the 3D volume view.
Direct view access: affers helper methods (getVolumeView, getAxialView, getCoronalView, getSagittalView) for direct access and control over each individual viewport.
Inheritance
QWidget -> MultiViewWidget -> OrthogonalSliceVolumeViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- addMesh(mesh: SisypheMesh) None
Add a SisypheMesh instance to all view widgets.
Parameters
- meshSisypheMesh
mesh instance to add.
- addOverlay(volume: SisypheVolume, alpha: float = 0.5) None
Add a SisypheVolume as an overlay to the three slice view widgets.
Parameters
- volumeSisypheVolume
volume to add as an overlay.
- alphafloat, optional
opacity of the overlay (0.0-1.0, default 0.5).
- getAxialView() SliceViewWidget
Get the axial slice view widget.
Returns
- SliceViewWidget
axial view widget.
- getCoronalView() SliceViewWidget
Get the coronal slice view widget.
Returns
- SliceViewWidget
coronal view widget.
- getOverlayCount() int
Get the number of overlays in the slice views.
Returns
- int
number of overlays.
- getOverlayFromIndex(index: int) SisypheVolume
Get an overlay by its index from the slice view widgets.
Parameters
- indexint
index of the overlay to retrieve.
Returns
- SisypheVolume
overlay volume at the specified index.
- getOverlayIndex(o: int | SisypheVolume) int
Get the index of a specific overlay.
Parameters
- oint | SisypheVolume
overlay to find, by index or instance.
Returns
- int
index of the overlay.
- getSagittalView() SliceViewWidget
Get the sagittal slice view widget.
Returns
- SliceViewWidget
sagittal view widget.
- getTractCollection() SisypheTractCollection
Get the SisypheTractCollection instance (streamlines collection) from the 3D volume view widget.
Returns
- SisypheTractCollection
current streamlines collection.
- getVolume() SisypheVolume
Get the currently displayed SisypheVolume.
Returns
- SisypheVolume
currently displayed volume.
- getVolumeView() VolumeViewWidget
Get the 3D volume view widget.
Returns
- VolumeViewWidget
3D volume view widget.
- hasOverlay() bool
Check if any overlays are present in the slice views.
Returns
- bool
True if at least one overlay exists, False otherwise.
- hasTracts() bool
Check if there are any streamlines (tracts) in the collection of the 3D volume view widget
Returns
- bool
True if streamlines (tracts) are present, False otherwise.
- hasVolume() bool
Check if a volume is currently displayed.
Returns
- bool
True if a volume is displayed, False otherwise.
- removeAllMeshes() None
Remove all SisypheMesh instances from all view widgets.
- removeAllOverlays() None
Remove all overlays from the three slice view widgets.
- removeMesh(mesh: SisypheMesh) None
Remove a specific SisypheMesh instance from all view widgets.
Parameters
- meshSisypheMesh
mesh instance to remove.
- removeOverlay(o: int | SisypheVolume) None
Remove a specific overlay from the three slice view widgets.
Parameters
- oint | SisypheVolume
overlay to remove, by index or instance.
- removeVolume() None
Remove the currently displayed SisypheVolume from all four view widgets.
- replaceVolume(volume: SisypheVolume) None
Replace the currently displayed SisypheVolume with a new one in all four view widgets. The new volume must have the same dimensions as the old one.
Parameters
- volumeSisypheVolume
new volume to display.
- setTractCollection(tracts: SisypheTractCollection) None
Set the SisypheTractCollection instance (streamlines collection) for the 3D volume view widget.
Parameters
- tractsSisypheTractCollection
streamlines collection to display.
- setVolume(volume: SisypheVolume) None
Set the SisypheVolume to be displayed in all four view widgets (3 slice, 1 volume rendering).
Parameters
- volumeSisypheVolume
volume to display.
- class Sisyphe.widgets.multiViewWidgets.OrthogonalTrajectoryViewWidget(parent: QWidget | None = None)
OrthogonalTrajectoryViewWidget class
Description
Advanced subclass of the OrthogonalSliceVolumeViewWidget class that introduces trajectory-based navigation and visualization.It replaces the standard 2D slice viewers with SliceTrajectoryViewWidget instances, enabling the display of slices oriented along arbitrary paths within the SisypheVolume.
The main features are as follows:
Trajectory-based slicing: the three 2D views (axial, coronal, and sagittal) can be reoriented to display slices that are perpendicular to a user-defined trajectory, offering non-orthogonal views of the data.
Dynamic camera alignment: ability to align the 2D slice views with the camera’s orientation in the 3D viewport. This creates a real-time “oblique slicer” that updates as the user rotates and navigates the 3D scene.
Multiple alignment modes, trajectories can be aligned in several ways: to the 3D view’s camera, to specific anatomical landmarks (e.g. AC-PC line), to other interactive tools or vectors, to the default axial, coronal, or sagittal planes.
Synchronization: in addition to inheriting all synchronization from its parent (cursor position, zoom, etc.), this widget ensures that all trajectory-specific properties—such as alignment mode, slab thickness, and step size—are seamlessly synchronized across all slice views and the 3D view.
Inheritance
QWidget -> MultiViewWidget -> OrthogonalSliceVolumeViewWidget -> OrthogonalTrajectoryViewWidget
Creation: 03/04/2022 Last Revision: 20/10/2025
- popupAlignmentDisabled() None
Disable the ‘Alignment’ submenu in the popup menu for all trajectory slice view widgets.
- popupAlignmentEnabled() None
Enable the ‘Alignment’ submenu in the popup menu for all trajectory slice view widgets.
- class Sisyphe.widgets.multiViewWidgets.GridViewWidget(rois: SisypheROICollection | None = None, draw: SisypheROIDraw | None = None, parent: QWidget | None = None)
GridViewWidget class
Description
Specialized subclass of the MultiViewWidget class designed for the simultaneous display of multiple slice views, with a primary focus on synchronized Region of Interest (ROI) editing. It arranges up to nine SliceROIViewWidget instances in a configurable grid. This widget serves as the base class for more specialized MultiSliceGridViewWidget and SynchronisedGridViewWidget classes.
The main features are as follows:
Unified volume display: the widget is designed to display a single SisypheVolume, with each view widget showing a slice from that volume. It provides a single API to set or replace the volume for all views simultaneously.
Integrated ROI editing: populates a 3x3 grid with SliceROIViewWidget instances that all share the same SisypheROICollection and SisypheROIDraw objects. This architecture ensures that any ROI creation, modification, or selection in one view is automatically reflected in all others.
Dynamic grid layout: manages a 3x3 grid internally, it provides a user-friendly popup menu to dynamically change the number of visible views. This allows user to adjust the layout to focus on a specific number of slices as needed.
Synchronization: it offers centralized control to set the anatomical orientation (axial, coronal, or sagittal) for all visible views at once. Standard navigation controls like zoom and cursor position are also fully synchronized across the grid.
Inheritance
QWidget -> MultiViewWidget -> GridViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- getOrientation() int
Get the orientation in the view widgets in the grid.
Returns
- int
current orientation index.
- getOrientationAsString() str
Get the orientation in the view widgets as a string.
Returns
- str
current orientation (‘axial’, ‘coronal’, or ‘sagittal’).
- getPopupMenuNumberOfVisibleViews() QMenu
Get the popup submenu for changing the number of visible views.
Returns
- QMenu
‘Number of views’ submenu.
- getViewsArrangement() tuple[int, int]
Get the current grid arrangement (rows, columns) of visible view widgets.
Returns
- tuple[int, int]
(rows, columns) of the visible grid.
- getVolume() SisypheVolume
Get the SisypheVolume displayed in the grid.
Returns
- SisypheVolume
currently displayed volume.
- hasVolume() bool
Check if a SisypheVolume is displayed in the grid.
Returns
- bool
True if a volume is displayed False otherwise.
- popupMenuNumberOfVisibleViewsHide() None
Hide the ‘Number of views’ submenu in the popup menu for all view widgets.
- popupMenuNumberOfVisibleViewsShow() None
Show the ‘Number of views’ submenu in the popup menu for all view widgets.
- popupMenuOrientationDisabled() None
Disable the ‘Orientation’ submenu in the popup menu for all view widgets.
- popupMenuOrientationEnabled() None
Enable the ‘Orientation’ submenu in the popup menu for all view widgets.
- popupMenuROIDisabled() None
Disable the ‘ROI’ tools submenu in the popup menu for all view widgets.
- popupMenuROIEnabled() None
Enable the ‘ROI’ tools submenu in the popup menu for all view widgets.
- removeVolume() None
Remove the currently displayed SisypheVolume from all view widgets in the grid.
- replaceVolume(volume: SisypheVolume) None
Replace the currently displayed SisypheVolume with a new one in all view widgets. The new volume must have the same dimensions as the old one.
Parameters
- volumeSisypheVolume
new volume to display.
- setAxialOrientation() None
Set the orientation of all view widgets in the grid to axial.
- setCoronalOrientation() None
Set the orientation of all view widgets in the grid to coronal.
- setNumberOfVisibleViews(r: int, c: int) None
Set the number of visible view widgets by specifying the grid arrangement (rows and columns).
Parameters
- rint
number of rows to display.
- cint
number of columns to display.
- setOrientation(orient: int) None
Set the orientation for all view widgets in the grid.
Parameters
- orientint
orientation index (0 for axial, 1 for coronal, 2 for sagittal).
- setSagittalOrientation() None
Set the orientation of all view widgets in the grid to sagittal.
- setVolume(volume: SisypheVolume) None
Set the SisypheVolume for all view widgets in the grid.
Parameters
- volumeSisypheVolume
volume to display.
- class Sisyphe.widgets.multiViewWidgets.MultiSliceGridViewWidget(rois: SisypheROICollection | None = None, draw: SisypheROIDraw | None = None, parent: QWidget | None = None)
MultiSliceGridViewWidget class
Description
Specialized subclass of the GridViewWidget class designed for the simultaneous visualization of multiple, consecutive slices from a single SisypheVolume. It arranges up to nine SliceROIViewWidget instances in a grid, where each view automatically displays a slice adjacent to its neighbors.
The main features are as follows:
Consecutive slice display: each view in the grid is automatically assigned an offset, allowing the widget to display a sequence of adjacent slices. This provides a “filmstrip” style view, ideal for inspecting a region of interest across several slices at once.
Full ROI integration: inheriting from GridViewWidget, it offers fully synchronized ROI editing capabilities. All views share the same ROI collection, enabling users to draw and modify a single 3D ROI across multiple 2D slices seamlessly.
Overlay functionality: supports the addition of one or more overlay volumes, which are displayed consistently across all slice views.
Synchronization: all navigation controls, including zoom, pan, and cursor position, are synchronized across all visible views. The cursor is typically shown only on the first view to provide a clear reference point.
Inheritance
QWidget -> MultiViewWidget -> GridViewWidget -> MultiSliceGridViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- addOverlay(volume: SisypheVolume, alpha: float = 0.5) None
Add a SisypheVolume as an overlay to all view widgets in the grid.
Parameters
- volumeSisypheVolume
volume to add as an overlay.
- alphafloat (optional)
opacity of the overlay (0.0-1.0, default 0.5).
- getFirstVisibleSliceIndex() int | None
Get the slice index of the first visible view widget.
Returns
- int | None
slice index, or None if no view widget is visible.
- getFirstVisibleView() AbstractViewWidget | None
Get the first visible view widget in the grid.
Returns
- AbstractViewWidget | None
first visible view widget, or None if no views are visible.
- getLastVisibleSliceIndex() int | None
Get the slice index of the last visible view.
Returns
- int | None
slice index, or None if no view widget is visible.
- getLastVisibleView() AbstractViewWidget | None
Get the last visible view widget in the grid.
Returns
- AbstractViewWidget | None
last visible view widget, or None if no views are visible.
- getOverlayFromIndex(index: int) SisypheVolume
Get an overlay by its index.
Parameters
- indexint
index of the overlay to retrieve.
Returns
- SisypheVolume
overlay volume at the specified index.
- getOverlayIndex(o: int | SisypheVolume) int
Get the index of a specific overlay.
Parameters
- oint | SisypheVolume
overlay to find, by index or instance.
Returns
- int
index of the overlay.
- hasOverlay() bool
Check if any overlays are present.
Returns
- bool
True if at least one overlay exists, False otherwise.
- removeAllOverlays() None
Remove all overlays from all view widgets.
- removeOverlay(o: int | SisypheVolume) None
Remove a specific overlay from all view widgets.
Parameters
- oint | SisypheVolume
overlay to remove, by index or instance.
- class Sisyphe.widgets.multiViewWidgets.SynchronisedGridViewWidget(rois: SisypheROICollection | None = None, draw: SisypheROIDraw | None = None, parent: QWidget | None = None)
SynchronisedGridViewWidget class
Description
Specialized subclass of the GridViewWidget class designed for the side-by-side comparison of multiple, distinct SisypheVolume instances within a single, synchronized environment.
The main features are as follows:
Multi-Volume comparison: it operates on a reference-plus-synchronized model. A primary reference volume is set, and each additional SisypheVolume is added as a “synchronized” volume, displayed in its own dedicated view within the grid. This allows for direct visual comparison of corresponding slices from different datasets.
Dynamic grid layout: the number of visible views and the grid’s dimensions automatically adapt as synchronized volumes are added or removed, ensuring an optimal layout for comparison.
Unified ROI editing: as a GridViewWidget subclass, it provides fully integrated and synchronized ROI tools. Any ROI created or modified in one view is instantly updated across all other views, allowing for consistent analysis across different volumes.
Synchronization: all interactions, including cursor movement, zoom/pan, and slice/orientation changes, are mirrored across all views.
Inheritance
QWidget -> MultiViewWidget -> GridViewWidget -> SynchronisedGridViewWidget
Creation: 03/04/2022 Last revision: 20/10/2025
- addOverlay(volume: SisypheVolume) None
Add a synchronized SisypheVolume to the grid. Each synchronized volume is displayed in a separate view widget, overlaid on the reference volume.
Parameters
- volumeSisypheVolume
volume to add for synchronized display.
- addSynchronisedVolume(volume: SisypheVolume) None
Add a synchronized SisypheVolume to the grid. Each synchronized volume is displayed in a separate view widget, overlaid on the reference volume.
Parameters
- volumeSisypheVolume
volume to add for synchronized display.
- getOverlayFromIndex(index: int) SisypheVolume
Get a synchronized volume by its index.
Parameters
- indexint
index of the synchronized volume to retrieve.
Returns
- SisypheVolume
synchronized volume at the specified index.
- getOverlayIndex(o: int | SisypheVolume)
Get the index of a specific synchronized volume.
Parameters
- oint | SisypheVolume
synchronized volume to find, by index or instance.
Returns
- int
index of the synchronized volume.
- getSynchronisedVolumeCount() int
Get the number of synchronized volumes.
Returns
- int
number of synchronized volumes.
- getSynchronisedVolumeFromIndex(index: int) SisypheVolume
Get a synchronized volume by its index.
Parameters
- indexint
index of the synchronized volume to retrieve.
Returns
- SisypheVolume
synchronized volume at the specified index.
- getSynchronisedVolumeIndex(o: int | SisypheVolume)
Get the index of a specific synchronized volume.
Parameters
- oint | SisypheVolume
synchronized volume to find, by index or instance.
Returns
- int
index of the synchronized volume.
- hasOverlay() bool
Check if any synchronized volumes are present.
Returns
- bool
True if at least one synchronized volume exists, False otherwise.
- hasSynchronisedVolume() bool
Check if any synchronized volumes are present.
Returns
- bool
True if at least one synchronized volume exists, False otherwise.
- removeAllOverlays() None
Remove all synchronized SisypheVolume instance from the grid, leaving only the reference volume.
- removeAllSynchronisedVolumes() None
Remove all synchronized SisypheVolume instance from the grid, leaving only the reference volume.
- removeOverlay(v: SisypheVolume) None
Remove a synchronized SisypheVolume from the grid.
Parameters
- vSisypheVolume
synchronized volume to remove.
- removeSynchronisedVolume(v: SisypheVolume) None
Remove a synchronized SisypheVolume from the grid.
Parameters
- vSisypheVolume
synchronized volume to remove.
- setVolume(volume: SisypheVolume) None
Set the reference SisypheVolume for the grid. This volume is displayed in the first view widget, and other views are configured to show synchronized volumes. Currently, this method calls the superclass’s implementation.
Parameters
- volumeSisypheVolume
reference SisypheVolume to display.
- class Sisyphe.widgets.projectionViewWidget.MultiProjectionViewWidget(parent: QWidget | None = None)
MultiProjectionViewWidget class
Description
Specialized subclass of the MultiViewWidget class designed to display a comprehensive and synchronized set of pre-calculated 2D projections from a single SisypheVolume.
The main features are as follows:
Comprehensive projection set: it arranges eight ProjectionViewWidget instances in a 2x4 grid. This includes the six standard external projections (left, right, anterior, posterior, top, and bottom) as well as two internal views showing the medial walls of the cerebral hemispheres, which are automatically generated by “cutting” the volume at its center.
Synchronization: navigation controls (zoom, pan), window/level adjustments, and projection parameters (operator, depth, opacity) are mirrored across the entire grid.
Inheritance
QWidget -> MultiViewWidget -> GridViewWidget -> MultiProjectionViewWidget
Creation: 12/10/2024 Last revision: 10/10/2025
- getDepthOfProjection() float
Get the projection depth.
Returns
- float
current projection depth in mm.
- getOperatorOfProjection() str
Get the projection operator.
Returns
- str
current projection operator (‘max’, ‘mean’, ‘median’, ‘std’, ‘sum’).
- getProjectionOpacity() float
Get the opacity of the foreground projection.
Returns
- float
current opacity value.
- getVolume() SisypheVolume | None
Get the original, un-projected SisypheVolume reference from the first viewport.
Returns
- SisypheVolume | None
original SisypheVolume reference, or None if not set.
- hasVolume() bool
Check if a SisypheVolume reference is set in the first viewport.
Returns
- bool
True if a reference volume is set, False otherwise.
- removeVolume() None
Remove the SisypheVolume reference and all associated data in all viewports.
- replaceVolume(foreground: SisypheVolume) None
Replace the current displayed SisypheVolume instance in all projection viewports.
Parameters
- foregroundSisypheVolume
new SisypheVolume instance to display.
- setDepthOfProjection(v: float = 0.0) None
Set the projection depth for all projection viewports.
Parameters
- vfloat, optional
projection depth in mm (default 0.0).
- setOperatorOfProjection(v: str = 'max') None
Set the projection operator for all projection viewports.
Parameters
- vstr, optional
projection operator. Must be one of ‘max’, ‘mean’, ‘median’, ‘std’, ‘sum’ (default ‘max’).
- setProjectionOpacity(alpha: float = 1.0)
Set the opacity of the foreground projection for all projection viewports.
Parameters
- alphafloat, optional
opacity value (0.0 to 1.0, default 1.0).
- setVolume(foreground: SisypheVolume, background: SisypheVolume | None = None, mask: SisypheVolume | None = None) None
Set the SisypheVolume instances for all projection viewports.
Parameters
- foregroundSisypheVolume
SisypheVolume instance to be projected and displayed.
- backgroundSisypheVolume | None, optional
SisypheVolume instance to be projected and used as a background (default None).
- maskSisypheVolume | None, optional
mask to apply before projection processing (default to None).
- updateLutFromReference() None
Update the lookup table of all projection viewports from the original SisypheVolume reference.
- updateWindowingFromReference() None
Update the windowing of all projection viewports from the original SisypheVolume reference.
- class Sisyphe.widgets.multiComponentViewWidget.MultiComponentViewWidget(parent: QWidget | None = None)
MultiComponentViewWidget class
Description
This is a specialized subclass of the MultiViewWidget class, which provides an integrated environment for the visualization and of multi-component (e.g., 4D) Sisyphe volume. It combines a grid of 2D slice views with an interactive 1D signal chart, for exploring datasets like time series.
The main features are as follows:
Multi-Component grid display: displays individual components of a SisypheVolume across a configurable grid (up to 3x3) of SliceViewWidget instances. User can navigate through the components, which are displayed sequentially in the grid.
Interactive signal chart: a Matplotlib chart located below the grid plots the signal intensity profile for the data. Key chart features include:
a dynamic curve that updates in real-time to show the signal from the voxel at the cross-shaped cursor’s position.
a static curve representing the mean signal across the entire volume.
the ability to “pin” and persist the current voxel’s curve on the chart for comparison.
a highlighted span indicating the range of components currently visible in the 2D grid.
Bidirectional interaction: the link between the grid and chart is bidirectional. Moving the cursor in a slice view updates the chart, and clicking on a saved voxel curve in the chart moves the cursor to that voxel’s location.
Export Capabilities: offers extensive options for exporting both the visual chart and its underlying data, including:
saving the chart as a bitmap image file.
copying the chart to the system clipboard.
saving the data from all plotted curves to various formats.
Synchronization: all slice views in the grid are fully synchronized for orientation, zoom, and cursor position.
Inheritance
QWidget -> MultiViewWidget -> GridViewWidget -> MultiComponentViewWidget
Creation: 10/12/2024 Last revision: 10/10/2025
- addCurrentCurveToChart() None
Add a persistent copy of the current signal curve (at the cross-shaped cursor’s position) to the chart.
- cleanChart() None
Clear the chart, removing all plotted curves, and redraws the mean signal curve and the component span.
- copyChartToClipboard() None
Copy the current chart to the system clipboard as a bitmap image.
- copyChartToScreenshot() None
Send the current chart to the associated ScreenshotsGridWidget.
- getChartVisibility() bool
Get the visibility state of the chart.
Returns
- bool
True if the chart is visible, False otherwise.
- getFirstDisplayedComponent() int
Get the index of the first component currently displayed in the grid.
Returns
- int
index of the first displayed component.
- getOrientation() int
Get the current orientation of the slice view widgets.
Returns
- int
current orientation (0 for axial, 1 for coronal, 2 for sagittal).
- getOrientationAsString() str
Get the current orientation of the slice view widgets as a string.
Returns
- str
orientation as ‘axial’, ‘coronal’, or ‘sagittal’.
- getPopupCurves() QMenu
Gets the ‘Curves’ popup menu for chart management.
Returns
- QMenu
‘Curves’ menu.
- getPopupMenuNumberOfVisibleViews() QMenu
Get the ‘Number of views’ popup menu.
Returns
- QMenu
‘Number of views’ menu.
- getScreenshotsGridWidget() ScreenshotsGridWidget
Get the associated screenshots manager widget.
Returns
- ScreenshotsGridWidget
screenshots manager widget.
- getViewsArrangement() tuple[int, int]
Get the current grid arrangement (rows, columns).
Returns
- tuple[int, int]
tuple containing the number of rows and columns.
- getVolume() SisypheVolume
Get the currently displayed multi-component SisypheVolume.
Returns
- SisypheVolume
current multi-component SisypheVolume.
- hasVolume() bool
Check if a multi-component SisypheVolume is currently displayed.
Returns
- bool
True if a SisypheVolume is displayed, False otherwise.
- popupMenuNumberOfVisibleViewsHide() None
Hide the ‘Number of views’ menu in all slice view popups.
- popupMenuNumberOfVisibleViewsShow() None
Show the ‘Number of views’ menu in all slice view popups.
- popupMenuOrientationDisabled() None
Disable the ‘Orientation’ menu in all slice view popups.
- popupMenuOrientationEnabled() None
Enable the ‘Orientation’ menu in all slice view popups.
- removeVolume() None
Remove the multi-component SisypheVolume and clears all view widgets.
- saveChart() None
Open a file dialog to save the current chart as a bitmap file (supported formats BMP, JPG, PNG, TIFF, SVG).
- saveCurveDataset() None
Open a file dialog to save the data of all curves currently plotted on the chart to a file. Supported formats include CSV, JSON, Latex, text, Excel XLSX, and PySisyphe Sheet (*.xsheet).
- setAxialOrientation() None
Set the orientation of all slice view widgets to axial.
- setChartVisibility(v: bool) None
Set the visibility of the chart.
Parameters
- vbool
True to show the chart, False to hide it.
- setCoronalOrientation() None
Set the orientation of all slice view widgets to coronal.
- setFirstDisplayedComponent(first: int) None
Set the first component to be displayed in the top-left viewport of the grid. The subsequent viewports are populated with the following components.
Parameters
- firstint
index of the first component to display.
- setNumberOfVisibleViews(r: int, c: int) None
Change the layout of the view grid.
Parameters
- rint
Number of rows.
- cint
Number of columns.
- setOrientation(orient: int) None
Set the orientation for all slice view widgets in the grid.
Parameters
- orientint
orientation to set (0 for axial, 1 for coronal, 2 for sagittal).
- setSagittalOrientation() None
Set the orientation of all slice view widgets to sagittal.
- setScreenshotsGridWidget(widget: ScreenshotsGridWidget)
Set the screenshots manager widget for exporting chart captures.
Parameters
- widgetScreenshotsGridWidget
screenshots manager widget.
- setVolume(volume: SisypheVolume) None
Set the multi-component SisypheVolume to be displayed. Populates the slice view widgets with individual components and initializes the chart.
Parameters
- volumeSisypheVolume
multi-component SisypheVolume to display.
- updateLut(lut: SisypheLut) None
Update the lookup table (LUT) and window/level for all component view widgets.
Parameters
- lutSisypheLut
new lookup table to apply.
- updateSpan() None
Update the position and width of the highlighted span on the chart, which indicates the range of currently visible components in the grid.
- visibleChartOff() None
Hide the chart.
- visibleChartOn() None
Make the chart visible.