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 a Mesh overlay. See the MeshOpts.vertexData and MeshOpts.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.

__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 Mesh overlay, then sets the MeshOpts.vertexSet property accordingly. If the file was successfully loaded, also adds the loaded file as an option on the MeshOpts.vertexSet property.

__loadVertexData()

Prompts the user to load a vertex data file for the currently selected Mesh overlay, then sets the MeshOpts.vertexData property accordingly. If the file was successfully loaded, also adds the loaded file as an option on the MeshOpts.vertexData property.

__loadit(key, func)

Shared by the __loadVertices() and __loadVertexData() methods.

__annotations__ = {}
__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), the MeshOpts.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), the MeshOpts.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.