fsleyes.controls.atlasoverlaypanel
¶
This module provides the AtlasOverlayPanel
, which is a sub-panel
used by the AtlasPanel
.
-
class
fsleyes.controls.atlasoverlaypanel.
AtlasOverlayPanel
(parent, overlayList, displayCtx, frame, atlasPanel)¶ Bases:
fsleyes.panel.FSLeyesPanel
The
AtlasOverlayPanel
displays a list of all available FSL atlases (see theatlases
module), and allows the user to:Search across all atlases for regions, by name.
Toggle overlays for atlases, and for individual regions from any atlas.
Move the
DisplayContext.location
to any region from any atlas.
An
AtlasOverlayPanel
looks something like this:The
AtlasOverlayPanel
has three main sections:The atlas list - a
fsleyes_widgets.elistbox.EditableListBox
with an entry, and anOverlayListWidget
for every available atlas. TheOverlayListWidget
allows the user to turn on/off a summary overlay image for the atlas (see the section on atlas panel overlays).The region list - an
EditableListBox
which contains one entry for every region in the atlas that is currently selected in the atlas list, and anOverlayListWidget
alongside every region. TheOverlayListWidget
allows the user to navigate to a region, and to turn on/off a label or probabilistic region overlay.The region filter - a
wx.TextCtrl
located above the region list. This allows the user to search for regions by name. When the user types a string into this field, the region list will be updated to show only regions that match the entered string (via a simple substring match), and the atlas list will be updated such that all atlases which have matching regions will be highlighted in bold.
-
__init__
(parent, overlayList, displayCtx, frame, atlasPanel)¶ Create an
AtlasOverlayPanel
.- Parameters
parent – the
wx
parent object.overlayList – The
OverlayList
instance.displayCtx – The
DisplayContext
instance.frame – The
FSLeyesFrame
instance.atlasPanel – The
AtlasPanel
instance that has created thisAtlasInfoPanel
.
-
destroy
()¶ Performs some clean up operations.
-
Enable
(enable=True)¶ Enables/disables this
AtlasOverlayPanel
.
-
Disable
()¶ Disables this
AtlasOverlayPanel
.
-
setOverlayState
(atlasDesc, labelIdx, summary, state)¶ Updates the enabled state of the specified atlas overlay.
This method is called by the
AtlasPanel
when an atlas overlay is added/removed to/from theOverlayList
. It ensures that theOverlayListWidget
controls for every atlas, and every region, are up to date.
-
selectAtlas
(atlasDesc)¶ Selects the specified atlas. This method is used by
OverlayListWidget
instances.- Parameters
atlasID – The atlas identifier
-
_AtlasOverlayPanel__atlasAdded
(*a)¶ Called when a new atlas is added to the
AtlasRegistry
. Re-generates the atlas list.
-
_AtlasOverlayPanel__atlasRemoved
(*a)¶ Called when an atlas is removed from the
AtlasRegistry
. Re-generates the atlas list.
-
_AtlasOverlayPanel__buildAtlasList
()¶ Clears and recreates the atlas list. Also clears all existing region lists.
-
_AtlasOverlayPanel__fslDirChanged
(*a)¶ Called when the
Platform.fsldir
changes. Refreshes the atlas list.
-
_AtlasOverlayPanel__onAtlasSelect
(ev=None, atlasDesc=None)¶ Called when the user selects an atlas in the atlas list, or the
selectAtlas()
method is called.If a region list (a list of
OverlayListWidget
items for every region in the atlas, to be displayed in the region list) has not yet been created, it is created - this is done asynchronously (via theidle.idle()
function), as it can take quite a long time for some of the atlases (e.g. the Talairach and Juelich).Then the region list is updated to show the regions for the newly selected atlas.
-
_AtlasOverlayPanel__onRegionFilter
(ev)¶ Called when the user enters some text in the region filter.
Filters the region list (see the
EditableListBox.ApplyFilter()
method), and updates all items in the atlas list (see the__updateAtlasState()
method).
-
_AtlasOverlayPanel__updateAtlasState
(atlasDesc)¶ Updates the state of the atlas list item which corresponds to the atlas with the specified identifier.
If the atlas has regions which match the current region filter string, the atlas label font is set to bold. Otherwise (or if the region filter string is empty), the atlas label font is set to normal.
-
__module__
= 'fsleyes.controls.atlasoverlaypanel'¶
-
class
fsleyes.controls.atlasoverlaypanel.
OverlayListWidget
(parent, atlasID, atlasPanel, atlasOvlPanel, labelIdx=None)¶ Bases:
__main__.MockClass
OverlayListWidget
items are used by theAtlasOverlayPanel
in both the atlas list and the region list.For atlases, an
OverlayListWidget
contains a check box allowing the user to toggle the visibility of a summary (i.e. label) overlay for that atlas.For regions, an
OverlayListWidget
contains a check box and a button. The check box allows the user to toggle visibility of an atlas region overlay, and the button calls theAtlasPanel.locateRegion()
method, allowing the user to locate the region.See the
AtlasPanel
class documentation, and theatlases
module for more details-
__init__
(parent, atlasID, atlasPanel, atlasOvlPanel, labelIdx=None)¶ Create an
OverlayListWidget
.- Parameters
parent – The
wx
parent object - this is assumed to be anEditableListBox
.atlasID – The atlas identifier.
atlasOvlPanel – The
AtlasOverlayPanel
which created thisOverlayListWidget
.atlasPanel – The
AtlasPanel
which owns theAtlasOverlayPanel
that created thisOverlayListWidget
.labelIdx – Label index of the region, if this
OverlatyListWidget
corresponds to a region, orNone
if it corresponds to an atlas.
-
SetEnableState
(state)¶ Sets the enable overlay checkbox state to the specified state (
True
orFalse
).
-
_OverlayListWidget__onEnable
(ev)¶ Called when the enable overlay checkbox is clicked. Calls the
AtlasPanel.toggleOverlay()
method, to toggle the overlay for the atlas/region associated with thisOverlayListWidget
..
-
_OverlayListWidget__onLocate
(ev)¶ Called when the locate region button is clicked only on
OverlayListWidget
items which are associated with an atlas region).Calls the
AtlasPanel.locateRegion()
method for the atlas/region associated with thisOverlayListWidget
.
-
__module__
= 'fsleyes.controls.atlasoverlaypanel'¶
-