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__.MockClassThe
SliceCanvasOptsclass defines all of the display settings for aSliceCanvas.-
pos= <MagicMock name='mock.Point()' id='281473494796800'>¶ 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='281473488836064'>¶ The
DisplayContext.boundsare divided by this zoom factor to produce the canvas display bounds.
-
displayBounds= <MagicMock name='mock.Bounds()' id='281473494326624'>¶ 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='281473497326640'>¶ If
False, the crosshairs which show the current cursor location will not be drawn.
-
cursorGap= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ 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='281473498355456'>¶ 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='281473497326640'>¶ If
True, the display is inverted along the X (horizontal screen) axis.
-
invertY= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ If
True, the display is inverted along the Y (vertical screen) axis.
-
cursorColour= <MagicMock name='mock.Colour()' id='281473498033216'>¶ Canvas cursor colour.
-
bgColour= <MagicMock name='mock.Colour()' id='281473498033216'>¶ Canvas background colour.
-
renderMode= <MagicMock name='mock.Choice()' id='281473498355456'>¶ How the
GLObjectinstances are rendered to the canvas.See the
SliceCanvasfor more details.
-
highDpi= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ 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.
-
_SliceCanvasOpts__zaxChanged(*a)¶ Calle when the
zaxproperty changes. Derives thexaxandyaxvalues.
-
__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='281473497926576'>¶ This property controls the spacing between slices in the display coordinate system.
-
ncols= <MagicMock name='mock.Int()' id='281473494293760'>¶ This property controls the number of slices to be displayed on a single row.
-
nrows= <MagicMock name='mock.Int()' id='281473494293760'>¶ This property controls the number of rows to be displayed on the canvas.
-
topRow= <MagicMock name='mock.Int()' id='281473494293760'>¶ 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='281473494326624'>¶ This property controls the range, in display coordinates, of the slices to be displayed.
-
showGridLines= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ If
True, grid lines are drawn between the displayed slices.
-
highlightSlice= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ If
True, a box will be drawn around the slice containing the current location.
-
-
class
fsleyes.displaycontext.canvasopts.Scene3DCanvasOpts(*args, **kwargs)[source]¶ Bases:
__main__.MockClassThe
Scene3DCanvasOptsclass defines the display settings available onScene3DCanvasinstances.-
__module__= 'fsleyes.displaycontext.canvasopts'¶
-
pos= <MagicMock name='mock.Point()' id='281473492586608'>¶ 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='281473492586704'>¶
-
cursorColour= <MagicMock name='mock.Colour()' id='281473492586752'>¶
-
bgColour= <MagicMock name='mock.Colour()' id='281473492586800'>¶
-
zoom= <MagicMock name='mock.Percentage()' id='281473492586848'>¶
-
highDpi= <MagicMock name='mock.Boolean()' id='281473492586896'>¶
-
showLegend= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ If
True, an orientation guide will be shown on the canvas.
-
legendColour= <MagicMock name='mock.Colour()' id='281473498033216'>¶ Colour to use for the legend text.
-
occlusion= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ If
True, objects closer to the camera will occlude objects further away. Togglesgl.DEPTH_TEST.
-
light= <MagicMock name='mock.Boolean()' id='281473497326640'>¶ If
True, a lighting effect is applied to compatible overlays in the scene.
-
lightPos= <MagicMock name='mock.Point()' id='281473494796800'>¶ Light position in the display coordinate system.
-
offset= <MagicMock name='mock.Point()' id='281473494796800'>¶ An offset, in X/Y pixels normalised to the range
[-1, 1], from the centre of theScene3DCanvas.
-
rotation= <MagicMock name='mock.Array()' id='281473492607232'>¶ 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.
-