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.NeedOverlayAction
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)[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.
-
_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()
.
-
__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
Mesh
instance)displayCtx – The
DisplayContext
filename – Path to the vertex data file that is to be loaded, or key for vertex data that is already loaded (see the
Mesh
class).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.
-
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
Mesh
instance)displayCtx – The
DisplayContext
filename – Path to the vertex file that is to be loaded, or key for vertex data that is already loaded (see the
Mesh
class).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.