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.ControlPanelThe
AnnotationPanelcontains 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
OrthoAnnotateProfileis enabled on theOrthoPanel, which provides user interaction.The
SaveAnnotationsActionandLoadAnnotationsActionactions, for saving/loading annotations to/from files, are bound to buttons in theAnnotationPanel.-
colour= <MagicMock name='mock.Colour()' id='4022090000'>¶
-
fontSize= <MagicMock name='mock.Int()' id='4022090168'>¶
-
lineWidth= <MagicMock name='mock.Int()' id='4022090216'>¶
-
filled= <MagicMock name='mock.Boolean()' id='4022090264'>¶
-
border= <MagicMock name='mock.Boolean()' id='4022393488'>¶
-
honourZLimits= <MagicMock name='mock.Boolean()' id='4022679440'>¶
-
alpha= <MagicMock name='mock.Percentage()' id='4022678048'>¶
-
DISPLAY_PROPERTIES= ['colour', 'fontSize', 'lineWidth', 'filled', 'border', 'honourZLimits', 'alpha']¶
-
static
supportedViews()[source]¶ Overrides
ControlMixin.supportedViews(). TheCropImagePanelis only intended to be added toOrthoPanelviews.
-
static
profileCls()[source]¶ Returns the
OrthoAnnotateProfileclass, 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
wxparent object.overlayList – The
OverlayListinstance.displayCtx – The
DisplayContextinstance.ortho – The
OrthoPanelinstance.
-
destroy()[source]¶ Must be called when this
AnnoationPanelis no longer needed. Removes property listeners and clears references.
-
__annotationsChanged(*a)¶ Called when the
Annotations.annotationslist of anySliceCanvaschanges. 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.annotationslist.
-
__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.annotationslist.
-
__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
AnnotationObjectare 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
OrthoAnnotateProfilemode.
-
__module__= 'fsleyes.plugins.controls.annotationpanel'¶
-