brainglobe / brainrender

a python based software for visualization of neuroanatomical and morphological data.
https://brainglobe.info/documentation/brainrender/index.html
BSD 3-Clause "New" or "Revised" License
540 stars 75 forks source link

Added an example to dynamically alter the scene in each frame #376

Closed IgorTatarnikov closed 4 weeks ago

IgorTatarnikov commented 4 weeks ago

Before submitting a pull request (PR), please read the contributing guide.

Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)

Description

What is this PR

Why is this PR needed? See https://forum.image.sc/t/brainrender-animation-of-slices/100612

What does this PR do? Adds a new flag to make_video to fix the camera to the perspective of the first frame. Otherwise, if the root mesh is sliced throughout the animation the perspective will shift as the centre of mass of the root volume shifts.

Passes the callback function to subsequent frames after the last frame.

Adds an example for how to use a callback function to dynamically alter the scene throughout the Animation.

How has this PR been tested?

All tests pass locally.

Is this a breaking change?

No, the new flag is optional and the default provides the previous behaviour.

Does this PR require an update to the documentation?

Yes, will come in subsequent PR.

Checklist:

codecov[bot] commented 4 weeks ago

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 86.62%. Comparing base (242dad8) to head (c0bd5e6). Report is 1 commits behind head on main.

Files Patch % Lines
brainrender/video.py 20.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #376 +/- ## ========================================== - Coverage 88.06% 86.62% -1.44% ========================================== Files 27 27 Lines 1215 1219 +4 ========================================== - Hits 1070 1056 -14 - Misses 145 163 +18 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.