Main Content

computeStrip

Index number of strip containing specified coordinate

Description

example

stripNumber = computeStrip(t,row) returns the index of the strip containing row. The value of row must be one-based. computeStrip clamps out-of-range coordinate values to the bounds of the image.

stripNumber = computeStrip(t,row,plane) returns the index of the strip containing the row in the specified plane.

Examples

collapse all

Determine the index of the strip containing a specific row from the second image in a TIFF file.

Create a Tiff object for the file example.tif, and then set the image file directory to directory number 2.

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

Get the length of the strips in the image, and then get the index of the strip containing the middle row.

stripLength = getTag(t,'RowsPerStrip')
stripLength = 100
numRows = getTag(t,'ImageLength');
stripNumber = computeStrip(t,numRows/2)
stripNumber = 4

Close the Tiff object.

close(t);

Input Arguments

collapse all

Tiff object representing a TIFF file. Use the Tiff function to create the object.

Row number, specified as a positive integer. The value of row must be one-based.

Example: 10

Data Types: double

Plane number, specified as a positive integer. The value of plane must be one-based.

Use the plane parameter only if the data is organized in separate planes. Data is organized in separate planes when the value of the PlanarConfiguration tag is Tiff.PlanarConfiguration.Separate.

Example: 1

Data Types: double

Algorithms

collapse all

References

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

Version History

Introduced in R2009b