fsleyes.displaycontext.canvasopts

This module provides the following classes:

These classes contain the definitions of properties which are available on the corresponding canvas class.

These classes are defined independently of the SliceCanvas (and other) classes so they can be inspected without having to import the slicecanvas (and other) modules, e.g. during command line argument parsing.

class fsleyes.displaycontext.canvasopts.SliceCanvasOpts[source]

Bases: __main__.MockClass

The SliceCanvasOpts class defines all of the display settings for a SliceCanvas.

pos = <MagicMock name='mock.Point()' id='3029335104'>

The currently displayed position.

The pos.x and pos.y positions denote the position of a cursor, which is highlighted with crosshairs (see the showCursor property). The pos.z position specifies the currently displayed slice.

zoom = <MagicMock name='mock.Percentage()' id='3026847008'>

The DisplayContext.bounds are divided by this zoom factor to produce the canvas display bounds.

displayBounds = <MagicMock name='mock.Bounds()' id='3030104000'>

The display bound x/y values specify the horizontal/vertical display range of the canvas, in display coordinates. This may be a larger area than the size of the displayed overlays, as it is adjusted to preserve the aspect ratio.

showCursor = <MagicMock name='mock.Boolean()' id='3031712864'>

If False, the crosshairs which show the current cursor location will not be drawn.

cursorGap = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, and the currently selected overlay is a Nifti instance, a gap will be shown at the cursor centre (i.e. the current voxel).

zax = <MagicMock name='mock.Choice()' id='3030895104'>

The display coordinate system axis to be used as the screen depth axis. The xax() and yax() attributes are derived from this property:

  • If zax == 0, xax, yax == 1, 2

  • If zax == 1, xax, yax == 0, 2

  • If zax == 2, xax, yax == 0, 1

invertX = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, the display is inverted along the X (horizontal screen) axis.

invertY = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, the display is inverted along the Y (vertical screen) axis.

cursorColour = <MagicMock name='mock.Colour()' id='3032902768'>

Canvas cursor colour.

bgColour = <MagicMock name='mock.Colour()' id='3032902768'>

Canvas background colour.

renderMode = <MagicMock name='mock.Choice()' id='3030895104'>

How the GLObject instances are rendered to the canvas.

See the SliceCanvas for more details.

highDpi = <MagicMock name='mock.Boolean()' id='3031712864'>

If FSLeyes is being displayed on a high-DPI screen, try to display the scene at full resolution.

__init__()[source]

Create a SliceCanvasOpts instance.

property xax

The display coordinate system axis which maps to the X (horizontal) canvas axis.

property yax

The display coordinate system axis which maps to the Y (vertical) canvas axis.

_SliceCanvasOpts__zaxChanged(*a)

Calle when the zax property changes. Derives the xax and yax values.

__module__ = 'fsleyes.displaycontext.canvasopts'
class fsleyes.displaycontext.canvasopts.LightBoxCanvasOpts[source]

Bases: fsleyes.displaycontext.canvasopts.SliceCanvasOpts

The LightBoxCanvasOpts class defines the display settings available on LightBoxCanvas instances.

sliceSpacing = <MagicMock name='mock.Real()' id='3030854648'>

This property controls the spacing between slices in the display coordinate system.

ncols = <MagicMock name='mock.Int()' id='3030091688'>

This property controls the number of slices to be displayed on a single row.

nrows = <MagicMock name='mock.Int()' id='3030091688'>

This property controls the number of rows to be displayed on the canvas.

topRow = <MagicMock name='mock.Int()' id='3030091688'>

This property controls the (0-indexed) row to be displayed at the top of the canvas, thus providing the ability to scroll through the slices.

__module__ = 'fsleyes.displaycontext.canvasopts'
zrange = <MagicMock name='mock.Bounds()' id='3030104000'>

This property controls the range, in display coordinates, of the slices to be displayed.

showGridLines = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, grid lines are drawn between the displayed slices.

highlightSlice = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, a box will be drawn around the slice containing the current location.

class fsleyes.displaycontext.canvasopts.Scene3DCanvasOpts(*args, **kwargs)[source]

Bases: __main__.MockClass

The Scene3DCanvasOpts class defines the display settings available on Scene3DCanvas instances.

__module__ = 'fsleyes.displaycontext.canvasopts'
pos = <MagicMock name='mock.Point()' id='3026844040'>

Current cursor position in the display coordinate system. The dimensions are in the same ordering as the display coordinate system, in contrast to the SliceCanvasOpts.pos property.

showCursor = <MagicMock name='mock.Boolean()' id='3026844088'>
cursorColour = <MagicMock name='mock.Colour()' id='3026844136'>
bgColour = <MagicMock name='mock.Colour()' id='3026844184'>
zoom = <MagicMock name='mock.Percentage()' id='3026844232'>
highDpi = <MagicMock name='mock.Boolean()' id='3026844280'>
showLegend = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, an orientation guide will be shown on the canvas.

legendColour = <MagicMock name='mock.Colour()' id='3032902768'>

Colour to use for the legend text.

occlusion = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, objects closer to the camera will occlude objects further away. Toggles gl.DEPTH_TEST.

light = <MagicMock name='mock.Boolean()' id='3031712864'>

If True, a lighting effect is applied to compatible overlays in the scene.

lightPos = <MagicMock name='mock.Point()' id='3029335104'>

Light position in the display coordinate system.

offset = <MagicMock name='mock.Point()' id='3029335104'>

An offset, in X/Y pixels normalised to the range [-1, 1], from the centre of the Scene3DCanvas.

rotation = <MagicMock name='mock.Array()' id='3030196696'>

A rotation matrix which defines the current Scene3DCanvas view orientation. This rotation is defined in terms of the display coordinate system (defined by the DisplayContext.bounds), and applied to the scene that is being displayed.