fsleyes.displaycontext.canvasopts
This module provides the following classes:
SliceCanvasOpts
(for theSliceCanvas
)
LightBoxCanvasOpts
(for theLightBoxCanvas
)
Scene3DCanvasOpts
(for theScene3DCanvas
)
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__.docbuilder.run.<locals>.MockClass
The
SliceCanvasOpts
class defines all of the display settings for aSliceCanvas
.- pos = <MagicMock name='mock.Point()' id='140112348170080'>
The currently displayed position.
The
pos.x
andpos.y
positions denote the position of a cursor, which is highlighted with crosshairs (see theshowCursor
property). Thepos.z
position specifies the currently displayed slice.
- zoom = <MagicMock name='mock.Percentage()' id='140112347290672'>
The
DisplayContext.bounds
are divided by this zoom factor to produce the canvas display bounds.
- displayBounds = <MagicMock name='mock.Bounds()' id='140112347388352'>
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='140112348499920'>
If
False
, the crosshairs which show the current cursor location will not be drawn.
- cursorGap = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, and the currently selected overlay is aNifti
instance, a gap will be shown at the cursor centre (i.e. the current voxel).
- zax = <MagicMock name='mock.Choice()' id='140112346301776'>
The display coordinate system axis to be used as the screen depth axis. The
xax()
andyax()
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='140112348499920'>
If
True
, the display is inverted along the X (horizontal screen) axis.
- invertY = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, the display is inverted along the Y (vertical screen) axis.
- cursorColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Canvas cursor colour.
- bgColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Canvas background colour.
- renderMode = <MagicMock name='mock.Choice()' id='140112346301776'>
How the
GLObject
instances are rendered to the canvas.See the
SliceCanvas
for more details.
- highDpi = <MagicMock name='mock.Boolean()' id='140112348499920'>
If FSLeyes is being displayed on a high-DPI screen, try to display the scene at full resolution.
- 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.
- __annotations__ = {}
- __module__ = 'fsleyes.displaycontext.canvasopts'
- class fsleyes.displaycontext.canvasopts.LightBoxCanvasOpts[source]
Bases:
fsleyes.displaycontext.canvasopts.SliceCanvasOpts
The
LightBoxCanvasOpts
class defines the display settings available onLightBoxCanvas
instances.- sliceSpacing = <MagicMock name='mock.Real()' id='140112346269392'>
This property controls the spacing between slices in the display coordinate system.
- ncols = <MagicMock name='mock.Int()' id='140112348001424'>
This property controls the number of slices to be displayed on a single row.
- nrows = <MagicMock name='mock.Int()' id='140112348001424'>
This property controls the number of rows to be displayed on the canvas.
- topRow = <MagicMock name='mock.Int()' id='140112348001424'>
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.
- zrange = <MagicMock name='mock.Bounds()' id='140112347388352'>
This property controls the range, in display coordinates, of the slices to be displayed.
- showGridLines = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, grid lines are drawn between the displayed slices.
- __annotations__ = {}
- __module__ = 'fsleyes.displaycontext.canvasopts'
- highlightSlice = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, a box will be drawn around the slice containing the current location.
- class fsleyes.displaycontext.canvasopts.Scene3DCanvasOpts(*args, **kwargs)[source]
Bases:
__main__.docbuilder.run.<locals>.MockClass
The
Scene3DCanvasOpts
class defines the display settings available onScene3DCanvas
instances.- __annotations__ = {}
- __module__ = 'fsleyes.displaycontext.canvasopts'
- pos = <MagicMock name='mock.Point()' id='140112346404688'>
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='140112346404784'>
- cursorColour = <MagicMock name='mock.Colour()' id='140112346404832'>
- bgColour = <MagicMock name='mock.Colour()' id='140112346404880'>
- zoom = <MagicMock name='mock.Percentage()' id='140112346404928'>
- highDpi = <MagicMock name='mock.Boolean()' id='140112346404976'>
- showLegend = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, an orientation guide will be shown on the canvas.
- legendColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Colour to use for the legend text.
- labelSize = <MagicMock name='mock.Int()' id='140112348001424'>
Font size used for the legend labels.
- occlusion = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, objects closer to the camera will occlude objects further away. Togglesgl.DEPTH_TEST
.
- light = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, a lighting effect is applied to compatible overlays in the scene.
- showLight = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, a point is drawn at the current light position.
- lightPos = <MagicMock name='mock.Point()' id='140112348170080'>
Defines the light position in the display coordinate system. This property contains a set of three rotation values, in degrees.
The lighting model uses a point source which is located a fixed distance away from the display coordinate system centre - the distance is set by the
lightDistance
property.The lightPos property defines how the light is rotated with respect to the centre of the display coordinate system.
The
Scene3DCanvas.lightPos()
method can be used to calculate the actual position of the light in the display coordinate system.
- lightDistance = <MagicMock name='mock.Real()' id='140112346269392'>
Distance of the light source from the centre of the display coordinate system. This is used as a multiplicative factor - a value of 2 set the light source a distance of twice the length of the display bounding box from the bounding box centre.
- offset = <MagicMock name='mock.Point()' id='140112348170080'>
An offset, in X/Y pixels normalised to the range
[-1, 1]
, from the centre of theScene3DCanvas
.
- rotation = <MagicMock name='mock.Array()' id='140112346787424'>
A rotation matrix which defines the current
Scene3DCanvas
view orientation. This rotation is defined in terms of the display coordinate system (defined by theDisplayContext.bounds
), and applied to the scene that is being displayed.We use a rotation matrix here because it makes iterative updates of the camera position easier - see the
Scene3DViewProfile
class.