fsleyes.views.lightboxpanel

This module provides the LightBoxPanel, which displays multiple 2D slices of 3D overlays.

class fsleyes.views.lightboxpanel.LightBoxPanel(parent, overlayList, displayCtx, frame)[source]

Bases: fsleyes.views.canvaspanel.CanvasPanel

The LightBoxPanel is a FSLeyes view which is capable of displaying multiple 2D slices of the 3D overlays conatined in an OverlayList. A LightBoxPanel looks something like the following:

_images/lightboxpanel.png

The LightBoxPanel uses a LightBoxCanvas panel to display the slices, and a LightBoxOpts instance to manage the display settings. The canvas is accessed through the getCanvas() and getGLCanvases() methods, and the LightBoxOpts instanace can be retrieved via the CanvasPanel.sceneOpts() property.

The LightBoxPanel adds the following actions to those already provided by the CanvasPanel:

toggleLightBoxToolBar

Shows/hides a LightBoxToolBar.

__init__(parent, overlayList, displayCtx, frame)[source]

Create a LightBoxPanel.

Parameters
destroy()[source]

Must be called when this LightBoxPanel is closed.

Removes property listeners, destroys the LightBoxCanvas, and calls CanvasPanel.destroy().

toggleLightBoxToolBar()[source]

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

getActions()[source]

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

getGLCanvases()[source]

Returns a list containing the LightBoxCanvas contained within this LightBoxPanel.

getCanvas()[source]

Returns a reference to the LightBoxCanvas instance.

centrePanelLayout()[source]

Overrides CanvasPanel.centrePanelLayout(). Adds the scrollbar to the centre panel.

_LightBoxPanel__ncolsChanged(*a)

Called when the LightBoxOpts.ncols property changes. Calculates the number of rows to display, and updates the scrollbar.

_LightBoxPanel__onLightBoxChange(*a)

Called when any LightBoxOpts property changes.

Updates the scrollbar to reflect the change.

_LightBoxPanel__onResize(ev=None)

Called when the panel is resized. Automatically adjusts the number of rows to the maximum displayable number (given that the number of columns is fixed).

_LightBoxPanel__onScroll(*a)

Called when the scrollbar is moved.

Updates the top row displayed on the LightBoxCanvas.

_LightBoxPanel__onZoom(*a)

Called when the SceneOpts.zoom property changes. Updates the number of slice columns shown.

_LightBoxPanel__radioOrientationChanged(*a)

Called when the DisplayContext.displaySpace or DisplayContext.radioOrientation properties change. Updates the LightBoxCanvas.invertX property as needed.

_LightBoxPanel__selectedOverlayChanged(*a)

Called when the DisplayContext.selectedOverlay changes.

If the currently selected overlay is a Nifti instance, or has an associated reference image (see DisplayOpts.referenceImage()), a listener is registered on the reference image NiftiOpts.transform property, so that the __transformChanged() method will be called when it changes.

_LightBoxPanel__transformChanged(*a)

Called when the NiftiOpts.transform property for the reference image of the currently selected overlay changes.

Updates the LightBoxOpts.sliceSpacing and LightBoxOpts.zrange properties to values sensible to the new overlay display space.

__module__ = 'fsleyes.views.lightboxpanel'