Looking at these images, they have RGB PhotometricInterpretation and 4 channels (RGB with 1 associated alpha channel):
- Code: Select all
% tiffinfo Image.tiff
TIFF Directory at offset 0x26e8b4 (2549940)
Image Width: 1402 Image Length: 1102
Bits/Sample: 8
Sample Format: unsigned integer
Compression Scheme: LZW
Photometric Interpretation: RGB color
Extra Samples: 1<assoc-alpha>
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 23
Planar Configuration: single image plane
ICC Profile: <present>, 3144 bytes
Predictor: horizontal differencing 2 (0x2)
% tiffinfo SplitChannels.tiff
TIFF Directory at offset 0x1929b8 (1649080)
Image Width: 1763 Image Length: 1266
Bits/Sample: 8
Sample Format: unsigned integer
Compression Scheme: LZW
Photometric Interpretation: RGB color
Extra Samples: 1<assoc-alpha>
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 18
Planar Configuration: single image plane
ICC Profile: <present>, 3144 bytes
Predictor: horizontal differencing 2 (0x2)
- Code: Select all
% ~/code/bioformats-test/tools/showinf -nopix Image.tiff
Checking file format [Tagged Image File Format]
Initializing reader
TiffDelegateReader initializing Image.tiff
Reading IFDs
Populating metadata
Checking comment style
Populating OME metadata
Initialization took 0.077s
Reading core metadata
filename = Image.tiff
Series count = 1
Series #0 :
Image count = 1
RGB = true (4)
Interleaved = false
Indexed = false (false color)
Width = 1402
Height = 1102
SizeZ = 1
SizeT = 1
SizeC = 4 (effectively 1)
Thumbnail size = 128 x 100
Endianness = motorola (big)
Dimension order = XYCZT (certain)
Pixel type = uint8
Valid bits per pixel = 8
Metadata complete = true
Thumbnail series = false
-----
Plane #0 <=> Z 0, C 0, T 0
Reading global metadata
BitsPerSample: 8
Compression: LZW
ExtraSamples: 1
ImageLength: 1102
ImageWidth: 1402
MetaDataPhotometricInterpretation: RGB
MetaMorph: no
NumberOfChannels: 4
Orientation: 1st row - top; 1st column - left
PhotometricInterpretation: RGB
PlanarConfiguration: Chunky
Predictor: Horizontal differencing
SampleFormat: unsigned integer
SamplesPerPixel: 4
% ~/code/bioformats-test/tools/showinf -nopix SplitChannels.tiff
Checking file format [Tagged Image File Format]
Initializing reader
TiffDelegateReader initializing SplitChannels.tiff
Reading IFDs
Populating metadata
Checking comment style
Populating OME metadata
Initialization took 0.057s
Reading core metadata
filename = SplitChannels.tiff
Series count = 1
Series #0 :
Image count = 1
RGB = true (4)
Interleaved = false
Indexed = false (false color)
Width = 1763
Height = 1266
SizeZ = 1
SizeT = 1
SizeC = 4 (effectively 1)
Thumbnail size = 128 x 91
Endianness = motorola (big)
Dimension order = XYCZT (certain)
Pixel type = uint8
Valid bits per pixel = 8
Metadata complete = true
Thumbnail series = false
-----
Plane #0 <=> Z 0, C 0, T 0
Reading global metadata
BitsPerSample: 8
Compression: LZW
ExtraSamples: 1
ImageLength: 1266
ImageWidth: 1763
MetaDataPhotometricInterpretation: RGB
MetaMorph: no
NumberOfChannels: 4
Orientation: 1st row - top; 1st column - left
PhotometricInterpretation: RGB
PlanarConfiguration: Chunky
Predictor: Horizontal differencing
SampleFormat: unsigned integer
SamplesPerPixel: 4
In terms of the Bio-Formats API, these aren't independent channels (getEffectiveSizeC()), they are RGB subchannels (getRGBChannelCount()). How you choose to interpret and display this data is up to you.
Looking at your code, you're using a BufferedImage for displaying the data. I'm not totally familiar with this component, but one thing is clear: your data is not simple RGB or RGBA data from what I can tell. The 4th subchannel is not alpha; it's a fourth subchannel. I think you might need to look at customising ColorModel (
http://docs.oracle.com/javase/7/docs/ap ... Model.html) for your BufferedImage to combine the four subchannels as you see fit i.e. to combine the colours for all four channels to give you a single pixel value. i.e. decide what the colours should be for C1-C4, and then set R=r1+r2+r3+r4, G=g1+g2+g3+g4 and B=b1+b2+b3+b4 (for example).
I hope that's some help. I can't see any problems with either your image data or how bioformats is interpreting and handling the data; it looks like it's down to how you want to visualise the data.
Kind regards,
Roger Leigh