matlab:如何保存TIFF系列? [英] matlab: how to save TIFF series?
本文介绍了matlab:如何保存TIFF系列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
让我们说我有一个3D数组'img'(x,y,框架),并想将其保存为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
很酷,但是如果我想将其保存为一个tiff堆栈怎么办?怎么做? 谢谢:)
cool, but what if I want to save it as a one tiff stack? How to do it? Thanks :)
推荐答案
参数'添加"似乎与您想要的内容相对应.
The parameter 'append' seems to correspond to what you want.
outputFileName = 'img_stack.tif'
for K=1:length(img(1, 1, :))
imwrite(img(:, :, K), outputFileName, 'WriteMode', 'append');
end
打开像这样保存的多重字幕时,IMAGEJ会出现问题. 压缩",无"正在解决问题:)使用:
IMAGEJ has problems when opening multipletiffs saved like that. 'Compression','none' is solving the problem :) use:
imwrite(img(:, :, K), outputFileName, 'WriteMode', 'append', 'Compression','none');
这篇关于matlab:如何保存TIFF系列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文