matlab:如何保存TIFF系列?
假设我有一个 3D 数组“img”(x、y、帧)并希望将其保存为 TIFF。到目前为止,我是通过像这样逐一保存来做到这一点的:
for K=1:length(img(1, 1, :))
outputFileName = sprintf('img_%d.tif',K);
imwrite(img(:, :, K), outputFileName);
end
很酷,但是如果我想将其保存为一个 tiff 堆栈怎么办?怎么做呢? 谢谢 :)
Lets say I have a 3D array 'img' (x, y, frame) and want to save it as a TIFF. So far I was doing it by saving one-by-one like this:
for K=1:length(img(1, 1, :))
outputFileName = sprintf('img_%d.tif',K);
imwrite(img(:, :, K), outputFileName);
end
cool, but what if I want to save it as a one tiff stack? How to do it?
Thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
参数 'append' 似乎对应于您想。
编辑:
IMAGEJ 在打开这样保存的多个文件时会出现问题。 '压缩','无'正在解决问题:)使用:
The parameter 'append' seems to correspond to what you want.
EDIT:
IMAGEJ has problems when opening multipletiffs saved like that. 'Compression','none' is solving the problem :) use:
我认为现在首选的方法是使用
Tiff
新版本 MATLAB 中的类。I think the preferred method these days is to use the
Tiff
class in newer version of MATLAB.