computeStrip

Class: Tiff

Index number of strip containing specified coordinate

Syntax

stripNumber = computeStrip(tiffobj,row)
stripNumber = computeStrip(tiffobj,row,plane)

Description

stripNumber = computeStrip(tiffobj,row) returns the index number of the strip containing the given row. The value of row must be one-based.

stripNumber = computeStrip(tiffobj,row,plane) returns the index number of the strip containing the given row in the specified plane, if the value of the PlanarConfiguration tag is Tiff.PlanarConfiguration.Separate. The values of row and plane must be one-based.

computeStrip clamps out-of-range coordinate values to the bounds of the image.

Examples

expand all

Determine the index number of the strip containing a row in the second image of a file.

Create a Tiff object associated with the example file, example.tif, and make the second image the current directory.

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

Get the number of rows in the image. Then, get the index of the strip containing the middle row.

numRows = getTag(t,'ImageLength');
stripNumber = computeStrip(t,numRows/2)
stripNumber =

     4

Close the Tiff object.

close(t)

Related Examples

References

This method corresponds to the TIFFComputeStrip function in the LibTIFF C API. To use this method, you must be familiar with the TIFF specification and technical notes. View this documentation at LibTIFF - TIFF Library and Utilities.

Was this topic helpful?