fsleyes.actions.loadvertexdata
¶
This module provides the LoadVertexDataAction
, which allows the
user to load additional vertex data or vertex sets for a Mesh
overlay. Two standalone functions, loadVertexData()
and
loadVertices()
are also provided.
-
class
fsleyes.actions.loadvertexdata.
LoadVertexDataAction
(overlayList, displayCtx, vertices=False)¶ Bases:
fsleyes.actions.base.Action
The
LoadVertexDataAction
prompts the user to load a file containing vertex data or a vertex set for aMesh
overlay. See theMeshOpts.vertexData
andMeshOpts.vertexSet
properties.-
__init__
(overlayList, displayCtx, vertices=False)¶ Create a
LoadVertexDataAction
.Parameters: - overlayList – The
OverlayList
. - displayCtx – The
DisplayContext
. - vertices – If
True
, the user is prompted to load a file containing vertices for the mesh. Otherwise, the user is prompted to load a file containing vertex data.
- overlayList – The
-
destroy
()¶ Must be called when this
LoadVertexDataAction
is no longer needed. Performs some clean-up.
-
_LoadVertexDataAction__loadVertexData
()¶ Prompts the user to load a vertex data file for the currently selected
Mesh
overlay, then sets theMeshOpts.vertexData
property accordingly. If the file was successfully loaded, also adds the loaded file as an option on theMeshOpts.vertexData
property.
-
_LoadVertexDataAction__loadVertices
()¶ Prompts the user to load a vertex file for the currently selected
Mesh
overlay, then sets theMeshOpts.vertexSet
property accordingly. If the file was successfully loaded, also adds the loaded file as an option on theMeshOpts.vertexSet
property.
-
_LoadVertexDataAction__loadit
(key, func)¶ Shared by the
__loadVertices()
and__loadVertexData()
methods.
-
_LoadVertexDataAction__onRun
()¶ Called when this action is executed. Calls either
__loadVertexData()
, or__loadVertices()
.
-
_LoadVertexDataAction__selectedOverlayChanged
(*a)¶ Called when the
DisplayContext.selectedOverlay
changes. Enables/disables this action based on the type of the newly selected overlay.
-
__module__
= 'fsleyes.actions.loadvertexdata'¶
-
-
fsleyes.actions.loadvertexdata.
loadVertexData
(overlay, displayCtx, filename, select=True)¶ Attempt to load the specified vertex data for the given overlay.
Parameters: - overlay – The overlay (assumed to be a
Mesh
instance) - displayCtx – The
DisplayContext
- filename – Path to the vertex data file that is to be loaded.
- select – If
True
(the default), theMeshOpts.vertexData
is set to the newly loaded file.
Returns: The path that was actually used - it will have been converted to an absolute path if necessary.
- overlay – The overlay (assumed to be a
-
fsleyes.actions.loadvertexdata.
loadVertices
(overlay, displayCtx, filename, select=True)¶ Attempt to load the specified vertexz file for the given overlay.
Parameters: - overlay – The overlay (assumed to be a
Mesh
instance) - displayCtx – The
DisplayContext
- filename – Path to the vertex file that is to be loaded.
- select – If
True
(the default), theMeshOpts.vertexSet
is set to the newly loaded file.
Returns: The path that was actually used - it will have been converted to an absolute path if necessary.
- overlay – The overlay (assumed to be a