.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/webgl/dynamic_with_custom_template.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_webgl_dynamic_with_custom_template.py: ================================= Dynamic viewer with html template ================================= A webgl viewer displays a 3D view of brain data in a web browser Pycortex has the functionality of provide a custom html template to specify the attributes of the viewer. The file 'my_template.html' included in this directory has css code which changes the color scheme of the controls window. The background is now white, with black text, and the sliders are red instead of blue. The templates files included with pycortex () have been modified by adding the following css code: .. GENERATED FROM PYTHON SOURCE LINES 47-61 .. code-block:: default import cortex import numpy as np np.random.seed(1234) # gather data Volume volume = cortex.Volume.random(subject='S1', xfmname='fullhead') # create viewer cortex.webgl.show(data=volume, template='my_template.html', recache=True) # a port number will then be output, for example "Started server on port 39140" # the viewer can then be accessed in a web browser, in this case at "localhost:39140" # the viewer will display the modifications specified in the template .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_webgl_dynamic_with_custom_template.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: dynamic_with_custom_template.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: dynamic_with_custom_template.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_