I have 3D matrix and the pixel spacing about volume , how can l get volume render.
Thank you! I will do that!
PyVista also makes the uber-easy:
import pyvista as pv
import numpy as np
from scipy import signal
# Make some arbitrary 3D array
g = signal.gaussian(100, std=20)
x, y, z = np.meshgrid(g,g,g)
vol = x * y * z
# Plot it with PyVista
pv.plot(vol, volume=True, opacity="sigmoid_5")
Then of course, you can get fancy by making this an actual VTK dataset to set the spacing:
grid = pv.UniformGrid(vol.shape)
grid.spacing = (2,2,2)
grid["data"] = vol.ravel()
grid.plot(volume=True)