fsleyes.controls.overlayinfopanel
¶
This module provides the OverlayInfoPanel
class, a FSLeyes control
panel which displays information about the currently selected overlay.
-
fsleyes.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.controls.overlayinfopanel.
OverlayInfoPanel
(parent, overlayList, displayCtx, frame)[source]¶ Bases:
fsleyes.controls.controlpanel.ControlPanel
An
OverlayInfoPanel
is aControlPanel
which displays information about the currently selected overlay in awx.html.HtmlWindow
. The currently selected overlay is defined by theDisplayContext.selectedOverlay
property. AnOverlayInfoPanel
looks something like the following:Slightly different information is shown depending on the overlay type, and is generated by the following methods:
Image
FEATImage
MelodicImage
DTIFitTensor
Mesh
VTKMesh
GiftiMesh
FreesurferMesh
-
__init__
(parent, overlayList, displayCtx, frame)[source]¶ Create an
OverlayInfoPanel
.- Parameters
parent – The
wx
parent object.overlayList – The
OverlayList
instance.displayCtx – The
DisplayContext
instance.frame – The
FSLeyesFrame
instance.
-
destroy
()[source]¶ Must be called when this
OverlayInfoPanel
is no longer needed. Removes some property listeners, and calls theControlPanel.destroy()
method.
-
__selectedOverlayChanged
(*a)¶ Called when the
OverlayList
orDisplayContext.selectedOverlay
changes. Refreshes the information shown on thisOverlayInfoPanel
.
-
_optProps
= <MagicMock name='mock.utils.typedict.TypeDict()' id='139861880230096'>¶ 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 theDisplay
andDisplayOpts
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 givenImage
overlay.- Parameters
overlay – A
Image
instance.display – The
Display
instance assocated with theImage
.
-
__getFEATImageInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenFEATImage
overlay.- Parameters
overlay – A
FEATImage
instance.display – The
Display
instance assocated with theFEATImage
.
-
__getMelodicImageInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenMelodicImage
overlay.- Parameters
overlay – A
MelodicImage
instance.display – The
Display
instance assocated with theMelodicImage
.
-
__getMeshInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenMesh
overlay.- Parameters
overlay – A
Mesh
instance.display – The
Display
instance assocated with theMesh
.
-
__getVTKMeshInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenVTKMesh
overlay.- Parameters
overlay – A
VTKMesh
instance.display – The
Display
instance assocated with theVTKMesh
.
-
__getGiftiMeshInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenGiftiMesh
overlay.- Parameters
overlay – A
GiftiMesh
instance.display – The
Display
instance assocated with theGiftiMesh
.
-
__getFreesurferMeshInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenFreesurferMesh
overlay.- Parameters
overlay – A
FreesurferMesh
instance.display – The
Display
instance assocated with theFreesurferMesh
.
-
__getDTIFitTensorInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenDTIFitTensor
overlay.- Parameters
overlay – A
DTIFitTensor
instance.display – The
Display
instance assocated with theDTIFitTensor
.
-
__getDicomImageInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenDicomImage
overlay.- Parameters
overlay – A
DicomImage
instance.display – The
Display
instance assocated with theDicomImage
.
-
__getMGHImageInfo
(overlay, display)¶ Creates and returns an
OverlayInfo
object containing information about the givenMGHImage
overlay.- Parameters
overlay – A
MGHImage
instance.display – The
Display
instance assocated with theDicomImage
.
-
__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.
-
__module__
= 'fsleyes.controls.overlayinfopanel'¶
-
-
class
fsleyes.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 theOverlayInfoPanel.__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 bothOverlayInfo
sections, and information, is ultimately output, is the order in which the sections/information are added, via theaddSection()
andaddInfo()
methods.-
__dict__
= mappingproxy({'__module__': 'fsleyes.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.controls.overlayinfopanel'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-