Open RealPolitiX opened 6 years ago
Dear Patrick,
There are no concrete plans now, but support for this is trickling in (now that Volume is its own widget). I am a bit worried that the amount of data is too large, but if you use small cubes (256^3) and say max 100 timesteps it should be feasible. If you want to contribute, you are welcome.
cheers,
Maarten
Ah.. bummed to hear this isn't implemented. The documentation doesn't effectively point out that this isn't possible yet.
Hey, anybody who needs a quick hack to make this work -- With ipyvolume 0.5+
import ipyvolume as ipv
import numpy as np
import scipy
# Generate some random data to animate
nx, ny, nz, nt = 16, 16, 16, 10
randvol = np.random.rand( nt, nx, ny, nz )
for i_t, vol in enumerate( randvol ):
randvol[ i_t, ... ] = scipy.ndimage.gaussian_filter( vol, 4 )
fig = ipv.pylab.figure()
ipv.pylab.style.box_off()
ipv.pylab.style.axes_off()
# Plot the first frame
v = ipv.pylab.volshow( randvol[ 0, ... ], opacity = 0.03, level_width = 0.1 )
ipv.pylab.show()
The widget should show up -- now you can "animate it" by just feeding it new data in a loop with a sleep in the middle
import time
for i_t in range( nt ):
v.data = randvol[ i_t, ... ]
time.sleep( 0.5 )
It looks like the 4D animation (3D positions + 1D time) is only possible with the quiver plot. Are there plans to implement something similar for the volshow, such that with a time slider, one can look through a volumetric time series? Thanks.