Animation Across Given Axis

Hi!

I have a 3D dataset and am displaying it with a slice across the XY plane. I would like to create an animation of the slice iterating through the z-layers to display the range of values. I do not see a way to do this in the GUI. Is this possible in the GUI or the Python version?

Yep! I’ve had to do this manually in the past before, but it’s much easier with the Python API.

Try the following with your own session file. Tweak the SetSliceOffset() increment according to the dimension you are scanning.

from vapor import session, renderer, dataset
from vapor.animation import Animation
import os

ses = session.Session()
ses.Load("/glade/work/pearse/translateSlice/translateSlice.vs3")

slice = ses.GetRenderer("Slice")

anim = Animation(ses)
video_framerate = 30
transitions = 30
initial_offset = slice.GetSliceOffset()

for i in range(0, transitions, 1): 
    slice.SetSliceOffset(initial_offset + 500*i)
    print("Offset " + str(slice.GetSliceOffset()))
    anim.CaptureFrame()

anim.SaveMP4("test.mp4")