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.ControlPanelAn
OverlayInfoPanelis aControlPanelwhich displays information about the currently selected overlay in awx.html.HtmlWindow. The currently selected overlay is defined by theDisplayContext.selectedOverlayproperty. AnOverlayInfoPanellooks something like the following:
Slightly different information is shown depending on the overlay type, and is generated by the following methods:
ImageFEATImageMelodicImageDTIFitTensorMeshVTKMeshGiftiMeshFreesurferMesh-
static
supportedViews()[source]¶ The
OverlayInfoPanelis restricted for use withOrthoPanel,LightBoxPanelandScene3DPanelviewws.
-
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
parent – The
wxparent object.overlayList – The
OverlayListinstance.displayCtx – The
DisplayContextinstance.viewPanel – The
ViewPanelinstance.
-
destroy()[source]¶ Must be called when this
OverlayInfoPanelis no longer needed. Removes some property listeners, and calls theControlPanel.destroy()method.
-
__selectedOverlayChanged(*a)¶ Called when the
OverlayListorDisplayContext.selectedOverlaychanges. Refreshes the information shown on thisOverlayInfoPanel.
-
_optProps= <MagicMock name='mock.utils.typedict.TypeDict()' id='4116378456'>¶ This dictionary contains a list of
DisplayOptsproperties 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.overlayTypefor the current overlay changes. Re-registers with theDisplayandDisplayOptsinstances associated with the overlay.
-
__overlayNameChanged(*a)¶ Called when the
Display.namefor the current overlay changes. Updates the information display.
-
__overlayOptsChanged(*a)¶ Called when any
DisplayOptsproperties for the current overlay change. Updates the information display. The properties that trigger a refresh are defined in the_optPropsdictionary.
-
__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
OverlayInfoobject containing information about the givenImageoverlay.- Parameters
overlay – A
Imageinstance.display – The
Displayinstance assocated with theImage.
-
__getFEATImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenFEATImageoverlay.- Parameters
overlay – A
FEATImageinstance.display – The
Displayinstance assocated with theFEATImage.
-
__getMelodicImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenMelodicImageoverlay.- Parameters
overlay – A
MelodicImageinstance.display – The
Displayinstance assocated with theMelodicImage.
-
__getMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenMeshoverlay.- Parameters
overlay – A
Meshinstance.display – The
Displayinstance assocated with theMesh.
-
__getVTKMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenVTKMeshoverlay.- Parameters
overlay – A
VTKMeshinstance.display – The
Displayinstance assocated with theVTKMesh.
-
__getGiftiMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenGiftiMeshoverlay.- Parameters
overlay – A
GiftiMeshinstance.display – The
Displayinstance assocated with theGiftiMesh.
-
__getFreesurferMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenFreesurferMeshoverlay.- Parameters
overlay – A
FreesurferMeshinstance.display – The
Displayinstance assocated with theFreesurferMesh.
-
__getDTIFitTensorInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenDTIFitTensoroverlay.- Parameters
overlay – A
DTIFitTensorinstance.display – The
Displayinstance assocated with theDTIFitTensor.
-
__getDicomImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenDicomImageoverlay.- Parameters
overlay – A
DicomImageinstance.display – The
Displayinstance assocated with theDicomImage.
-
__getMGHImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenMGHImageoverlay.- Parameters
overlay – A
MGHImageinstance.display – The
Displayinstance 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
OverlayInfoinstance.
-
__module__= 'fsleyes.plugins.controls.overlayinfopanel'¶
-
static
-
class
fsleyes.plugins.controls.overlayinfopanel.OverlayInfo(title)[source]¶ Bases:
objectA little class which encapsulates human-readable information about one overlay.
OverlayInfoobjects are created and returned by theOverlayInfoPanel.__get*Infomethods.The information stored in an
OverlayInfoinstance is organised into sections. Within each section, information is organised into key-value pairs. The order in which bothOverlayInfosections, and information, is ultimately output, is the order in which the sections/information are added, via theaddSection()andaddInfo()methods.-
__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)
-