.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/viser/01.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_viser_01.py: Display a 3D volume of data in web browser using `viserplot` ============================================================== .. image:: ../../_static/cigvis/viser/01.png :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 14-32 .. code-block:: default # sphinx_gallery_thumbnail_path = '_static/cigvis/viser/01.png' import numpy as np from cigvis import colormap, viserplot ni, nx, nt = 400, 600, 360 shape = (ni, nx, nt) data = np.fromfile('data/seis_h360x600x400.dat', dtype=np.float32).reshape(shape) label = np.fromfile('data/label_h360x600x400.dat', dtype=np.float32).reshape(shape) nodes = viserplot.create_slices(data, pos=[20, 30, 320], cmap='gray') cmaps = colormap.set_alpha_except_min('jet', 0.5) nodes = viserplot.add_mask(nodes, label, cmaps=cmaps) viserplot.plot3D(nodes) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_gallery_viser_01.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01.py <01.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01.ipynb <01.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_