fsleyes.controls.colourbar¶
This module provides the ColourBar class, which generates a bitmap
rendering of a colour bar.
-
fsleyes.controls.colourbar.colourBarMinorAxisSize(fontSize)[source]¶ Calculates a good size for the minor axis of a colour bar.
The minor axis is the axis perpendicular to the colour bar axis.
- Parameters
fontSize – Font size of colour bar labels, in points.
-
class
fsleyes.controls.colourbar.ColourBar(overlayList, displayCtx)[source]¶ Bases:
__main__.docbuilder.run.<locals>.MockClass,__main__.docbuilder.run.<locals>.MockClassA
ColourBaris an object which listens to the properties of aColourMapOptsinstance, and automatically generates a colour bar bitmap representing the current colour map properties.Whenever the colour bar is refreshed, a notification is emitted via the
Notifierinterface.-
orientation= <MagicMock name='mock.Choice()' id='4117029600'>¶ Whether the colour bar should be vertical or horizontal.
-
labelSide= <MagicMock name='mock.Choice()' id='4117029600'>¶ Whether the colour bar labels should be on the top/left, or bottom/right of the colour bar (depending upon whether the colour bar orientation is horizontal/vertical).
-
textColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour to use for the colour bar label.
-
bgColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour to use for the background.
-
showLabel= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Toggle the colour bar label (the
Display.nameproperty).
-
showTicks= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Toggle the tick labels (the
ColourMapOpts.displayRange).
-
fontSize= <MagicMock name='mock.Int()' id='4116300320'>¶ Size of the font used for the text on the colour bar.
-
__init__(overlayList, displayCtx)[source]¶ Create a
ColourBar.- Parameters
overlayList – The
OverlayList.displayCtx – The
DisplayContext.
-
__module__= 'fsleyes.controls.colourbar'¶
-
property
name¶ Return the name of this ColourBar, used internally for registering property listeners.
-
destroy()[source]¶ Must be called when this
ColourBaris no longer needed.Removes all registered listeners from the
OverlayList,DisplayContext, and foom individual overlays.
-
__selectedOverlayChanged(*a)¶ Called when the
OverlayListor theDisplayContext.selectedOverlaychanges.If the newly selected overlay is being displayed with a
ColourMapOptsinstance, various property listeners are registered, and the colour bar is refreshed.
-
__deregisterOverlay()¶ Called when the selected overlay changes. De-registers property listeners from any previously-registered
ColourMapOptsinstance.
-
__registerOverlay()¶ Called when the selected overlay changes. Registers property listeners with the
ColourMapOptsinstance associated with the newly selected overlay.
-
__clearColourBar(*a)¶ Clears any previously generated colour bar bitmap.
-