Path: news.mathworks.com!newsfeed-00.mathworks.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!bnewspeer01.bru.ops.eu.uu.net!bnewspeer00.bru.ops.eu.uu.net!emea.uu.net!ash.uu.net!spool.news.uu.net!not-for-mail
Newsgroups: comp.soft-sys.matlab
Subject: Re: Problem reading multi-image TIFF files
References: <1257756236.780240@irys.nyx.net> <5aa1ff6c-4d5e-4f87-8f25-f8ea149c6ac9@m35g2000vbi.googlegroups.com>
Organization: Nyx, Spirit of the Night
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
From: fburton@nyx.net (Francis Burton)
Originator: fburton@nyx.net (Francis Burton)
Message-ID: <1257769745.590589@irys.nyx.net>
Cache-Post-Path: irys.nyx.net!1319@nyx3.nyx.net
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
Date: 09 Nov 2009 12:29:06 GMT
Lines: 104
NNTP-Posting-Host: 206.124.29.6
X-Trace: 1257769746  23895 206.124.29.6
Xref: news.mathworks.com comp.soft-sys.matlab:583523


In article <5aa1ff6c-4d5e-4f87-8f25-f8ea149c6ac9@m35g2000vbi.googlegroups.com>,
ImageAnalyst  <imageanalyst@mailinator.com> wrote:
>-----------------------------------------------------------------
>What version do you have?  R2009b has a new Tiff reader function that
>you can use instead of imread.  But I bet imread will still work if
>you call it correctly and have a valid image.

R2009a sadly.

imfinfo('original.stk') gives some strange 'Software' and 'DateTime'
field values:

                     Filename: [1x59 char]
                  FileModDate: '21-Mar-2009 09:57:28'
                     FileSize: 6516203
                       Format: 'tif'
                FormatVersion: []
                        Width: 696
                       Height: 520
                     BitDepth: 16
                    ColorType: 'grayscale'
              FormatSignature: [73 73 42 0]
                    ByteOrder: 'little-endian'
               NewSubFileType: 0
                BitsPerSample: 16
                  Compression: 'Uncompressed'
    PhotometricInterpretation: 'BlackIsZero'
                 StripOffsets: [104x1 double]
              SamplesPerPixel: 1
                 RowsPerStrip: 5
              StripByteCounts: [104x1 double]
                  XResolution: 72
                  YResolution: 72
               ResolutionUnit: 'Inch'
                     Colormap: []
          PlanarConfiguration: 'Chunky'
                    TileWidth: []
                   TileLength: []
                  TileOffsets: []
               TileByteCounts: []
                  Orientation: 1
                    FillOrder: 1
             GrayResponseUnit: 0.0100
               MaxSampleValue: 65535
               MinSampleValue: 0
                 Thresholding: 1
                       Offset: 6515981
                     Software: 'II* 
mc * 	  ^Z ^Z * '
                     DateTime: '  * ( ' % & ^Z
 ^Z '

(The ^Z's really are Ctrl-Zs - they caused trn to suspend when I
pasted in the MATLAB output!)

After the file has been through ImageJ, I get this:

>> f=imfinfo('processed.tif');
>> f(1)

ans = 

                     Filename: 'processed.tif'
                  FileModDate: '08-Nov-2009 14:56:48'
                     FileSize: 6515924
                       Format: 'tif'
                FormatVersion: []
                        Width: 696
                       Height: 520
                     BitDepth: 16
                    ColorType: 'grayscale'
              FormatSignature: [77 77 42 0]
                    ByteOrder: 'little-endian'
               NewSubFileType: 0
                BitsPerSample: 16
                  Compression: 'Uncompressed'
    PhotometricInterpretation: 'BlackIsZero'
                 StripOffsets: 356
              SamplesPerPixel: 1
                 RowsPerStrip: 520
              StripByteCounts: 723840
                  XResolution: []
                  YResolution: []
               ResolutionUnit: 'None'
                     Colormap: []
          PlanarConfiguration: 'Chunky'
                    TileWidth: []
                   TileLength: []
                  TileOffsets: []
               TileByteCounts: []
                  Orientation: 1
                    FillOrder: 1
             GrayResponseUnit: 0.0100
               MaxSampleValue: 65535
               MinSampleValue: 0
                 Thresholding: 1
                       Offset: 8
             ImageDescription: [1x61 char]
                  UnknownTags: [2x1 struct]

So I guess what is happening is that ImageJ is stripping out
the corrupted fields, allowing MATLAB to read the file.

Francis