%% Get Strip from RGBA TIFF Image
% Read a strip of data from a TIFF file using the RGBA interface.
% Create a Tiff object for the image file.

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

% Get the number of strips and strip size. The readRGBAStrip 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.

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

% Read the strip containing the fourth row of the image. Since each strip contains 35 rows, specifying any row between 1 and 35 returns the first strip of data.

[RGB,A] = readRGBAStrip(t,4);

% Display the image.

imshow(RGB)

% Close the Tiff object.

close(t);

% Copyright 2012 The MathWorks, Inc.