How to read a multiframe tiff in MATLAB?

조회 수: 144 (최근 30일)
Deepa Maheshvare
Deepa Maheshvare 2020년 7월 3일
답변: Image Analyst 2020년 7월 4일
Hello,
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')
i.e
size(ip) = 610 610
but I want it to return
size(ip) = 610 610 1200
  댓글 수: 8
Walter Roberson
Walter Roberson 2020년 7월 4일
편집: Walter Roberson 2020년 7월 4일
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);
end
... or use the Tiff() class.
Deepa Maheshvare
Deepa Maheshvare 2020년 7월 4일
Thank you

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2020년 7월 4일
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...
end

카테고리

Help CenterFile Exchange에서 Image Data에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by