필터 지우기
필터 지우기

How to make a tif stack into a meshgrid?

조회 수: 5 (최근 30일)
Breanna
Breanna 2023년 10월 17일
댓글: Walter Roberson 2023년 10월 17일
I have tif files that have 5 z slices in them. I would like to create a meshgrid from these image slices. All x and y should be the same coordinates. Only the z should be changing. I am unsure how to go about this. I am unsure how to make a meshgrid from images instead of data values. Any help would be great. Thanks!

답변 (1개)

Adam Drake
Adam Drake 2023년 10월 17일
Review the documentation for imread:
Specifically, the example with 'corn.tif' will show you different techiques for reading the seperate channels. A possible way to get what you want could be:
x = 1068;
y = 256;
z = 5;
stack = zeros(x,y,z);
for zz = 1:z
stack(:,:,zz) = imread('yourtif.tif', zz);
end
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 10월 17일
It would sometimes be nice if imread() supported vectors of indices or 'all' for reading from TIFF files, like it does for GIF files. But I guess for GIF files the images are certain to be the same size, which is not the case for TIFF files.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by