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.ActionThe
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)¶ 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
LoadVertexDataActionis no longer needed. Performs some clean-up.
-
_LoadVertexDataAction__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.
-
_LoadVertexDataAction__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.
-
_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.selectedOverlaychanges. 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
Meshinstance) - displayCtx – The
DisplayContext - filename – Path to the vertex data file that is to be loaded.
- 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.
- 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
Meshinstance) - displayCtx – The
DisplayContext - filename – Path to the vertex file that is to be loaded.
- 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.
- overlay – The overlay (assumed to be a