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)[source]¶ Bases:
fsleyes.panel.FSLeyesPanelThe
AtlasOverlayPaneldisplays a list of all available FSL atlases (see theatlasesmodule), 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.locationto any region from any atlas.
An
AtlasOverlayPanellooks something like this:
The
AtlasOverlayPanelhas three main sections:The atlas list - a
fsleyes_widgets.elistbox.EditableListBoxwith an entry, and anOverlayListWidgetfor every available atlas. TheOverlayListWidgetallows the user to turn on/off a summary overlay image for the atlas (see the section on atlas panel overlays).The region list - an
EditableListBoxwhich contains one entry for every region in the atlas that is currently selected in the atlas list, and anOverlayListWidgetalongside every region. TheOverlayListWidgetallows the user to navigate to a region, and to turn on/off a label or statistic/probabilistic region overlay.The region filter - a
wx.TextCtrllocated 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)[source]¶ Create an
AtlasOverlayPanel.- Parameters
parent – the
wxparent object.overlayList – The
OverlayListinstance.displayCtx – The
DisplayContextinstance.frame – The
FSLeyesFrameinstance.atlasPanel – The
AtlasPanelinstance that has created thisAtlasInfoPanel.
-
setOverlayState(atlasDesc, labelIdx, summary, state)[source]¶ Updates the enabled state of the specified atlas overlay.
This method is called by the
AtlasPanelwhen an atlas overlay is added/removed to/from theOverlayList. It ensures that theOverlayListWidgetcontrols for every atlas, and every region, are up to date.
-
selectAtlas(atlasDesc)[source]¶ Selects the specified atlas. This method is used by
OverlayListWidgetinstances.- 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.fsldirchanges. 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
OverlayListWidgetitems 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)[source]¶ Bases:
__main__.MockClassOverlayListWidgetitems are used by theAtlasOverlayPanelin both the atlas list and the region list.For atlases, an
OverlayListWidgetcontains a check box allowing the user to toggle the visibility of a summary (i.e. label) overlay for that atlas.For regions, an
OverlayListWidgetcontains 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
AtlasPanelclass documentation, and theatlasesmodule for more details-
__init__(parent, atlasID, atlasPanel, atlasOvlPanel, labelIdx=None)[source]¶ Create an
OverlayListWidget.- Parameters
parent – The
wxparent object - this is assumed to be anEditableListBox.atlasID – The atlas identifier.
atlasOvlPanel – The
AtlasOverlayPanelwhich created thisOverlayListWidget.atlasPanel – The
AtlasPanelwhich owns theAtlasOverlayPanelthat created thisOverlayListWidget.labelIdx – Label index of the region, if this
OverlatyListWidgetcorresponds to a region, orNoneif it corresponds to an atlas.
-
SetEnableState(state)[source]¶ Sets the enable overlay checkbox state to the specified state (
TrueorFalse).
-
_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
OverlayListWidgetitems which are associated with an atlas region).Calls the
AtlasPanel.locateRegion()method for the atlas/region associated with thisOverlayListWidget.
-
__module__= 'fsleyes.controls.atlasoverlaypanel'¶
-