cortex.dataset.Vertex2D.blend_curvature

Vertex2D.blend_curvature(alpha, threshold=0, brightness=0.5, contrast=0.25, smooth=20)

Blend the data with a curvature map depending on a transparency map.

Deprecated since version Per-vertex/voxel: alpha is now honored directly by both the WebGL viewer and cortex.quickshow, so this curvature-blending hack is no longer needed. The recommended replacement for scalar data with a transparency map is Vertex2D (or Volume2D) with a 2D colormap whose second axis encodes alpha (e.g. "fire_alpha", "PU_RdBu_covar_alpha")::

# Was: # blended = vtx.blend_curvature(alpha) # cortex.quickshow(blended) # Now: v2d = cortex.Vertex2D(vtx.data, alpha, subject,

cmap=”fire_alpha”, vmin=vtx.vmin, vmax=vtx.vmax, vmin2=0, vmax2=1)

cortex.quickshow(v2d) # or cortex.webgl.show(v2d)

The 2D colormap path keeps colormap parameters (cmap, vmin, vmax) editable on the resulting object, and the curvature underlay is composited through automatically by both the matplotlib and WebGL renderers.

For data that is already RGB, pass alpha= to VertexRGB / VolumeRGB directly instead.

Vertex objects cannot use transparency as Volume objects. This method is a hack to mimic the transparency of Volume objects, blending the Vertex data with a curvature map. This method returns a VertexRGB object, and the colormap parameters (vmin, vmax, cmap, …) of the original Vertex object cannot be changed later on.

Parameters:
alphaarray of shape (n_vertices, )

Transparency map.

thresholdfloat

Threshold for the curvature map.

brightnessfloat

Brightness of the curvature map.

contrastfloat

Contrast of the curvature map.

smoothfloat

Smoothness of the curvature map.

Returns:
blendedVertexRGB object

The original map blended with a curvature map.