Tiff.isTiled
Tells whether the current image is stored in tiles.
Category: Data Import and Analysis > Data Import and Export
Syntax
tf = isTiled(t)
Returns true for a tiled image and false for a stripped one.
Description
The method acts on a Tiff object created with Tiff(filename, mode). Use it to choose between the strip functions (numberOfStrips, readEncodedStrip) and the tile functions (numberOfTiles, readEncodedTile), because the wrong family gives an error.
Input arguments
tTiffobject opened for reading.
Output arguments
tf- Logical scalar.
Example
Stripped and tiled files
tag.ImageLength = 8; tag.ImageWidth = 8;
tag.Photometric = Tiff.Photometric.MinIsBlack;
tag.BitsPerSample = 8; tag.SamplesPerPixel = 1; tag.RowsPerStrip = 4;
tag.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
I = uint8(magic(8) * 3);
w = Tiff('t.tif', 'w'); w.setTag(tag); w.write(I); w.close();
tag.ImageLength = 4; tag.ImageWidth = 4;
tag.Photometric = Tiff.Photometric.MinIsBlack;
tag.BitsPerSample = 8; tag.SamplesPerPixel = 1;
tag.TileLength = 16; tag.TileWidth = 16;
tag.PlanarConfiguration = Tiff.PlanarConfiguration.Chunky;
w = Tiff('u.tif', 'w'); w.setTag(tag); w.write(uint8(magic(4))); w.close();
a = Tiff('t.tif', 'r'); b = Tiff('u.tif', 'r');
[a.isTiled() b.isTiled()]
a.close(); b.close();
Output
ans = 1×2 logical array
0 1
See also
Tiff.numberOfStrips Tiff.numberOfTiles Tiff.computeTile Tiff.getTag