%% Get Index of Tile Containing Last Pixel
% Create a Tiff object for a file and get the number of rows and columns in the image.

t = Tiff('example.tif','r');
numRows = getTag(t,'ImageLength');
numCols = getTag(t,'ImageWidth');

% Get the index of the tile containing the last pixel of the image.

tileNum = computeTile(t,[numRows numCols])

% Close the Tiff object.

close(t);

% Copyright 2012 The MathWorks, Inc.