%% Read Strip of Data from TIFF Image
% Read a strip of image data from a TIFF file that contains an image with a stripped layout.

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

% Determine the number of strips and the length of the strip in the image.

numberOfStrips(t)
getTag(t,'RowsPerStrip')

% Read and display the third strip of the image. The readEncodedStrip function trims the area in a strip that falls outside of the ImageLength boundary. Therefore, image data from a strip at the bottom edge of the image can have different dimensions.

strip = readEncodedStrip(t,3);
imshow(strip);
title('3^{rd} Strip Peppers Image');

% Close the Tiff object.

close(t);

% Copyright 2012 The MathWorks, Inc.