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 volumetricImage
overlay onto aMesh
overlay.A
ProjectImageToSurfaceAction
is active when the currently selected overlay is aMesh
. When executed, the user is prompted to select anImage
overlay to project onto the mesh. Only images which overlap the bounding box of theMesh
are available as options.When the user selects an
Image
, the data from the image at each vertex in the mesh is retrieved usingscipy.ndimage.map_coordinates
. This data is then added as an option on theMeshOpts.vertexData
property, and selected.- __init__(overlayList, displayCtx, frame)[source]
Create a
ProjectImageToSurfaceAction
.- Parameters
overlayList – The
OverlayList
displayCtx – The
DisplayContext
frame – The
ViewPanel
this action is associated with.
- __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 onmesh
. Usesscipy.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
andbbox2
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.