vAPE - Interactive 4D volume visualization
👉 Click to run the web app 👈
Installation
with pip
pip install vape4d
Usage
Viewer (jupyter notebook)
from vape4d import viewer
import numpy as np
from matplotlib import pyplot as plt
viewer(
np.random.rand(1,1,32,32,32),
plt.get_cmap("viridis"),
)
Render Image
import numpy as np
from vape4d import diverging_alpha, render
import matplotlib.pyplot as plt
colormap = diverging_alpha(plt.get_cmap("magma"))
img = render(
np.random.rand(2,32,32,32).astype(np.float32),
colormap,
0.5,
width=1024,
height=1024,
)
plt.imshow(img)
plt.axis("off")
plt.savefig("test.png", bbox_inches="tight", pad_inches=0)
plt.show()