fsleyes.plugins.tools.projectimagetosurface

This module provides the ProjectImageToSurfaceAction class, which allows data from an Image overlay to be projected onto a Mesh overlay.

class fsleyes.plugins.tools.projectimagetosurface.ProjectImageToSurfaceAction(overlayList, displayCtx, frame)[source]

Bases: fsleyes.actions.base.NeedOverlayAction

The ProjectImageToSurfaceAction class allows the user to project data from a volumetric Image overlay onto a Mesh overlay.

A ProjectImageToSurfaceAction is active when the currently selected overlay is a Mesh. When executed, the user is prompted to select an Image overlay to project onto the mesh. Only images which overlap the bounding box of the Mesh are available as options.

When the user selects an Image, the data from the image at each vertex in the mesh is retrieved using scipy.ndimage.map_coordinates. This data is then added as an option on the MeshOpts.vertexData property, and selected.

__init__(overlayList, displayCtx, frame)[source]

Create a ProjectImageToSurfaceAction.

Parameters
__projectImage()

Run the ProjectImageToSurfaceAction.

__annotations__ = {}
__module__ = 'fsleyes.plugins.tools.projectimagetosurface'
fsleyes.plugins.tools.projectimagetosurface.projectImageDataOntoMesh(displayCtx, image, mesh)[source]

Samples data from image at every vertex on mesh. Uses scipy.ndimage.map_coordinates.

fsleyes.plugins.tools.projectimagetosurface.overlap(bbox1, bbox2)[source]

Returns True if the two bounding boxes overlap at all, False otherwise.

Both bbox1 and bbox2 are expected to be sequences of (low, high) tuples containing the bounds of each axis in the coordinate system that the bounding boxes are defined in.