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 :)
推荐答案
参数'append' 似乎与你想要的相对应.
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 在打开这样保存的多重音时出现问题.'Compression','none' 正在解决问题:) 使用:
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屋!
查看全文