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)¶ 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:
Image__getImageInfo()FEATImage__getFEATImageInfo()MelodicImage__getMelodicImageInfo()DTIFitTensor__getDTIFitTensorInfo()Mesh__getMeshInfo()VTKMesh__getVTKMeshInfo()GiftiMesh__getGiftiMeshInfo()FreesurferMesh__getFreesurferMeshInfo()-
__init__(parent, overlayList, displayCtx, frame)¶ Create an
OverlayInfoPanel.Parameters: - parent – The
wxparent object. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - frame – The
FSLeyesFrameinstance.
- parent – The
-
destroy()¶ Must be called when this
OverlayInfoPanelis no longer needed. Removes some property listeners, and calls theControlPanel.destroy()method.
-
_optProps= <MagicMock name='mock.utils.typedict.TypeDict()' id='139845843052696'>¶ 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.
-
_OverlayInfoPanel__deregisterOverlay()¶ De-registers property listeners from the overlay that was previously registered via
__registerOverlay().
-
_OverlayInfoPanel__formatArray(array)¶ Creates and returns a string containing a HTML table which formats the data in the given
numpy.array.
-
_OverlayInfoPanel__formatOverlayInfo(info)¶ Creates and returns a string containing some HTML which formats the information in the given
OverlayInfoinstance.
-
_OverlayInfoPanel__getDTIFitTensorInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenDTIFitTensoroverlay.Parameters: - overlay – A
DTIFitTensorinstance. - display – The
Displayinstance assocated with theDTIFitTensor.
- overlay – A
-
_OverlayInfoPanel__getDicomImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenDicomImageoverlay.Parameters: - overlay – A
DicomImageinstance. - display – The
Displayinstance assocated with theDicomImage.
- overlay – A
-
_OverlayInfoPanel__getFEATImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenFEATImageoverlay.Parameters: - overlay – A
FEATImageinstance. - display – The
Displayinstance assocated with theFEATImage.
- overlay – A
-
_OverlayInfoPanel__getFreesurferMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenFreesurferMeshoverlay.Parameters: - overlay – A
FreesurferMeshinstance. - display – The
Displayinstance assocated with theFreesurferMesh.
- overlay – A
-
_OverlayInfoPanel__getGiftiMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenGiftiMeshoverlay.Parameters: - overlay – A
GiftiMeshinstance. - display – The
Displayinstance assocated with theGiftiMesh.
- overlay – A
-
_OverlayInfoPanel__getImageInfo(overlay, display, title=None)¶ Creates and returns an
OverlayInfoobject containing information about the givenImageoverlay.Parameters: - overlay – A
Imageinstance. - display – The
Displayinstance assocated with theImage.
- overlay – A
-
_OverlayInfoPanel__getMGHImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenMGHImageoverlay.Parameters: - overlay – A
MGHImageinstance. - display – The
Displayinstance assocated with theDicomImage.
- overlay – A
-
_OverlayInfoPanel__getMelodicImageInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenMelodicImageoverlay.Parameters: - overlay – A
MelodicImageinstance. - display – The
Displayinstance assocated with theMelodicImage.
- overlay – A
-
_OverlayInfoPanel__getMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenMeshoverlay.Parameters: - overlay – A
Meshinstance. - display – The
Displayinstance assocated with theMesh.
- overlay – A
-
_OverlayInfoPanel__getVTKMeshInfo(overlay, display)¶ Creates and returns an
OverlayInfoobject containing information about the givenVTKMeshoverlay.Parameters: - overlay – A
VTKMeshinstance. - display – The
Displayinstance assocated with theVTKMesh.
- overlay – A
-
_OverlayInfoPanel__overlayNameChanged(*a)¶ Called when the
Display.namefor the current overlay changes. Updates the information display.
-
_OverlayInfoPanel__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.
-
_OverlayInfoPanel__overlayTypeChanged(*a)¶ Called when the
Display.overlayTypefor the current overlay changes. Re-registers with theDisplayandDisplayOptsinstances associated with the overlay.
-
_OverlayInfoPanel__registerOverlay(overlay)¶ Registers property listeners with the given overlay so the information can be refreshed when necessary.
-
_OverlayInfoPanel__selectedOverlayChanged(*a)¶ Called when the
OverlayListorDisplayContext.selectedOverlaychanges. Refreshes the information shown on thisOverlayInfoPanel.
-
_OverlayInfoPanel__updateInformation()¶ Refreshes the information shown on this
OverlayInfoPanel. Called by the__selectedOverlayChanged()and__overlayNameChanged()methods.
-
__module__= 'fsleyes.controls.overlayinfopanel'¶
-
-
class
fsleyes.controls.overlayinfopanel.OverlayInfo(title)¶ 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.-
__init__(title)¶ Create an
OverlayInfoinstance.Parameters: title – The OverlaytInfotitle.
-
__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>})¶
-
__module__= 'fsleyes.controls.overlayinfopanel'¶
-
__weakref__¶ list of weak references to the object (if defined)
-
addSection(section)¶ Add a section to this
OverlayInfoinstance.Parameters: section – The section name.
-
addInfo(name, info, section=None)¶ Add some information to this
OverlayInfoinstance.Parameters: - name – The information name.
- info – The information value.
- section – Section to place the information in.
-