Closed ptbrown1729 closed 2 years ago
Hi @ptbrown1729! Thank you for such a detailed report 🙂 I think both things are true, you've come across a performance limitation and you're not using the package as intended.
I'll look into the performance side of things next week. For now, could you try to set just two keyframes, one at the start one at the end of your time series, with linear interpolation between the keyframes and an appropriate number of steps?
Interpolation between keyframes was the intended mode of use and will likely solve your performance issues 🙂
@alisterburt thanks for the help. Ok, seems like user error. If I replace the last portion of my example with
# animate programmatically
print("collecting frames...")
# animate programmatically
animation = Animation(viewer)
# plot layer, then capture
viewer.dims.set_current_step(0, 0)
animation.capture_keyframe()
viewer.dims.set_current_step(0, nt - 1)
animation.capture_keyframe(steps=nt)
fname_out = Path(r"C:\Users\q2ilab\Desktop\animation_test.mp4")
animation.animate(fname_out, canvas_only=True)
then the animation is produced quickly and correctly
Looking at the examples I see that this is basically the same code as in animate2D.py
. I guess it did not click with me that that was time series data before. Oh well, as usual it pays to look through the examples...
Really glad to hear this is working better for you - we need to improve the documentation that's for sure
I'll close this now, thanks again for the report!
I have 3D time series images, and I am trying to export a movie showing time-series data of a three orthogonal max-projections. When I script napari-animation I find initially the each frame is acquired quickly, but as the number of frames increases the time to acquire a frame
animation.capture_keyframe(steps=1)
slows down dramatically. In my case, I am trying to export 10,000 time points for images with size ~1632 x 880, and a similar script to my example below took 3 days to run. I am comparing this with manually creating frames and exporting with mmpeg, which takes perhaps 10 minutes.My question/issue is: am I running into a limitation of napari or napari-animation, or am I using it wrong?
Here's my system info:
Here is a minimal example. For the first 50 frames or so each frame takes ~0.1s to capture. By frame 600 this has increased to ~0.4s.