Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

computeTile - Class: Tiff

Index number of tile containing specified coordinates

Syntax

tileNumber = tiffobj.computeTile([row col])
tileNumber = tiffobj.computeTile([row col], plane)

Description

tileNumber = tiffobj.computeTile([row col]) returns the index number of the tile containing the row and column pixel coordinates. The row and column coordinate values are one-based.

tileNumber = tiffobj.computeTile([row col], plane) returns the index number of the tile containing the row and column pixel coordinates in the specified plane, if the value of the PlanarConfiguration tag is Tiff.PlanarConfiguration.Separate. The row, column, and plane coordinate values are one-based.

computeTile clamps out-of-range coordinate values to the bounds of the image.

Examples

Open a Tiff object and get the index number of the tile containing the last pixel. Replace myfile.tif with the name of a TIFF file on your MATLAB path.

t = Tiff('myfile.tif','r');
% Get the dimensions of the image to calculate coordinates.
numRows = t.getTag('ImageLength');
numCols = t.getTag('ImageWidth');
% Get the ID number of the tile containing the coordinates.
tileNum = t.computeTile([numRows numCols]);

References

This method corresponds to the TIFFComputeTile function in the LibTIFF C API. To use this method, you must be familiar with LibTIFF version 3.7.1 as well as the TIFF specification and technical notes. View this documentation at LibTiff - TIFF Library and Utilities.

See Also

Tiff.computeStrip

Tutorials

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS