Code covered by the BSD License  

Highlights from
3D Free Form Image Registration Toolbox (GUI)

image thumbnail
from 3D Free Form Image Registration Toolbox (GUI) by Daniel Markel
A toolbox for performing image registrations on 4D RTOG files or any other volumetric image.

example.m
aviobj = avifile('M:\My Documents\moviename.avi','compression','Cinepak'); %open new movie file
f = getframe(gcf); %capture frame from current figure
    aviobj = addframe(aviobj,f); %add frame to the existing movie file
    aviobj = close(aviobj); %save/close the movie

Contact us at files@mathworks.com