通过使用imwrite气管无名动脉瘘管的将图片保存为32位
55视图(30天)
显示旧的评论
你好;
我想拯救我的气管无名动脉瘘管的图像作为32位,但我有这个错误:
不能写uint32数据TIFF文件
这是我的代码:
为K = 1:10
Id {k} = waverec2 (t_C, L,“sym8”);
文件名= [“C: \ \ Id_number_路径”num2str (k)“.tif”];
Id {k} = uint32 (Id {k});
imwrite (Id {k},文件名);
结束
我要拯救我的气管无名动脉瘘管的图像作为32位:/你有什么主意吗?
提前谢谢你
0评论
答案(1)
阿施施Uthama
2014年2月7日
Soum,你点击文档链接了吗?安德烈亚斯在谈论Tiff类,这是一个比IMWRITE不同的接口。
下面是如何使用Tiff类:
%
%开头:
% //www.tianjin-qmedu.com/help/matlab/import_export/exporting-to-images.html br_c_iz-1
data = uint32(魔法(10));
这是一个libtiff直接接口
Tiff (t =“myfile.tif”,' w ');
%设置标签
%这里大量的信息:
% //www.tianjin-qmedu.com/help/matlab/ref/tiffclass.html
tagstruct。ImageLength =大小(数据,1);
tagstruct。ImageWidth =大小(数据,2);
tagstruct。光度= Tiff.Photometric.MinIsBlack;
tagstruct。BitsPerSample = 32;
tagstruct。SamplesPerPixel = 1;
tagstruct。RowsPerStrip = 16;
tagstruct。PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
tagstruct。软件=MATLAB的;
t.setTag (tagstruct)
t.write(数据);
t.close ();
d = imread (“myfile.tif”);
disp(类(d));
断言(isequal (d、数据)