cortex.quickflat.make_png

cortex.quickflat.make_png(fname: str | PathLike | IO, braindata: Dataview, recache: bool = False, pixelwise: bool = True, sampler: str = 'nearest', height: int = 1024, bgcolor: tuple[float, float, float] | str | tuple[float, float, float, float] | tuple[tuple[float, float, float] | str, float] | tuple[tuple[float, float, float, float], float] | None = None, dpi: int = 100, **kwargs) → None[source]

Create a PNG of the VertexData or VolumeData on a flatmap.

Parameters:
fnamestr

Filename for where to save the PNG file

braindataDataview (e.g. instance of cortex.Volume, cortex.Vertex, …)

the data you would like to plot on a flatmap

recacheboolean

Whether or not to recache intermediate files. Takes longer to plot this way, potentially resolves some errors. Useful if you’ve made changes to the alignment

pixelwisebool

Use pixel-wise mapping

samplerstr

Name of sampling function used to sample underlying volume data. Options include ‘trilinear’, ‘nearest’, ‘lanczos’; see functions in cortex.mapper.samplers.py for all options

heightint

Height of the image to render. Automatically scales the width for the aspect of the subject’s flatmap

Other Parameters:
dpiint

DPI of the generated image. Only applies to the scaling of matplotlib elements, specifically the colormap

bgcolormatplotlib colorspec

Color of background of image. None gives transparent background.

**kwargs

Additional keyword arguments are forwarded to make_figure. These include:

thickint

Number of layers through the cortical sheet to sample. Only applies for pixelwise = True

depthfloat

Value between 0 and 1 for how deep to sample the surface for the flatmap (0 = gray/white matter boundary, 1 = pial surface)

with_rois, with_labels, with_colorbar, with_borders, with_dropout, with_curvaturebool, optional

Display the rois, labels, colorbar, annotated flatmap borders, cross-hatch dropout, and curvature

linewidthint, optional

Width of ROI lines. Defaults to roi options in your local options.cfg

linecolortuple of float, optional

(R, G, B, A) specification of line color

roifilltuple of float, optional

(R, G, B, A) specification for the fill of each ROI region

shadowint, optional

Standard deviation of the gaussian shadow. Set to 0 if you want no shadow

labelsizestr, optional

Font size for the label, e.g. “16pt”

labelcolortuple of float, optional

(R, G, B, A) specification for the label color

cutoutstr, optional

Name of flatmap cutout with which to clip the full flatmap

overlay_filestr, optional

Custom ROI overlays file to use

figfigure or ax, optional

Figure into which to plot flatmap