Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-l.b-one.net (mx-l.one.com [91.198.169.59])
	by mail9.b-one.net (Postfix) with ESMTP id 76D6540080A
	for <info@awaresystems.be>; Fri,  5 Mar 2010 05:11:26 +0100 (CET)
Received: by mx-l.b-one.net (Postfix, from userid 106)
	id 6ABA549D38DF; Fri,  5 Mar 2010 05:11:26 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Score: 0.607
X-Spam-Level: 
X-Spam-Status: No, score=0.607 tagged_above=0 required=4
 tests=[HTML_FONT_FACE_BAD=0.606, HTML_MESSAGE=0.001]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-l.b-one.net (Postfix) with ESMTP id 6855E1AD20 for <info@awaresystems.be>;
 Fri,  5 Mar 2010 05:11:25 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 578161D490DF2; Thu,  4 Mar 2010
 23:08:08 -0500 (EST)
Received: from mb1i1.ns.pitt.edu (mb1i1mx.ns.pitt.edu [136.142.11.141]) by
 lists.maptools.org (Postfix) with ESMTP id 0915B1D0E524A for
 <tiff@lists.maptools.org>; Thu,  4 Mar 2010 22:36:38 -0500 (EST)
Received: from [192.168.1.100] (c-67-163-156-169.hsd1.pa.comcast.net
 [67.163.156.169]) by pitt.edu (PMDF V6.3-x11 #31505) with ESMTPSA id
 <0KYS00D0JI11JI@mb1i1.ns.pitt.edu> for tiff@lists.maptools.org; Thu, 04 Mar
 2010 22:36:38 -0500 (EST)
Date: Thu, 04 Mar 2010 22:36:37 -0500
From: Shafiq Abedin <sha33@pitt.edu>
To: tiff@lists.maptools.org
Message-id: <923561C3-79C2-434C-A091-C59CB3B9407A@pitt.edu>
MIME-version: 1.0 (Apple Message framework v1077)
X-Mailer: Apple Mail (2.1077)
Subject: [Tiff] Problem with multipage .stk tiff file
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0742417598=="
Mime-version: 1.0
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org


--===============0742417598==
Content-type: multipart/alternative; boundary=Apple-Mail-5--457294856


--Apple-Mail-5--457294856
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hello All:

I am writing this post after pulling my hair multiple times (I am bald =
now!) and doing many many google searches (all the webpages related to =
libtiff is now imprinted in my brain). I have failed to find a post on =
this mailing list that solves the problem or anywhere for that matter. I =
hate to be repetitive but I have the same problem described in this post =
(http://www.asmail.be/msg0054982856.html). Solution given here is too =
vague for me to pick up on (is it really like a linked list?). I didn't =
find any post related to reading the .stk file (I wish I could give you =
a sample right now but they are extremely big - 2gb ). I can read the =
first in the stack but cant go beyond that. This particular image has =
7400 slices but whenever i do a tiffdump, this is what I get:

test.stk:
Magic: 0x4949 <little-endian> Version: 0x2a
Directory 0: offset 1342567917 (0x5005f5ed) next 0 (0)
SubFileType (254) LONG (4) 1<0>
ImageWidth (256) LONG (4) 1<348>
ImageLength (257) LONG (4) 1<260>
BitsPerSample (258) SHORT (3) 1<16>
Compression (259) SHORT (3) 1<1>
Photometric (262) SHORT (3) 1<1>
ImageDescription (270) ASCII (2) 2545600<Acquired from Photometri ...>
StripOffsets (273) LONG (4) 24<8 7664 15320 22976 30632 38288 45944 =
53600 61256 68912 76568 84224 91880 99536 107192 114848 122504 130160 =
137816 145472 153128 160784 168440 176096>
SamplesPerPixel (277) SHORT (3) 1<1>
RowsPerStrip (278) LONG (4) 1<11>
StripByteCounts (279) LONG (4) 24<7656 7656 7656 7656 7656 7656 7656 =
7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 =
7656 7656 4872>
XResolution (282) RATIONAL (5) 1<72>
YResolution (283) RATIONAL (5) 1<72>
PlanarConfig (284) SHORT (3) 1<1>
ResolutionUnit (296) SHORT (3) 1<2>
Software (305) ASCII (2) 18<MetaMorph 7.1.7.0\0>
DateTime (306) ASCII (2) 21<2009:09:08 17:54:57\0\0>
Predictor (317) SHORT (3) 1<1>
33628 (0x835c) LONG (4) 7435<0 0 1 0 2 4095 3 0 4 1341649855 5 =
1341649863 6 1341649871 7 1341649880 8 0 9 255 11 128 12 64 ...>
33629 (0x835d) RATIONAL (5) 7400<0 0.0383822 0.0380645 0 0.0383822 =
0.0380645 0 0.0383821 0.0380645 0 0.0383821 0.0380645 0 0.038382 =
0.0380645 0 0.038382 0.0380645 0 0.038382 0.0380645 0 0.0383819 =
0.0380645 ...>
33630 (0x835e) RATIONAL (5) 7400<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 =
0 0 0 0 ...>
33631 (0x835f) LONG (4) 7400<28 65536 0 65536 0 65536 0 65536 0 65536 0 =
65536 0 65536 0 65536 0 65536 0 65536 0 65536 0 65536 ...>

My attempt to get the the read Strip or Tile have failed because the =
libtiff  TIFFTAG_TILEBYTECOUNTS  and TIFFTAG_STRIPBYTECOUNTS returns =
only 24. Although I can see the offset info in the dump, I dont know =
actually how to get to the next image and read (using TIFFReadScanline) =
it so that I can manipulate it. I should also mention that the directory =
count is useless here because it returns 1 . This problem might be too =
trivial for you but I need help finding a way to read these images. If =
you please provide examples, it would be most helpful. Thanks in =
advance.=20

--=20
Shafiq

University Of Pittsburgh
McGowan Institute for Regenerative Medicine

--Apple-Mail-5--457294856
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello =
All:<div><br></div><div>I am writing this post after pulling my hair =
multiple times (I am bald now!) and doing many many google searches (all =
the webpages related to libtiff is now imprinted in my brain). I have =
failed to find a post on this mailing list that solves the problem or =
anywhere for that matter. I hate to be repetitive but I have the same =
problem described in this post (<a =
href=3D"http://www.asmail.be/msg0054982856.html">http://www.asmail.be/msg0=
054982856.html</a>). Solution given here is too vague for me to pick up =
on (is it really like a linked list?). I didn't find any post related to =
reading the .stk file (I wish I could give you a sample right now but =
they are extremely big - 2gb ). I can read the first in the stack but =
cant go beyond that. This particular image has 7400 slices but whenever =
i do a tiffdump, this is what I get:</div><div><br></div><div><div><font =
class=3D"Apple-style-span" face=3D"Courier" size=3D"2"><span =
class=3D"Apple-style-span" style=3D"font-size: =
10px;">test.stk:</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">Magic: 0x4949 &lt;little-endian&gt; Version: =
0x2a</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">Directory 0: offset 1342567917 (0x5005f5ed) =
next 0 (0)</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">SubFileType (254) LONG (4) =
1&lt;0&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">ImageWidth (256) LONG (4) =
1&lt;348&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">ImageLength (257) LONG (4) =
1&lt;260&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">BitsPerSample (258) SHORT (3) =
1&lt;16&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">Compression (259) SHORT (3) =
1&lt;1&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">Photometric (262) SHORT (3) =
1&lt;1&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">ImageDescription (270) ASCII (2) =
2545600&lt;Acquired from Photometri =
...&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">StripOffsets (273) LONG (4) 24&lt;8 7664 =
15320 22976 30632 38288 45944 53600 61256 68912 76568 84224 91880 99536 =
107192 114848 122504 130160 137816 145472 153128 160784 168440 =
176096&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">SamplesPerPixel (277) SHORT (3) =
1&lt;1&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">RowsPerStrip (278) LONG (4) =
1&lt;11&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">StripByteCounts (279) LONG (4) 24&lt;7656 =
7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 7656 =
7656 7656 7656 7656 7656 7656 7656 7656 =
4872&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">XResolution (282) RATIONAL (5) =
1&lt;72&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">YResolution (283) RATIONAL (5) =
1&lt;72&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">PlanarConfig (284) SHORT (3) =
1&lt;1&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">ResolutionUnit (296) SHORT (3) =
1&lt;2&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">Software (305) ASCII (2) 18&lt;MetaMorph =
7.1.7.0\0&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">DateTime (306) ASCII (2) 21&lt;2009:09:08 =
17:54:57\0\0&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">Predictor (317) SHORT (3) =
1&lt;1&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">33628 (0x835c) LONG (4) 7435&lt;0 0 1 0 2 =
4095 3 0 4 1341649855 5 1341649863 6 1341649871 7 1341649880 8 0 9 255 =
11 128 12 64 ...&gt;</span></font></div><div><font =
class=3D"Apple-style-span" face=3D"Courier" size=3D"2"><span =
class=3D"Apple-style-span" style=3D"font-size: 10px;">33629 (0x835d) =
RATIONAL (5) 7400&lt;0 0.0383822 0.0380645 0 0.0383822 0.0380645 0 =
0.0383821 0.0380645 0 0.0383821 0.0380645 0 0.038382 0.0380645 0 =
0.038382 0.0380645 0 0.038382 0.0380645 0 0.0383819 0.0380645 =
...&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">33630 (0x835e) RATIONAL (5) 7400&lt;0 0 0 0 0 =
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 =
...&gt;</span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Courier" size=3D"2"><span class=3D"Apple-style-span" =
style=3D"font-size: 10px;">33631 (0x835f) LONG (4) 7400&lt;28 65536 0 =
65536 0 65536 0 65536 0 65536 0 65536 0 65536 0 65536 0 65536 0 65536 0 =
65536 0 65536 ...&gt;</span></font></div><div><br></div><div>My attempt =
to get the the read Strip or Tile have failed because the libtiff =
&nbsp;<span class=3D"Apple-style-span" style=3D"border-collapse: =
collapse; white-space: pre; font-family: monospace; =
">TIFFTAG_TILEBYTECOUNTS  and TIFFTAG_STRIPBYTECOUNTS </span><span =
class=3D"Apple-style-span" style=3D"border-collapse: collapse; =
white-space: pre; "><font class=3D"Apple-style-span" face=3D"'Microsoft =
Sans Serif'">returns only 24. Although I can see the offset info in the =
dump, I dont know actually how to get to the next image and read =
(using&nbsp;<span class=3D"Apple-style-span" style=3D"font-family: =
Times; white-space: normal; font-weight: bold; ">TIFFReadScanline<span =
class=3D"Apple-style-span" style=3D"font-family: 'Microsoft Sans Serif'; =
font-weight: normal; white-space: pre; ">) it so that I can manipulate =
it. I should also mention that the directory count is useless here =
because it returns 1 . This problem might be too trivial for you but I =
need help finding a way to read these images. If you please provide =
examples, it would be most helpful. Thanks in advance. =
</span></span></font></span></div><meta charset=3D"utf-8" =
id=3D"webkit-interchange-charset"><meta charset=3D"utf-8" =
id=3D"webkit-interchange-charset"><div><font class=3D"Apple-style-span" =
face=3D"monospace"><span class=3D"Apple-style-span" =
style=3D"border-collapse: collapse; white-space: pre;"><font =
class=3D"Apple-style-span" face=3D"Helvetica"><span =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
white-space: =
normal;"><br></span></font></span></font></div></div><div><div><span =
class=3D"Apple-style-span" style=3D"font-size: 12px; =
"><div><div>--&nbsp;<br>Shafiq<br><br>University Of =
Pittsburgh<br>McGowan Institute for Regenerative =
Medicine<br></div></div></span></div></div></body></html>=

--Apple-Mail-5--457294856--

--===============0742417598==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
--===============0742417598==--
