| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
Index number of tile containing specified coordinates
tileNumber = tiffobj.computeTile([row col])
tileNumber = tiffobj.computeTile([row col], plane)
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.
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]);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.
![]() | computeStrip (Tiff) | computer | ![]() |

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 |