Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack as web video #199

Open
JohnTigue opened this issue Apr 20, 2020 · 1 comment
Open

Stack as web video #199

JohnTigue opened this issue Apr 20, 2020 · 1 comment

Comments

@JohnTigue
Copy link
Contributor

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

  • TML5 movie: Folks can play the movie, or manipulate time to move up/down stack
  • libgif: rubbable, progress-bar, play/pause and move_to() means can make like a movie i.e. paused movie with draggable time slider equals z-stack explorer.

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
Copy link
Contributor Author

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())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant