.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/viser/04_comparison.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_04_comparison.py: viser comparison ==================== A demo to comarison different results in a browser. .. image:: ../../_static/cigvis/viser/04.gif :alt: image :align: center .. GENERATED FROM PYTHON SOURCE LINES 15-43 .. code-block:: Python # sphinx_gallery_thumbnail_path = '_static/cigvis/viser/04.jpg' import numpy as np from cigvis import viserplot from pathlib import Path root = Path(__file__).resolve().parent.parent.parent sxp = root / 'data/rgt/sx.dat' fxp = root / 'data/rgt/fx.dat' ni, nx, nt = 128, 128, 128 sx = np.fromfile(sxp, np.float32).reshape(ni, nx, nt) fx = np.fromfile(fxp, np.float32).reshape(ni, nx, nt) s1 = viserplot.create_server(8080) s2 = viserplot.create_server(8081) viserplot.link_servers([s1, s2]) nodes1 = viserplot.create_slices(sx, cmap='gray', pos=[20, 20, 100]) nodes2 = viserplot.create_slices(sx, cmap='gray', pos=[20, 20, 100]) nodes2 = viserplot.add_mask(nodes2, fx, cmap='jet', alpha=1, excpt='min') viserplot.plot3D(nodes1, server=s1, run_app=False) viserplot.plot3D(nodes2, server=s2, run_app=False) viserplot.run() .. _sphx_glr_download_gallery_viser_04_comparison.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 04_comparison.ipynb <04_comparison.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 04_comparison.py <04_comparison.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 04_comparison.zip <04_comparison.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_