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.NeedOverlayActionThe
ProjectImageToSurfaceActionclass allows the user to project data from a volumetricImageoverlay onto aMeshoverlay.A
ProjectImageToSurfaceActionis active when the currently selected overlay is aMesh. When executed, the user is prompted to select anImageoverlay to project onto the mesh. Only images which overlap the bounding box of theMeshare 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.vertexDataproperty, and selected.-
__init__(overlayList, displayCtx, frame)[source]¶ Create a
ProjectImageToSurfaceAction.- Parameters
overlayList – The
OverlayListdisplayCtx – The
DisplayContextframe – The
ViewPanelthis action is associated with.
-
__projectImage()¶ Run the
ProjectImageToSurfaceAction.
-
__module__= 'fsleyes.plugins.tools.projectimagetosurface'¶
-
-
fsleyes.plugins.tools.projectimagetosurface.projectImageDataOntoMesh(displayCtx, image, mesh)[source]¶ Samples data from
imageat every vertex onmesh. Usesscipy.ndimage.map_coordinates.
-
fsleyes.plugins.tools.projectimagetosurface.overlap(bbox1, bbox2)[source]¶ Returns
Trueif the two bounding boxes overlap at all,Falseotherwise.Both
bbox1andbbox2are 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.