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)[source]¶ Bases:
fsleyes.actions.base.NeedOverlayActionThe
LoadVertexDataActionprompts the user to load a file containing vertex data or a vertex set for aMeshoverlay. See theMeshOpts.vertexDataandMeshOpts.vertexSetproperties.-
__init__(overlayList, displayCtx, vertices=False)[source]¶ 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.
-
__onRun()¶ Called when this action is executed. Calls either
__loadVertexData(), or__loadVertices().
-
__loadVertices()¶ Prompts the user to load a vertex file for the currently selected
Meshoverlay, then sets theMeshOpts.vertexSetproperty accordingly. If the file was successfully loaded, also adds the loaded file as an option on theMeshOpts.vertexSetproperty.
-
__loadVertexData()¶ Prompts the user to load a vertex data file for the currently selected
Meshoverlay, then sets theMeshOpts.vertexDataproperty accordingly. If the file was successfully loaded, also adds the loaded file as an option on theMeshOpts.vertexDataproperty.
-
__loadit(key, func)¶ Shared by the
__loadVertices()and__loadVertexData()methods.
-
__module__= 'fsleyes.actions.loadvertexdata'¶
-
-
fsleyes.actions.loadvertexdata.loadVertexData(overlay, displayCtx, filename, select=True)[source]¶ Attempt to load the specified vertex data for the given overlay.
- Parameters
overlay – The overlay (assumed to be a
Meshinstance)displayCtx – The
DisplayContextfilename – Path to the vertex data file that is to be loaded, or key for vertex data that is already loaded (see the
Meshclass).select – If
True(the default), theMeshOpts.vertexDatais set to the newly loaded file.
- Returns
The path that was actually used - it will have been converted to an absolute path if necessary.
-
fsleyes.actions.loadvertexdata.loadVertices(overlay, displayCtx, filename, select=True)[source]¶ Attempt to load the specified vertexz file for the given overlay.
- Parameters
overlay – The overlay (assumed to be a
Meshinstance)displayCtx – The
DisplayContextfilename – Path to the vertex file that is to be loaded, or key for vertex data that is already loaded (see the
Meshclass).select – If
True(the default), theMeshOpts.vertexSetis set to the newly loaded file.
- Returns
The path that was actually used - it will have been converted to an absolute path if necessary.