%% Determine Number of Tiles in Image
% Create a Tiff object for the file example.tif.

t = Tiff('example.tif','r');

% Check if the image has a tiled organization, and then get the number of tiles in the image.

if isTiled(t) % If the image has tiled layout
    nTiles = numberOfTiles(t)
end

% Close the Tiff object.

close(t);

% Copyright 2012 The MathWorks, Inc.