cigvis.utils.plotlyutils module#
utils for plotly visualization in jupyter
TODO: To be improved
- cigvis.utils.plotlyutils.get_image_func(volume, axis, idx, prefunc=None)#
get a slice image from a volume with axis and idx
- cigvis.utils.plotlyutils.kwargs_toaxies(v, key, scene)#
- cigvis.utils.plotlyutils.kwargs_todict(v)#
- cigvis.utils.plotlyutils.make_3Dscene(**kwargs)#
- cigvis.utils.plotlyutils.make_slices(data: ndarray, x: List | int = [], y: List | int = [], z: List | int = [], pos: Dict = None) Tuple[Dict, Dict]#
make slices and locations for plotly
Parameters#
- datanp.ndarray
Input data
- xList or int
x or inline index
- yList or int
y or crossline index
- zList or int
z or time index
Returns#
- slicesDict
slices, Dict[str: np.ndarray]
- posDict
positions of the slices
- cigvis.utils.plotlyutils.make_triang(xx, yy, zz)#
make triang mesh from meshgrid
- cigvis.utils.plotlyutils.make_xyz(idx: int, shape: Tuple | List, axis: str, nshape=None) Tuple[ndarray, ndarray, ndarray]#
make xx, yy, zz (meshgrid) for plotly
Parameters#
- idxint
index
- shapeList or Tuple
len(shape) == 3, data’s shape
- axisstr
axis can be: ‘x’ or ‘inline’, ‘y’ or ‘crossline’, ‘z’ or ‘time’
Returns#
xx : np.ndarray yy : np.ndarray zz : np.ndarray
- cigvis.utils.plotlyutils.verifyshape(sshape: tuple, shape: tuple, axis: str) None#
verify the slice shape is invalid Note: sshape is slice.shape which is transposed if line_first is False