fsleyes.plugins.profiles.orthoannotateprofile

This module provides the OrthoAnnotateProfile class, an interaction Profile for OrthoPanel views.

class fsleyes.plugins.profiles.orthoannotateprofile.OrthoAnnotateProfile(viewPanel, overlayList, displayCtx)[source]

Bases: fsleyes.profiles.orthoviewprofile.OrthoViewProfile

The OrthoAnnotateProfile class is a Profile for the OrthoPanel class, which allows the user to annotate the canvases of an OrthoPanel with simple shapes and text.

colour = <MagicMock name='mock.Colour()' id='139907480554896'>

Initial colour to give all annotations.

lineWidth = <MagicMock name='mock.Int()' id='139907480554800'>

Initial width to give line-based annotations.

fontSize = <MagicMock name='mock.Int()' id='139907480554752'>

Initial font size to give text annotations.

filled = <MagicMock name='mock.Boolean()' id='139907480554704'>

Whether ellipses/rectangles are filled in or not.

border = <MagicMock name='mock.Boolean()' id='139907480554656'>

Whether ellipses/rectangles are drawn with a border or not.

honourZLimits = <MagicMock name='mock.Boolean()' id='139907480554608'>

Whether annotations are drawn when outside their Z limits.

alpha = <MagicMock name='mock.Percentage()' id='139907480554560'>

Opacity.

static tempModes()[source]

Returns the temporary mode map for the OrthoAnnotateProfile, which controls the use of modifier keys to temporarily enter other interaction modes.

static altHandlers()[source]

Returns the alternate handlers map, which allows event handlers defined in one mode to be re-used whilst in another mode.

__init__(viewPanel, overlayList, displayCtx)[source]

Create an OrthoAnnotateProfile.

Parameters
__initialSettings(canvas, canvasPos)

Returns a dictionary containing some initial settings with which all new annotations are created.

__displaySize(size, squared)

Display the given size (length or area) in the FSLeyesFrame status bar.

Parameters
  • size – Size to display

  • squared – If True, ^2 is shown after the size value (use if the size is an area).

_moveModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]

If the mouse lands on an annotation, save a reference to it so it can be moved on mouse drag.

_moveModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]

Move the annotation that was clicked on.

_moveModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]

Clears the reference to the annotation that was being moved.

_lineModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]

Adds a new line annotation.

_lineModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]

Adjust the line end point so it tracks the mouse location.

_lineModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]

Clear a reference to the newly created line. If the mouse hasn’t moved since mouse down, the line is deleted.

_arrowModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]

Adds a new arrow annotation.

_arrowModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]

Adjust the arrow end point so it tracks the mouse location.

_arrowModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]

Clear a reference to the newly created arrow. If the mouse hasn’t moved since mouse down, the arrow is deleted.

_pointModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]

Creates a new point annotation.

_pointModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]

Changes the location of the point annotation to track the mouse drag location.

_pointModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]

Clear a reference to the newly created point annotation.

__annotations__ = {}
__module__ = 'fsleyes.plugins.profiles.orthoannotateprofile'
_textModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]

Show a dialog prompting the user for some text, then creates a new text annotation.

_rectModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]

Create a new rectangle annotation.

_rectModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]

Adjust the size of the rectangle with the mouse drag.

_rectModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]

Clear the reference to the new rectangle annotation. If the rectangle has no area (the user clicked without dragging), the rectangle is deleted.

_ellipseModeLeftMouseDown(ev, canvas, mousePos, canvasPos)[source]

Create a new ellipse annotation.

_ellipseModeLeftMouseDrag(ev, canvas, mousePos, canvasPos)[source]

Adjust the ellipse radius with the mouse drag.

_ellipseModeLeftMouseUp(ev, canvas, mousePos, canvasPos)[source]

Clear the reference to the new ellipse annotation. If the ellipse has no area (the user clicked without dragging), the ellipse is deleted.