cigvis.viserplot module#

cigvis.viserplot.add_mask(nodes: List, volume: List | ndarray, clim: List | Tuple = None, cmap: str | Dict = None, alpha=None, excpt=None, *, clims: List | Tuple = None, cmaps: str | Dict = None, **kwargs) List#

Add Mask/Overlay volumes

Parameters#

nodes: List[Node]

A List that contains AxisAlignedImage (may be created by create_slices)

volumearray-like or dict

3D foreground volume/mask, or an axis source dict such as {'x': iline_source, 'y': xline_source, 'z': time_source}. Each source value may also be a spec such as {'data': time_source, 'axes': ('z', 'y', 'x')}. Add multiple masks by calling add_mask repeatedly.

climList

[vmin, vmax] for foreground slices plotting

cmapstr, Dict, or Colormap

colormap for foreground slices. A dict such as {'x': 'Reds', 'z': 'Blues'} applies the mask only to those axes.

alphafloat or List[float]

if alpha is not None, using colormap.fast_set_cmap to set cmap

excptNone or str

it could be one of [None, ‘min’, ‘max’, ‘ramp’]

Returns#

slices_nodesList

list of slice nodes

cigvis.viserplot.create_bodies(volume: ndarray, level: float, margin: float = None, color: str = 'yellow', filter_sigma: float | List = None, **kwargs) List#

Create isosurface body nodes for the viser backend.

Parameters#

volumearray-like

3D volume used by marching cubes.

levelfloat

Isovalue extracted from volume.

marginfloat

If not None, set a boundary value before marching cubes.

colorstr or RGB/RGBA

Uniform body color.

filter_sigmafloat or list

Optional Gaussian smoothing before marching cubes.

cigvis.viserplot.create_gaussian_splats(pos: ndarray, values: ndarray = None, cmap: str = 'viridis', clim: List = None, color=None, radius=None, covariances=None, opacity=None, mode: str = 'surface', max_points: int = None, seed: int = 0, scale=-1) List#

Create true Gaussian splats for the Viser backend.

This wraps viser.SceneApi.add_gaussian_splats. radius is expressed in the input data coordinate system before CIGVis scene scaling.

cigvis.viserplot.create_points(points: ndarray, r: float = 2, color='green', cmap='jet', clim=None, point_shape='circle', values=None, colors=None, **kwargs) List#

Create sparse point-cloud nodes for horizons, fault points, or picks.

points can be (N, 3), (N, 4) with the 4th column as scalar values, or (N, 6)/(N, 7) with RGB/RGBA colors. When color is not None, it is used as a uniform color and scalar/color columns are ignored.

cigvis.viserplot.create_server(port=8080, label='cigvis-viser', verbose=False)#
cigvis.viserplot.create_slices(volume: ndarray, pos: List | Dict = None, clim: List = None, cmap: str = 'Petrel', nancolor=None, intersection_lines: bool = True, line_color='white', line_width=1, **kwargs) List#

create a slice node

Parameters#

volumearray-like or dict

3D array, or an axis source dict such as {'x': iline_source, 'y': xline_source, 'z': time_source}. Each source value may also be a spec such as {'data': time_source, 'axes': ('z', 'y', 'x')}.

posList or Dict

init position of the slices, can be a List or Dict, such as: ` pos = [0, 0, 200] # x: 0, y: 0, z: 200 pos = [[0, 200], [9], []] # x: 0 and 200, y: 9, z: None pos = {'x': [0, 200], 'y': [1], z: []} `

climList

[vmin, vmax] for plotting

cmapstr or Colormap

colormap, it can be str or matplotlib’s Colormap

nancolorstr or color

color for nan values, default is None (i.e., transparent)

cigvis.viserplot.create_splats(pos: ndarray, values: ndarray = None, cmap: str = 'viridis', clim: List = None, color=None, size=None, mode: str = 'surface', point_shape: str = None, point_shading: str = None, precision: str = None, max_points: int = None, seed: int = 0, **kwargs) List#

Create point-cloud splats for the Viser backend.

Viser renders these as browser-native point clouds. The API mirrors the VisPy create_splats helper where possible, but per-point size and true Gaussian blending are backend-specific and are not available here.

cigvis.viserplot.create_surfaces(surfs: List[ndarray], volume: ndarray = None, value_type: str = 'depth', clim: List = None, cmap: str = 'jet', alpha: float = 1, shape: Tuple | List = None, interp: bool = False, step1=1, step2=1, **kwargs) List#

create a surfaces node

Parameters#

surfsList or array-like

the surface position, which can be an array (one surface) or List (multi-surfaces). Each surf can be a (n1, n2)/(n1, n2, 2) array or (N, 3)/(N, 4) array, such as >>> surf.shape = (n1, n2) # surf[i, j] means z pos at x=i, y=j # surf[i, j, 0] means z pos at x=i, y=j # surf[i, j, 1] means value for plotting at pos (i, j, surf[i, j]) >>> surf.shape = (n1, n2, 2) # surf[i, j, 1:] means rgb or rgba color at pos (i, j, surf[i, j]) >>> surf.shape = (n1, n2, 4) or (n1, n2, 5) >>> surf.shape = (N, 3) # surf[i, :] means i-th point position # surf[i, :3] means i-th point position # surf[i, 3] means i-th point’s value for plotting >>> surf.shape = (N, 4) # surf[i, 3:] means i-th point color in rgb or rgba format >>> surf.shape = (N, 6) or (N, 7)

volumearray-like

3D array, values when surf_color is ‘amp’

value_typestr

‘depth’ or ‘amp’, show z or amplitude, amplitude can be values in volume or values or colors

climList

[vmin, vmax] of surface volumes

cmapstr or Colormap

cmap for surface

alphafloat

opactity of the surfaces

shapeList or Tuple

If surf’s shape is like (N, 3) or (N, 4), shape must be specified, if surf’s shape is like (n1, n2) or (n1, n2, 2), shape will be ignored

kwargsDict

parameters for vispy.scene.visuals.Mesh

cigvis.viserplot.create_well_logs(logs: List | ndarray, logs_type: str = 'point', cmap: str = 'jet', clim: List = None, width: float = 1, point_shape: str = 'square', **kwargs)#

create well logs nodes

Parameters#

logsList or array-like

List (multi-logs) or np.ndarray (one log). For a log, its shape is like (N, 3) or (N, 4) or (N, 6) or (N, 7), the first 3 columns are (x, y, z) coordinates. If 3 columns, use the third column (z) as the color value (mapped by cmap), if 4 columns, the 4-th column is the color value (mapped by cmap), if 6 or 7 columns, colors are RGB format.

logs_typestr

‘point’ or ‘line’, draw points or line segments

cmapstr

colormap for logs

climList

[vmin, vmax] of logs

widthfloat

width of line segments or points

point_shapestr

point shape for points, ‘square’, ‘circle’ or others, only when logs_type is ‘point’

Linking Multiple Server Instances to Each Other

cigvis.viserplot.plot3D(nodes, axis_scales=[1, 1, 1], fov=30, look_at=None, wxyz=None, position=None, server=None, run_app=True, **kwargs)#
cigvis.viserplot.run()#