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.FSLeyesPanel

The AtlasOverlayPanel displays a list of all available FSL atlases (see the atlases module), and allows the user to:

  1. Search across all atlases for regions, by name.

  2. Toggle overlays for atlases, and for individual regions from any atlas.

  3. Move the DisplayContext.location to any region from any atlas.

An AtlasOverlayPanel looks something like this:

_images/atlasoverlaypanel.png

The AtlasOverlayPanel has three main sections:

  • The atlas list - a fsleyes_widgets.elistbox.EditableListBox with an entry, and an OverlayListWidget for every available atlas. The OverlayListWidget 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 an OverlayListWidget alongside every region. The OverlayListWidget allows the user to navigate to a region, and to turn on/off a label or statistic/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)[source]

Create an AtlasOverlayPanel.

Parameters
destroy()[source]

Performs some clean up operations.

Enable(enable=True)[source]

Enables/disables this AtlasOverlayPanel.

Disable()[source]

Disables this AtlasOverlayPanel.

setOverlayState(atlasDesc, labelIdx, summary, state)[source]

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 the OverlayList. It ensures that the OverlayListWidget controls for every atlas, and every region, are up to date.

__fslDirChanged(*a)

Called when the Platform.fsldir changes. Refreshes the atlas list.

__atlasAdded(*a)

Called when a new atlas is added to the AtlasRegistry. Re-generates the atlas list.

__atlasRemoved(*a)

Called when an atlas is removed from the AtlasRegistry. Re-generates the atlas list.

__buildAtlasList()

Clears and recreates the atlas list. Also clears all existing region lists.

__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).

__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.

__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 the idle.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.

selectAtlas(atlasDesc)[source]

Selects the specified atlas. This method is used by OverlayListWidget instances.

Parameters

atlasID – The atlas identifier

__module__ = 'fsleyes.controls.atlasoverlaypanel'
class fsleyes.controls.atlasoverlaypanel.OverlayListWidget(parent, atlasID, atlasPanel, atlasOvlPanel, labelIdx=None)[source]

Bases: __main__.docbuilder.run.<locals>.MockClass

OverlayListWidget items are used by the AtlasOverlayPanel 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 the AtlasPanel.locateRegion() method, allowing the user to locate the region.

See the AtlasPanel class documentation, and the atlases module for more details

__init__(parent, atlasID, atlasPanel, atlasOvlPanel, labelIdx=None)[source]

Create an OverlayListWidget.

Parameters
  • parent – The wx parent object - this is assumed to be an EditableListBox.

  • atlasID – The atlas identifier.

  • atlasOvlPanel – The AtlasOverlayPanel which created this OverlayListWidget.

  • atlasPanel – The AtlasPanel which owns the AtlasOverlayPanel that created this OverlayListWidget.

  • labelIdx – Label index of the region, if this OverlatyListWidget corresponds to a region, or None if it corresponds to an atlas.

SetEnableState(state)[source]

Sets the enable overlay checkbox state to the specified state (True or False).

__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 this 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 this OverlayListWidget.

__module__ = 'fsleyes.controls.atlasoverlaypanel'