fsleyes.controls.orthoedittoolbar

This module provides the OrthoEditToolBar, a ControlToolBar which displays controls for editing Image instances in an OrthoPanel.

class fsleyes.controls.orthoedittoolbar.OrthoEditToolBar(parent, overlayList, displayCtx, frame, ortho)[source]

Bases: fsleyes.controls.controlpanel.ControlToolBar

The OrthoEditToolBar is a ControlToolBar which displays controls for editing Image instances in an OrthoPanel.

An OrthoEditToolBar looks something like this:

_images/orthoedittoolbar.png

The OrthoEditToolBar exposes properties and actions which are defined on the OrthoEditProfile class, and allows the user to:

  • Change the OrthoPanel profile between view and edit mode (see the ViewPanel.profile property). When in view mode, all of the other controls are hidden.

  • Undo/redo changes to the selection and to Image instances.

  • Clear and fill the current selection.

  • Switch between a 2D and 3D selection cursor.

  • Change the selection cursor size.

  • Create a new mask/ROI Image from the current selection.

  • Switch between regular select mode, and select by intensity mode, and adjust the select by intensity mode settings.

All of the controls shown on an OrthoEditToolBar instance are defined in the _TOOLBAR_SPECS dictionary.

selint = <MagicMock name='mock.Boolean()' id='140572303765904'>

This property allows the user to change the OrthoEditProfile between sel mode, and selint mode.

__init__(parent, overlayList, displayCtx, frame, ortho)[source]

Create an OrthoEditToolBar.

Parameters
destroy()[source]

Must be called when this OrthoEditToolBar is no longer needed. Removes property listeners, and calls the ControlToolBar.destroy() method.

static supportedViews()[source]

Overrides ControlMixin.supportedViews(). The OrthoEditToolBar is only intended to be added to OrthoPanel views.

__profileChanged(*a)

Called when the ViewPanel.profile property of the OrthoPanel changes. Shows/hides edit controls accordingly.

__annotations__ = {}
__module__ = 'fsleyes.controls.orthoedittoolbar'
fsleyes.controls.orthoedittoolbar._LABELS = {'fillValue': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'intensityThres': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'searchRadius': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'selectionCursorColour': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'selectionOverlayColour': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'selectionSize': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'targetImage': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>}

This dictionary contains labels for some OrthoEditToolBar controls. It is referenced in the _TOOLBAR_SPECS dictionary.

fsleyes.controls.orthoedittoolbar._ICONS = {'drawMode': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/drawModeHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/drawMode24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selectModeHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selectMode24.png'], 'limitToRadius': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/radiusHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/radius24.png'], 'localFill': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/localsearchHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/localsearch24.png'], 'mode': {'desel': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/eraserHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/eraser24.png'], 'fill': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/bucketHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/bucket24.png'], 'nav': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/addHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/add24.png'], 'sel': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/pencilHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/pencil24.png'], 'selint': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selectByIntensityHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selectByIntensity24.png']}, 'selectionIs3D': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selection3DHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selection3D24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selection2DHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selection2D24.png'], 'selint': ['/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selectByIntensityHighlight24.png', '/builddir/build/BUILD/fsleyes-0.34.2/apidoc/../fsleyes/../assets/icons/selectByIntensity24.png']}

This dictionary contains icons for some OrthoEditToolBar controls. It is referenced in the _TOOLBAR_SPECS dictionary.

fsleyes.controls.orthoedittoolbar._TOOLTIPS = {'drawMode': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'fillValue': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'intensityThres': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'limitToRadius': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'localFill': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'mode': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'searchRadius': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'selectionIs3D': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'selectionSize': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>, 'targetImage': <MagicMock name='mock.TypeDict().__getitem__()' id='140572299944064'>}

This dictionary contains tooltips for some OrthoEditToolBar controls. It is referenced in the _TOOLBAR_SPECS dictionary.

fsleyes.controls.orthoedittoolbar._targetImageName(image)[source]
fsleyes.controls.orthoedittoolbar._TOOLBAR_SPECS = [<MagicMock name='mock.Widget()' id='140572301403296'>, 'div', <MagicMock name='mock.Widget()' id='140572301403296'>, 'div', <MagicMock name='mock.Widget()' id='140572301403296'>, <MagicMock name='mock.Widget()' id='140572301403296'>, <MagicMock name='mock.Widget()' id='140572301403296'>, [<MagicMock name='mock.Widget()' id='140572301403296'>, <MagicMock name='mock.Widget()' id='140572301403296'>], [<MagicMock name='mock.Widget()' id='140572301403296'>, <MagicMock name='mock.Widget()' id='140572301403296'>], <MagicMock name='mock.Widget()' id='140572301403296'>]

This list contains specifications for all of the tools shown in an OrthoEditToolBar, in the order that they are shown.

Some specs are grouped together into sub-lists - these will be laid out vertically on the toolbar.