.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/webgl/multiple_datasets.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_multiple_datasets.py: =============================================== Create a 3D WebGL Viewer with Multiple Datasets =============================================== A webgl viewer displays a 3D view of brain data in a web browser Multiple datasets can be loaded into the same viewer The `priority` kwarg passed to Volume objects determines the display ordering Lower values of `priority` are displayed first In the browser you can switch between datasets with the + and - keys .. GENERATED FROM PYTHON SOURCE LINES 17-38 .. code-block:: default import cortex import numpy as np np.random.seed(1234) # gather multiple datasets volume1 = cortex.Volume.random(subject='S1', xfmname='fullhead', priority=1) volume2 = cortex.Volume.random(subject='S1', xfmname='fullhead', priority=2) volume3 = cortex.Volume.random(subject='S1', xfmname='fullhead', priority=3) volumes = { 'First Dataset': volume1, 'Second Dataset': volume2, 'Third Dataset': volume3, } # create viewer cortex.webgl.show(data=volumes) # 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" .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_webgl_multiple_datasets.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: multiple_datasets.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: multiple_datasets.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_