fsleyes.plugins.controls.overlayinfopanel

This module provides the OverlayInfoPanel class, a FSLeyes control panel which displays information about the currently selected overlay.

fsleyes.plugins.controls.overlayinfopanel.USE_HTML2 = False

Toggle this flag to switch between the simple wx.html renderer, and the webkit-backed wx.html2 renderer. Webkit is not necessarily present on all systems, and there’s no neat way to dynamically test whether wx.html2 will work. So I’m sticking with wx.html for now.

class fsleyes.plugins.controls.overlayinfopanel.OverlayInfoPanel(parent, overlayList, displayCtx, viewPanel)[source]

Bases: fsleyes.controls.controlpanel.ControlPanel

An OverlayInfoPanel is a ControlPanel which displays information about the currently selected overlay in a wx.html.HtmlWindow. The currently selected overlay is defined by the DisplayContext.selectedOverlay property. An OverlayInfoPanel looks something like the following:

_images/overlayinfopanel.png

Slightly different information is shown depending on the overlay type, and is generated by the following methods:

Image

__getImageInfo()

FEATImage

__getFEATImageInfo()

MelodicImage

__getMelodicImageInfo()

DTIFitTensor

__getDTIFitTensorInfo()

Mesh

__getMeshInfo()

VTKMesh

__getVTKMeshInfo()

GiftiMesh

__getGiftiMeshInfo()

FreesurferMesh

__getFreesurferMeshInfo()

static supportedViews()[source]

The OverlayInfoPanel is restricted for use with OrthoPanel, LightBoxPanel and Scene3DPanel viewws.

static defaultLayout()[source]

Returns a dictionary of arguments to be passed to the ViewPanel.togglePanel() method.

__init__(parent, overlayList, displayCtx, viewPanel)[source]

Create an OverlayInfoPanel.

Parameters
destroy()[source]

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

__selectedOverlayChanged(*a)

Called when the OverlayList or DisplayContext.selectedOverlay changes. Refreshes the information shown on this OverlayInfoPanel.

_optProps = <MagicMock name='mock.utils.typedict.TypeDict()' id='139907489023024'>

This dictionary contains a list of DisplayOpts properties that, when changed, should result in the information being refreshed. It is used by the __registerOverlay() and __deregisterOverlay() methods.

__registerOverlay(overlay)

Registers property listeners with the given overlay so the information can be refreshed when necessary.

__deregisterOverlay()

De-registers property listeners from the overlay that was previously registered via __registerOverlay().

__overlayTypeChanged(*a)

Called when the Display.overlayType for the current overlay changes. Re-registers with the Display and DisplayOpts instances associated with the overlay.

__overlayNameChanged(*a)

Called when the Display.name for the current overlay changes. Updates the information display.

__overlayOptsChanged(*a)

Called when any DisplayOpts properties for the current overlay change. Updates the information display. The properties that trigger a refresh are defined in the _optProps dictionary.

__updateInformation()

Refreshes the information shown on this OverlayInfoPanel. Called by the __selectedOverlayChanged() and __overlayNameChanged() methods.

__getImageInfo(overlay, display, title=None, metadata=True)

Creates and returns an OverlayInfo object containing information about the given Image overlay.

Parameters
  • overlay – A Image instance.

  • display – The Display instance assocated with the Image.

__getFEATImageInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given FEATImage overlay.

Parameters
  • overlay – A FEATImage instance.

  • display – The Display instance assocated with the FEATImage.

__getMelodicImageInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given MelodicImage overlay.

Parameters
  • overlay – A MelodicImage instance.

  • display – The Display instance assocated with the MelodicImage.

__getMeshInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given Mesh overlay.

Parameters
  • overlay – A Mesh instance.

  • display – The Display instance assocated with the Mesh.

__getVTKMeshInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given VTKMesh overlay.

Parameters
  • overlay – A VTKMesh instance.

  • display – The Display instance assocated with the VTKMesh.

__getGiftiMeshInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given GiftiMesh overlay.

Parameters
  • overlay – A GiftiMesh instance.

  • display – The Display instance assocated with the GiftiMesh.

__getFreesurferMeshInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given FreesurferMesh overlay.

Parameters
  • overlay – A FreesurferMesh instance.

  • display – The Display instance assocated with the FreesurferMesh.

__getDTIFitTensorInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given DTIFitTensor overlay.

Parameters
  • overlay – A DTIFitTensor instance.

  • display – The Display instance assocated with the DTIFitTensor.

__getDicomImageInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given DicomImage overlay.

Parameters
  • overlay – A DicomImage instance.

  • display – The Display instance assocated with the DicomImage.

__getMGHImageInfo(overlay, display)

Creates and returns an OverlayInfo object containing information about the given MGHImage overlay.

Parameters
  • overlay – A MGHImage instance.

  • display – The Display instance assocated with the DicomImage.

__formatArray(array)

Creates and returns a string containing a HTML table which formats the data in the given numpy.array.

__formatOverlayInfo(info)

Creates and returns a string containing some HTML which formats the information in the given OverlayInfo instance.

__annotations__ = {}
__module__ = 'fsleyes.plugins.controls.overlayinfopanel'
class fsleyes.plugins.controls.overlayinfopanel.OverlayInfo(title)[source]

Bases: object

A little class which encapsulates human-readable information about one overlay. OverlayInfo objects are created and returned by the OverlayInfoPanel.__get*Info methods.

The information stored in an OverlayInfo instance is organised into sections. Within each section, information is organised into key-value pairs. The order in which both OverlayInfo sections, and information, is ultimately output, is the order in which the sections/information are added, via the addSection() and addInfo() methods.

__init__(title)[source]

Create an OverlayInfo instance.

Parameters

title – The OverlaytInfo title.

__dict__ = mappingproxy({'__module__': 'fsleyes.plugins.controls.overlayinfopanel', '__doc__': 'A little class which encapsulates human-readable information about\n    one overlay. ``OverlayInfo`` objects are created and returned by the\n    ``OverlayInfoPanel.__get*Info`` methods.\n\n    The information stored in an ``OverlayInfo`` instance is organised into\n    *sections*. Within each section, information is organised into key-value\n    pairs. The order in which both ``OverlayInfo`` sections, and information,\n    is ultimately output, is the order in which the sections/information are\n    added, via the :meth:`addSection` and :meth:`addInfo` methods.\n    ', '__init__': <function OverlayInfo.__init__>, 'addSection': <function OverlayInfo.addSection>, 'addInfo': <function OverlayInfo.addInfo>, '__dict__': <attribute '__dict__' of 'OverlayInfo' objects>, '__weakref__': <attribute '__weakref__' of 'OverlayInfo' objects>, '__annotations__': {}})
__module__ = 'fsleyes.plugins.controls.overlayinfopanel'
__weakref__

list of weak references to the object (if defined)

addSection(section)[source]

Add a section to this OverlayInfo instance.

Parameters

section – The section name.

addInfo(name, info, section=None)[source]

Add some information to this OverlayInfo instance.

Parameters
  • name – The information name.

  • info – The information value.

  • section – Section to place the information in.