cortex.webgl.make_static

cortex.webgl.make_static(outpath, data, types='inflated', recache=False, cmap='RdBu_r', template='static.html', layout=None, anonymize=False, overlays_available=None, html_embed=True, overlays_visible='rois', 'sulci', labels_visible='rois', overlay_file=None, copy_ctmfiles=True, title='Brain', **kwargs)[source]

Creates a static webGL MRI viewer in your filesystem so that it can easily be posted publically for sharing or just saved for later viewing.

Parameters
outpathstring

The directory where the static viewer will be saved. Will be created if it doesn’t already exist.

dataDataset object or implicit Dataset

Dataset object containing all the data you wish to plot. Can be any type of implicit dataset, such as a single Volume, Vertex, etc. object or a dictionary of Volume, Vertex. etc. objects.

recachebool, optional

Force recreation of CTM and SVG files for surfaces. Default False

templatestring, optional

Name of template HTML file. Default ‘static.html’

anonymizebool, optional

Whether to rename CTM and SVG files generically, for public distribution. Default False

overlays_availabletuple, optional

Overlays availble in the viewer. If None, then all overlay layers of the svg file will be potentially available in the viewer (whether initially visible or not). This provides the option to include, e.g., only a subset of layers for a given static viewer.

overlays_visibletuple, optional

The listed overlay layers will be set visible by default. Layers not listed here will be hidden by default (but can be enabled in the viewer GUI). Default (‘rois’, ‘sulci’)

labels_visibletuple, optional

Labels for the listed layers will be set visible by default. Labels for layers not listed here will be hidden by default (but can be enabled in the viewer GUI). Default (‘rois’, )

**kwargs

All additional keyword arguments are passed to the template renderer.

Other Parameters
typestuple, optional

Types of surfaces to include in addition to the original (fiducial, pial, and white matter) and flat surfaces. Default (‘inflated’, )

cmapstring, optional

Name of default colormap. Default ‘RdBu_r’ TODO: DOES THIS DO ANYTHING ANYMORE?

overlay_filestr, optional

Custom overlays.svg file to use instead of the default one for this subject (if not None). Default None.

html_embedbool, optional

Whether to embed the webgl resources in the html output. Default ‘True’. If ‘False’, the webgl resources must be served by your web server.

copy_ctmfilesbool, optional

Whether to copy the CTM files to the static directory. Default ‘True’. In some use cases, the same CTM data will be used in many static views. To avoid duplication of files, set to ‘False’. (The datastore cache must then be served with your web server).

titlestr, optional

The title that is displayed on the viewer website when it is loaded in a browser.

Notes

You will need a real web server to view this, since file:// paths don’t handle xsrf correctly