setDirectory
使指定的 IFD 成为当前 IFD
说明
示例
浏览 TIFF 文件中的多个图像
浏览 TIFF 文件中的图像文件目录 (IFD),并从不同 IFD 获取标记或图像数据。
为包含三个 IFD 的文件 example.tif
创建一个 Tiff
对象,并显示该文件中当前 IFD 的目录索引编号。
t = Tiff('example.tif','r'); currentDirectory(t)
ans = 1
将当前 IFD 更改为 2
并获取 ImageDescription
标记的值。
setDirectory(t,2);
getTag(t,'ImageDescription')
ans = 'First image converted to grayscale.'
将当前 IFD 更改为 3
并获取 ImageDescription
标记的值。
setDirectory(t,3);
getTag(t,'ImageDescription')
ans = 'Credit: Jeff Mather and Alex Taylor.'
关闭 Tiff
对象。
close(t);
输入参数
算法
参考
此函数对应于 LibTIFF C API 中的 TIFFSetDirectory
函数。要使用此函数,您必须熟悉 TIFF 规范和技术说明。请访问 LibTIFF - TIFF 库和实用工具查看此文档。
版本历史记录
在 R2009b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)