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

Add flythrough animation feature #9

Closed
andinet opened this issue May 5, 2022 · 6 comments
Closed

Add flythrough animation feature #9

andinet opened this issue May 5, 2022 · 6 comments
Assignees

Comments

@andinet
Copy link
Contributor

andinet commented May 5, 2022

We need a flythrough animation feature in VPAW. This is to aid in communicating aspects of a patient’s airway/anatomy to other clinicians. A flythrough path is defined by creating a set of keyframes that store camera poses. The camera poses are interpolated between keyframes to produce smooth camera movement along the camera path.

Task:

A standalone KeyFrameEditor module (or feature added to an existing module) for generating and exporting volume rendering animations. The module will provide a timeline and tracks allowing to save, edit and delete key frames associated with transfer function, ROI clipping box and camera position and orientation. Available keyframe interpolation functions will include ramp, exponential and bezier. Camera path will be represented by a curve annotation.

The plan is to distribute this feature as a standalone module as a Slicer extension or added to an existing module in Slicer core.

PS

Related modules to explore

  1. Sequence module ( https://slicer.readthedocs.io/en/latest/user_guide/modules/sequences.html )

  2. ScreenCapture module ( https://slicer.readthedocs.io/en/latest/user_guide/modules/screencapture.html )

  3. Endoscope module ( https://slicer.readthedocs.io/en/latest/user_guide/modules/endoscopy.html)

  4. SlicerMorph Animator module (Animator:

@andinet andinet assigned andinet and jadh4v and unassigned andinet May 5, 2022
@jadh4v
Copy link
Contributor

jadh4v commented May 12, 2022

Initial survey of modules / extensions that can support our Flythrough requirements.
WIP - will be updating this post more with additional info / discussions (fyi: @jcfr @andinet ):

@jadh4v
Copy link
Contributor

jadh4v commented May 12, 2022

See last paragraph in comment here: https://discourse.slicer.org/t/support-for-keyframe-based-animation/6885/6

How should we implement vpaw flythrough? Should it be keyframe interpolation of camera poses along a curve, or features/structures to look-at as you flythrough.

@jadh4v
Copy link
Contributor

jadh4v commented May 31, 2022

Based on our internal discussions and from the discourse discussion thread, we have decided to modify the Endoscopy module to provide full support for a camera flythrough and keyframe interpolation. We can borrow specific implementations from CameraPath as/if needed.

Keyframe Interpolation

(From Discourse)

  • Add some pure-VTK camera interpolation functionality, perhaps just one class based on vtkQuaternionInterpolator with some extra code to handle changes in field of view and maybe other parameters. This could go in vtkAddon if it’s C++ or in Endoscopy logic if it could be done in python (I’d think it could).

User Interface

(From Discourse)

  • We could use the 3D view camera state itself as a way to insert keyframes. Initially we were considering having a flight mode for the 3D view to assist in flying around and placing keyframes, but since we can define the path curve first, it is probably not needed. The user can just fly along the path and stop and insert keyframes wherever necessary.

  • Regarding display of keyframes we can simply use a camera mesh model to indicate the position or use Plane markups

  • Along with camera pos and fov, would it make sense to also interpolate volume property, etc for better local control of visualization?
    The Animator module has some code for this and it would be nice to either reuse or generalize this feature. Currently it requires that the transfer functions have the same number of control points at the keyframes.

  • We should provide headlights that move with the camera (endoscopy simulation).

Use of Markups

(Discussions with @jcfr)

Nice To Have

(From Discourse)

  • It would also make sense for the Endoscopy module to export to a Sequence, like the Animator does, so that it could be recorded by the ScreenCapture logic. -- Steve Pieper

@allemangD
Copy link

allemangD commented Jul 1, 2022

It may also be worth looking into Dependant Markups for automatic updating of related markups.

MarkupConstraints now has its own repository; refer to that instead of the old DependantMarkup branch which will no longer be updated. https://github.com/KitwareMedical/SlicerMarkupConstraints

I plan to implement more adaptors (and create a system to register custom adaptors) to allow the constraints system to observe/constrain other nodes than markup control points; for example to observe a spline in its entirety rather than a single control point, or to constrain the position of a model or volume. From what I gather here, that feature would be important for synchronizing camera orientation with other control points so I will create a relevant issue and prioritize that work.

Plane markup has controls to work as a camera pose. Can be used as an interaction widget for placing and modifying camera poses along the flythrough curve.

I believe all markup nodes can enable the interaction widget; for camera position it may be better to use a fiducial markup with a single oriented point. I can confirm the interaction widget functions well with MarkupConstraints.

interaction-widget

@jadh4v
Copy link
Contributor

jadh4v commented Aug 15, 2022

Since we want to upgrade endoscopy and contribute it upstream into core Slicer, I have created a parallel issue / enhancement request in Slicer core here:
Slicer/Slicer#6502
cc: @HarryDC @andinet

@Leengit
Copy link
Contributor

Leengit commented Feb 23, 2024

I am closing this issue in favor of Issue Slicer/Slicer#6502 under the thinking that the implementation will be within Slicer's Endoscopy module rather than within VPAW.

@Leengit Leengit closed this as completed Feb 23, 2024
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

4 participants