recipes : movies : Importing a tiff movie

Problem

You want to read a multi-page tiff (a tiff movie) into Matlab.

Solution

Use imread in a loop.

%Extract the number of frames from the tiff file's information. The
%number of columns in structure is equal to the number of frames. 
imageInfo=imfinfo('myMovie.tiff');
numFrames=length(imageInfo);

%Pre-size the movie matrix
imSize=[imageInfo(1).Height,imageInfo(1).Width,numFrames];
myMovie=ones(zeros(imSize));

for frame=1:numFrames
  imageStack(:,:,frame)=imread('myMovie.tiff',frame);
end

Discussion

The above can readily be converted into a function. Note that imfinfo returns a lot of information about your images. In particular, some image acquisition software store a great deal of meta-data in the "ImageDescription" field as plain text. You may, for example, be able to extract the camera settings used to acquire the images.