cortex.quickflat.composite.add_curvature¶
- cortex.quickflat.composite.add_curvature(fig: Axes, dataview: Dataview, extents: tuple[float, float, float, float] | None = None, height: int | None = None, threshold: bool | None = True, contrast: float | None = None, brightness: float | None = None, smooth: float | None = None, cmap: str = 'gray', recache: bool = False, curvature_lims: float = 0.5, legacy_mode: bool = False) AxesImage[source]¶
Add curvature layer to figure
- Parameters:
- figfigure or ax
figure into which to plot image of curvature
- dataviewcortex.Dataview object
dataview containing data to be plotted, subject (surface identifier), and transform.
- extentstuple[float, float, float, float], optional
(left, right, top, bottom) extents of image plotted. None defaults to extents of images already present in figure.
- heightint, optional
Height, in pixels, of the output flatmap image. None defaults to the height of images already present in figure.
- thresholdboolean
Whether to apply a threshold to the curvature values to create a binary curvature image (one shade for positive curvature, one shade for negative). None defaults to value specified in the config file
- contrastfloat, [0-1] or None
Contrast of curvature image. 1 is maximal contrast (given brightness). If brightness is 0.5 and contrast is 1, and cmap is ‘gray’, curvature will be black and white. None defaults to value in config file.
- brightnessfloat, [0-1] or None
How bright to make average value of curvature (0=black, 1=white in gray cmap). None defaults to the value in config file.
- curvature_limsfloat
Limits for real curvature values (actual values for cortical curvature are normalized within [-curvature_lims, +`curvature_lims`] before scaling by contrast and shifting by brightness).
- smoothscalar or None
Width of smoothing to apply to surface curvature. None defaults to no smoothing, or whatever the default value for curvature is that is stored in <filestore>/<subject>/surface-info/curvature.npz (for some subjects initiated in old versions of pycortex, this may be smoothed too!)
- cmapstring
name for colormap of curvature
- recacheboolean
Whether or not to recache intermediate files. Takes longer to plot this way, potentially resolves some errors.
- Returns:
- imgmatplotlib.image.AxesImage
matplotlib axes image object for plotted data