Note
Go to the end to download the full example code
viser comparison#
A demo to comarison different results in a browser.
# 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, cmaps='jet', alpha=1, excpt='min')
viserplot.plot3D(nodes1, server=s1, run_app=False)
viserplot.plot3D(nodes2, server=s2, run_app=False)
viserplot.run()
Total running time of the script: (0 minutes 0.000 seconds)