MATLAB Answers

How to read a multiframe tiff in MATLAB?

10 views (last 30 days)
Deepa Maheshvare
Deepa Maheshvare on 3 Jul 2020
Answered: Image Analyst on 4 Jul 2020
I am trying to read a multiframe tiff of dimension 610 x 610 x 1200
Using imread('file.tiff') reads only the first image as mentioned in the documentation.
I would like to know how to read all frames.
ip = imread('file.tiff')
size(ip) = 610 610
but I want it to return
size(ip) = 610 610 1200


Show 5 older comments
Deepa Maheshvare
Deepa Maheshvare on 4 Jul 2020
ip = imread('file.tiff', 'Frames', 'all');
Unrecognized parameter name 'Frames'.
Walter Roberson
Walter Roberson on 4 Jul 2020
Your release should recognize Frames as an option. On the other hand, it appears that your release does not recognize Frames for TIFF files. It appears that you will need to loop specifying the index to read each time. You should be able to work out the number of frames by examining the imfinfo() structure.
for frame = 1 : 1200
ip(:,:,frame) = imread('file.tiff', frame);
... or use the Tiff() class.

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 4 Jul 2020
This is what I do in my app having multipage tiffs
info = imfinfo(imageFullFileName);
numberOfPages = length(info);
for k = 1 : numberOfPages
% Read the kth image in this multipage tiff file.
thisPage = imread(imageFullFileName, k);
% Now process thisPage somehow...


Sign in to comment.





Translated by