fsleyes.plugins.controls.annotationpanel
This module contains the AnnotationPanel
class, a FSLeyes control
panel which allows the user to annotate the canvases of an
OrthoPanel
.
- class fsleyes.plugins.controls.annotationpanel.AnnotationPanel(parent, overlayList, displayCtx, ortho)[source]
Bases:
fsleyes.controls.controlpanel.ControlPanel
The
AnnotationPanel
contains controls allowing the user to add annotations to the canvases in anOrthoPanel
. The user is able to add points, lines, rectangles, ellipses, and text to any canvas, and can adjust the properties (e.g. colour, thickness) of each annotation.When a user selects an annotation to add, the
OrthoAnnotateProfile
is enabled on theOrthoPanel
, which provides user interaction.The
SaveAnnotationsAction
andLoadAnnotationsAction
actions, for saving/loading annotations to/from files, are bound to buttons in theAnnotationPanel
.- colour = <MagicMock name='mock.Colour()' id='140112341054512'>
- fontSize = <MagicMock name='mock.Int()' id='140112341054608'>
- lineWidth = <MagicMock name='mock.Int()' id='140112341041600'>
- filled = <MagicMock name='mock.Boolean()' id='140112341041648'>
- border = <MagicMock name='mock.Boolean()' id='140112341041696'>
- honourZLimits = <MagicMock name='mock.Boolean()' id='140112341041744'>
- alpha = <MagicMock name='mock.Percentage()' id='140112341041792'>
- DISPLAY_PROPERTIES = ['colour', 'fontSize', 'lineWidth', 'filled', 'border', 'honourZLimits', 'alpha']
- static supportedViews()[source]
Overrides
ControlMixin.supportedViews()
. TheCropImagePanel
is only intended to be added toOrthoPanel
views.
- static profileCls()[source]
Returns the
OrthoAnnotateProfile
class, which needs to be activated in conjunction with theAnnotationPanel
.
- static defaultLayout()[source]
Returns a dictionary containing layout settings to be passed to
ViewPanel.togglePanel
.
- __init__(parent, overlayList, displayCtx, ortho)[source]
Create an
AnnotationPanel
.- Parameters
parent – The
wx
parent object.overlayList – The
OverlayList
instance.displayCtx – The
DisplayContext
instance.ortho – The
OrthoPanel
instance.
- destroy()[source]
Must be called when this
AnnoationPanel
is no longer needed. Removes property listeners and clears references.
- __annotationsChanged(*a)
Called when the
Annotations.annotations
list of anySliceCanvas
changes. Makes sure that the contents of the annotations list box is up to date, and selects the most recently added annotation.
- __displayPropertyChanged(*a)
Called when any display property changes. Refreshes all canvases.
- __onRemove(ev)
Called when the “remove item” button is pushed. Removes the item from the list box widget, and from the corresponding
Annotations.annotations
list.
- __onMoveUp(ev)
Called when the “move item up” button is pushed.
- __onMoveDown(ev)
Called when the “move item down” button is pushed.
- __onMove(offset)
Called when one of the move buttons is pushed. Moves the item in the list box, then syncs the new item order on the corresponding
Annotations.annotations
list.
- __annotListItemSelected(ev=None, obj=None)
Called when an item is selected in the annotations listbox, or programmatically at various times. If the properties of an
AnnotationObject
are bound to the display settings widgets, they are unbound. If an annotation has been selected in the annotations list box, the display settings widgets are bound to its properties.
- __onAnnotOption(ev)
Called when the user selects an annnotation type to draw. Changes the
OrthoAnnotateProfile
mode.
- __annotations__ = {}
- __module__ = 'fsleyes.plugins.controls.annotationpanel'