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>.MockClassThe
SliceCanvasOptsclass defines all of the display settings for aSliceCanvas.-
pos= <MagicMock name='mock.Point()' id='4116283672'>¶ The currently displayed position.
The
pos.xandpos.ypositions denote the position of a cursor, which is highlighted with crosshairs (see theshowCursorproperty). Thepos.zposition specifies the currently displayed slice.
-
zoom= <MagicMock name='mock.Percentage()' id='4116877904'>¶ The
DisplayContext.boundsare divided by this zoom factor to produce the canvas display bounds.
-
displayBounds= <MagicMock name='mock.Bounds()' id='4116394552'>¶ 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='4117273880'>¶ If
False, the crosshairs which show the current cursor location will not be drawn.
-
cursorGap= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, and the currently selected overlay is aNiftiinstance, a gap will be shown at the cursor centre (i.e. the current voxel).
-
zax= <MagicMock name='mock.Choice()' id='4117029600'>¶ 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, 2If
zax == 1,xax, yax == 0, 2If
zax == 2,xax, yax == 0, 1
-
invertX= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, the display is inverted along the X (horizontal screen) axis.
-
invertY= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, the display is inverted along the Y (vertical screen) axis.
-
cursorColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Canvas cursor colour.
-
bgColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Canvas background colour.
-
renderMode= <MagicMock name='mock.Choice()' id='4117029600'>¶ How the
GLObjectinstances are rendered to the canvas.See the
SliceCanvasfor more details.
-
highDpi= <MagicMock name='mock.Boolean()' id='4117273880'>¶ 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.
-
__module__= 'fsleyes.displaycontext.canvasopts'¶
-
-
class
fsleyes.displaycontext.canvasopts.LightBoxCanvasOpts[source]¶ Bases:
fsleyes.displaycontext.canvasopts.SliceCanvasOptsThe
LightBoxCanvasOptsclass defines the display settings available onLightBoxCanvasinstances.-
sliceSpacing= <MagicMock name='mock.Real()' id='4116054224'>¶ This property controls the spacing between slices in the display coordinate system.
-
ncols= <MagicMock name='mock.Int()' id='4116300320'>¶ This property controls the number of slices to be displayed on a single row.
-
nrows= <MagicMock name='mock.Int()' id='4116300320'>¶ This property controls the number of rows to be displayed on the canvas.
-
topRow= <MagicMock name='mock.Int()' id='4116300320'>¶ 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='4116394552'>¶ This property controls the range, in display coordinates, of the slices to be displayed.
-
showGridLines= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, grid lines are drawn between the displayed slices.
-
__module__= 'fsleyes.displaycontext.canvasopts'¶
-
highlightSlice= <MagicMock name='mock.Boolean()' id='4117273880'>¶ 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>.MockClassThe
Scene3DCanvasOptsclass defines the display settings available onScene3DCanvasinstances.-
__module__= 'fsleyes.displaycontext.canvasopts'¶
-
pos= <MagicMock name='mock.Point()' id='4116046440'>¶ 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.posproperty.
-
showCursor= <MagicMock name='mock.Boolean()' id='4116046488'>¶
-
cursorColour= <MagicMock name='mock.Colour()' id='4116046536'>¶
-
bgColour= <MagicMock name='mock.Colour()' id='4116046584'>¶
-
zoom= <MagicMock name='mock.Percentage()' id='4116046632'>¶
-
highDpi= <MagicMock name='mock.Boolean()' id='4116046680'>¶
-
showLegend= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, an orientation guide will be shown on the canvas.
-
legendColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour to use for the legend text.
-
labelSize= <MagicMock name='mock.Int()' id='4116300320'>¶ Font size used for the legend labels.
-
occlusion= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, objects closer to the camera will occlude objects further away. Togglesgl.DEPTH_TEST.
-
light= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, a lighting effect is applied to compatible overlays in the scene.
-
showLight= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, a point is drawn at the current light position.
-
lightPos= <MagicMock name='mock.Point()' id='4116283672'>¶ 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
lightDistanceproperty.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='4116054224'>¶ 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='4116283672'>¶ An offset, in X/Y pixels normalised to the range
[-1, 1], from the centre of theScene3DCanvas.
-
rotation= <MagicMock name='mock.Array()' id='4116014608'>¶ A rotation matrix which defines the current
Scene3DCanvasview 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
Scene3DViewProfileclass.
-