reconstrue / brightfield

Reconstruction of biocytin-stained neurons detected in brightfield microscopy image stacks
http://reconstrue.com
Apache License 2.0
2 stars 1 forks source link

Stack as web video #199

Open JohnTigue opened 4 years ago

JohnTigue commented 4 years ago

In 2019 there was one quick attempt to render a HTML5 movie, which did work but was of low quality. Tuning was not attempted.

A web movie should be web friendly, not too big. And a movie is not the tool for deeply exploring the data, it's a quick overview. So, for second attempt, downsample images first then movize.

JohnTigue commented 4 years ago

MPL can do animations, but how well?

# https://stackoverflow.com/a/43447370
import matplotlib.pyplot as plt
import matplotlib.animation
import numpy as np

t = np.linspace(0,2*np.pi)
x = np.sin(t)

fig, ax = plt.subplots()
ax.axis([0,2*np.pi,-1,1])
l, = ax.plot([],[])

def animate(i):
    l.set_data(t[:i], x[:i])
a
ani = matplotlib.animation.FuncAnimation(fig, animate, frames=len(t))

from IPython.display import HTML

#HTML(ani.to_jshtml())
HTML(ani.to_html5_video())