2018.11.13 14:45 "Re: [Tiff] TIFF image has depth 0, bits per sample value 16 and samples per pixel value of 1", by Roger Leigh
On 13/11/2018 14:14, Olumide wrote:
I'm trying to analyze an image that has:
bits per sample value 16
samples per pixel value 1
... see below. What sort of image is this? It does not fit the mould of any of the image types here http://www.mit.edu/afs.new/sipb/project/scanner/arch/i386_rhel3/bin/html/vuesc13.htm
uint32 depth = 0;
uint16 bitsPerSample, samplesPerPixel;
// Returns 0
TIFFGetField( tif, TIFFTAG_IMAGEDEPTH, &depth );
// Returns 16
TIFFGetField( tif, TIFFTAG_BITSPERSAMPLE, &bitsPerSample );
// Returns 1
TIFFGetField( tif, TIFFTAG_SAMPLESPERPIXEL, &samplesPerPixel );
The latter two values look pretty normal for a 16-bit greyscale or indexed image.
The ImageDepth however, is as far as I know a non-standard extension for describing the Z dimension size, to complement ImageWidth and ImageHeight. Is the tag actually present in the source image, if you run tiffinfo on it?
If not present, I would have thought it would be logical for it to default to 1 rather than 0, since it's still a plane of depth 1.
If it is present with a size of 0, that would seem to be a broken image.
Maybe something which libtiff might be able to work around?