fsleyes.gl.ortholabels

This module provides the OrthoLabels class, which manages anatomical orientation labels for an OrthoPanel.

This logic is independent from the OrthoPanel so it can be used in off-screen rendering (see render).

class fsleyes.gl.ortholabels.OrthoLabels(overlayList, displayCtx, orthoOpts, *canvases)[source]

Bases: object

The OrthoLabels class manages anatomical orientation labels which are displayed on a set of three SliceCanvas instances, one for each plane in the display coordinate system, typically within an OrthoPanel.

The OrthoLabels class uses annotations.Text annotations, showing the user the anatomical orientation of the display on each canvas. These labels are only shown if the currently selected overlay (as dicated by the DisplayContext.selectedOverlay property) is a Image instance, or the DisplayOpts.referenceImage() property for the currently selected overlay returns an Image instance.

__init__(overlayList, displayCtx, orthoOpts, *canvases)[source]

Create an OrthoLabels instance.

Parameters
destroy()[source]

Must be called when this OrthoLabels instance is no longer needed.

refreshLabels()[source]

Forces the label annotations to be refreshed.

_OrthoLabels__overlayListChanged(*a)

Called when the OverlayList changes. Registers a listener on the attr:.DisplayOpts.bounds` property of every overlay in the list, so the labels are refreshed when any overlay bounds change.

_OrthoLabels__refreshLabels(*a)

Updates the attributes of the Text anatomical orientation annotations on each SliceCanvas.

__dict__ = mappingproxy({'__module__': 'fsleyes.gl.ortholabels', '__doc__': 'The ``OrthoLabels`` class manages anatomical orientation labels which\n are displayed on a set of three :class:`.SliceCanvas` instances, one for\n each plane in the display coordinate system, typically within an\n :class:`.OrthoPanel`.\n\n The ``OrthoLabels`` class uses :class:`.annotations.Text` annotations,\n showing the user the anatomical orientation of the display on each\n canvas. These labels are only shown if the currently selected overlay (as\n dicated by the :attr:`.DisplayContext.selectedOverlay` property) is a\n :class:`.Image` instance, **or** the\n :meth:`.DisplayOpts.referenceImage` property for the currently selected\n overlay returns an :class:`.Image` instance.\n ', '__init__': <function OrthoLabels.__init__>, 'destroy': <function OrthoLabels.destroy>, 'refreshLabels': <function OrthoLabels.refreshLabels>, '_OrthoLabels__overlayListChanged': <function OrthoLabels.__overlayListChanged>, '_OrthoLabels__refreshLabels': <function OrthoLabels.__refreshLabels>, '__dict__': <attribute '__dict__' of 'OrthoLabels' objects>, '__weakref__': <attribute '__weakref__' of 'OrthoLabels' objects>})
__module__ = 'fsleyes.gl.ortholabels'
__weakref__

list of weak references to the object (if defined)