Kitware / LookingGlassVTKModule

Other
15 stars 12 forks source link

Add ability to save quilt images and movies #20

Closed psavery closed 3 years ago

psavery commented 3 years ago

This adds functions to the vtkLookingGlassInterface for saving quilt images and movies.

Saving quilt images is performed by calling SaveQuilt(). This will re-render the render window with the quilt on it, then write out the quilt image via vtkWindowToImageFilter, then re-render the render window again to restore it to its previous state.

Saving quilt movies is performed by calling StartRecordingQuilt(), then WriteQuiltMovieFrame() each time a movie frame should be written, and then StopRecordingQuilt() to finalize. Each time WriteQuiltMovieFrame() is called, the quilt is rendered to the render window and then written out with vtkWindowToImageFilter. In ParaView, WriteQuiltMovieFrame() is called immediately before rendering to the device.

For quilt movies, the MP4 video format is preferred since it is the only format we can write that the Looking Glass can load, but the MP4 writer is only available on Windows. For other platforms, AVI or OGG will be written out, and the user will have to convert the file to MP4.

Because different LG devices have different optimal quilt settings (see here), quilts produced from one type of LG device might not look the best on a different type of LG device. Some thought was given to add options to either a) allow quilt settings to be used that look decent on all devices or b) allow selecting quilt settings that target specific devices. However, the ideal position of the focal plane may differ for different quilt settings, so producing a quilt that matches your local LG device's settings is optimal, since you can see how it looks and move the focal plane into an ideal position before saving the quilt. Thus, the quilts that are created with the current setup will ideally be used on the same kind of device that was used to create the quilt.

The corresponding ParaView MR is here.

martinken commented 3 years ago

If you've tested it out and it works then +1 LGTM

psavery commented 3 years ago

This is working, but I'm about to add a commit to increase the resolution of the images that get written out.

The current setup writes out quilts that look a little low resolution compared to what ParaView renders. Increasing the resolution of the display window while writing out the images seems to fix that.

psavery commented 3 years ago

Okay, that commit was added, and the quilts are looking nice I think.

This is ready for review and merging.

martinken commented 3 years ago

+1