cortex.webgl.make_static

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

Creates a static webGL MRI viewer in your filesystem so that it can easily be posted publicly 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 available 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’, )

Other Parameters:
typestuple, optional

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

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.

layoutNone or list of (int, int)

The layout of the viewer subwindows for showing multiple subjects, passed to the template generator. Default to None, corresponding to no subwindows.

overlay_filestr or None, optional

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

curvature_brightnessfloat or None, optional

Brightness of curvature overlay. Default None, which uses the value specified in the config file.

curvature_contrastfloat or None, optional

Contrast of curvature overlay. Default None, which uses the value specified in the config file.

curvature_smoothnessfloat or None, optional

Smoothness of curvature overlay. Default None, which uses the value specified in the config file.

surface_specularityfloat or None, optional

Specularity of surfaces visualized with the WebGL viewer. Default None, which uses the value specified in the config file under webgl_viewopts.specularity.

**kwargs

All additional keyword arguments are passed to the template renderer.

Notes

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