Help Center
Make specified IFD the current IFD
setDirectory(t,dirNum)
setDirectory(t,dirNum) sets the image file directory (IFD) specified by dirNum as the current IFD. Tiff object functions operate on the current IFD.
t
dirNum
Tiff
example
collapse all
Navigate the image file directories (IFDs) in a TIFF file and get tag or image data from the different IFDs.
Create a Tiff object for the file example.tif which contains three IFDs and display the directory index number for the current IFD in the file.
example.tif
t = Tiff('example.tif','r'); currentDirectory(t)
ans = 1
Change the current IFD to 2 and get the value of the ImageDescription tag.
2
ImageDescription
setDirectory(t,2); getTag(t,'ImageDescription')
ans = 'First image converted to grayscale.'
Change the current IFD to 3 and get the value of the ImageDescription tag.
3
setDirectory(t,3); getTag(t,'ImageDescription')
ans = 'Credit: Jeff Mather and Alex Taylor.'
Close the Tiff object.
close(t);
Tiff object representing a TIFF file. Use the Tiff function to create the object.
Directory index number, specified as a one-based positive integer.
Example: 2
Data Types: double
double
This function corresponds to the TIFFSetDirectory function in the LibTIFF C API. To use this function, you must be familiar with the TIFF specification and technical notes. View this documentation at LibTIFF - TIFF Library and Utilities.
TIFFSetDirectory
Introduced in 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.
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 bat365 country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office