Main Content

Convert Multiframe Image to Movie

To create a MATLAB®movie from a multiframe image array, use theimmoviefunction. This example creates a movie from a multiframe indexed image.

mov = immovie(X,map);

In the example,Xis a four-dimensional array of images that you want to use for the movie.

To play the movie, use theimplayfunction. This function opens the multiframe image array in aVideo Viewer应用程序。

implay(mov);

This example loads the multiframe imagemri.tifand makes a movie out of it.

mri = uint8(zeros(128,128,1,27));forframe=1:27 [mri(:,:,:,frame),map] = imread('mri.tif',frame);endmov = immovie(mri,map); implay(mov);

Note

MATLAB的电影,你一定是MATLABsoftware installed. To make a movie that can be run outside the MATLAB environment, use theVideoWriterclass to create a movie in a standard video format, such as, AVI.