MATLAB 帮助中心
使指定的 IFD 成为当前 IFD
setDirectory(t,dirNum)
setDirectory(t,dirNum) 将 dirNum 指定的图像文件目录 (IFD) 设置为当前 IFD。Tiff 对象函数作用于当前的 IFD。
t
dirNum
Tiff
示例
全部折叠
浏览 TIFF 文件中的图像文件目录 (IFD),并从不同 IFD 获取标记或图像数据。
为包含三个 IFD 的文件 example.tif 创建一个 Tiff 对象,并显示该文件中当前 IFD 的目录索引编号。
example.tif
t = Tiff('example.tif','r'); currentDirectory(t)
ans = 1
将当前 IFD 更改为 2 并获取 ImageDescription 标记的值。
2
ImageDescription
setDirectory(t,2); getTag(t,'ImageDescription')
ans = 'First image converted to grayscale.'
将当前 IFD 更改为 3 并获取 ImageDescription 标记的值。
3
setDirectory(t,3); getTag(t,'ImageDescription')
ans = 'Credit: Jeff Mather and Alex Taylor.'
关闭 Tiff 对象。
close(t);
代表 TIFF 文件的 Tiff 对象。使用 Tiff 函数创建该对象。
目录索引编号,指定为从 1 开始的正整数。
示例: 2
数据类型: double
double
此函数对应于 LibTIFF C API 中的 TIFFSetDirectory 函数。要使用此函数,您必须熟悉 TIFF 规范和技术说明。请访问 LibTIFF - TIFF 库和实用工具查看此文档。
TIFFSetDirectory
在 R2009b 中推出
currentDirectory | nextDirectory
currentDirectory
nextDirectory
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处