Return-Path: <owner-tiff@olympiakos.com>
Received: from nataly.at1895.spb.edu (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.4/8.12.4/Debian-4) with ESMTP id g83IUI18025571
	for <dron@at1895.spb.edu>; Tue, 3 Sep 2002 22:30:18 +0400
Received: from olympiakos.com (uucp@localhost)
	by nataly.at1895.spb.edu (8.12.4/8.12.4/Debian-4) with UUCP id g83IUIK8025569
	for dron@at1895.spb.edu; Tue, 3 Sep 2002 22:30:18 +0400
Received: from knot.pu.ru (knot.pu.ru [193.124.85.214] (may be forged))
	by wg.pu.ru (8.9.1a/8.9.1) with ESMTP id SAA12363
	for <dron@at1895.spb.edu>; Tue, 3 Sep 2002 18:20:55 GMT
Received: from gate7.olympiakos.com (sdsl-64-32-199-150.dsl.iad.megapath.net [64.32.199.150])
	by knot.pu.ru (8.9.3/8.9.0) with ESMTP id WAA26763
	for <dron@at1895.spb.edu>; Tue, 3 Sep 2002 22:20:53 +0400 (MSD)
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id OAA26558;
	Tue, 3 Sep 2002 14:17:24 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Tue, 3 Sep 2002 14:04:30 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id OAA26466
	for tiff-outgoing; Tue, 3 Sep 2002 14:04:23 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from smtp04.nauticom.net (smtp04-pix.nauticom.net [209.195.133.7])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id OAA26463
	for <tiff@olympiakos.com>; Tue, 3 Sep 2002 14:04:19 -0400
Received: from mail1.interscopetech.com (8.swdr2.xdsl.nauticom.net [209.195.139.201])
	by smtp04.nauticom.net (8.12.1/8.12.1) with ESMTP id g83I0109023113;
	Tue, 3 Sep 2002 14:00:02 -0400 (EDT)
Received: from IST42 [172.29.10.132] by mail1.interscopetech.com with ESMTP
  (SMTPD32-7.06) id A8601C7F00CA; Tue, 03 Sep 2002 13:58:56 -0400
Reply-To: <frank@interscopetech.com>
From: "Frank Palmieri" <frank@interscopetech.com>
To: "'Steven Luke'" <steven.luke@mail.tju.edu>, <tiff@olympiakos.com>
Subject: RE: Problem Reading MultiPage TIFFs
Date: Tue, 3 Sep 2002 13:58:56 -0400
Organization: InterScope Technologies, Inc.
Message-ID: <001201c25373$92f35440$840a1dac@interscopetech.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.3416
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
In-Reply-To: <000d01c25058$108215a0$469ca10a@jci.tju.edu>
Importance: Normal
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Content-Transfer-Encoding: 7bit
Status: RO
Content-Length: 4017
Lines: 131

Steven:

1) To access the offset and byte counts directly, there is no API or
interface.  You can access them by using the internal structures of the
tiff library assuming that they get loaded into those structures.
Here's a fragment that shows including the private header files and some
code to use them:

#include "tiffiop.h"	/* include private headers before public header
*/
#include "tif_dir.h"
#include "tiffio.h"
	*
	*
	*
TIFF* in;
TIFFDirectory *td;

in = TIFFOpen(argv[1], "w");
	*
	*
	*
td = &in->tif_dir;
printf("  %lu %s:\n", (long) td->td_nstrips,
       isTiled(out) ? "Tiles" : "Strips");
for (s = 0; s < td->td_nstrips; s++)
{
    printf("    %3lu: [%8lu, %8lu]\n",
           (u_long) s,
           (u_long) td->td_stripoffset[s],
           (u_long) td->td_stripbytecount[s]);
}

2) Reading fields is pretty well documented using the TIFFGetField()
function.  Use the tiffinfo & tiffdump utilities as examples.  These
would also be good samples to look at the data in your tiff file and
modify to determine how well you can access the data with the
information above.

Frank Palmieri frank@interscopetech.com 724-934-5770 x29
 

> -----Original Message-----
> From: owner-tiff@olympiakos.com [mailto:owner-tiff@olympiakos.com] On
> Behalf Of Steven Luke
> Sent: Friday, August 30, 2002 3:04 PM
> To: tiff@olympiakos.com
> Subject: Re: Problem Reading MultiPage TIFFs
> 
> Sorry if this is a re-post, but I seem to have trouble getting mail
> through.
> 
> Thanks for the help on this, but I have run into another problem.  It
> turns
> out that the images I am working with are not set up with multiple
> directories.
> 
> Instead there is a single directory and all the images are stored
> contiguously starting at the first StripOffset.  So Strip #1 of the
second
> image is stored directly after the last Strip of the first image.
Using
> StripOffsets, StripsPerImage, and StripByteCounts I can find the
offset
> for
> each additional image, but I am still having problems.
> 
> 1st:  How do I get LibTiff to read the images at these new offsets?  I
> would
> think there would be a field in the TIFF struct that holds the offset
to
> the
> image, but I can't acces it and without that I can't read any data
past
> the
> last row of the first image.  Is there a workaround for this?  A seek
> function maybe?
> 
> 2nd:  I can't use the directory counting method to find out how many
> images
> are present in the file, since there is only one directory.  The
number is
> present in a couple of tags as the 'count' field.  Is there a way to
get
> at
> the count of a field (for data that is stored in arrays)?
> 
> 3rd: I took at look at the TIFFClientOpen function hoping that it was
the
> answer to my problems, but I don't understand it enough to get
started.
> (You will see how new I am at this with these questions)  Where does
the
> thandle_t clientdata handle come from?  Is it some value that I
assign,
> arbitrary in nature, or should it be something that really means
something
> (and what)?  I would have to write a TIFFlseek function for the
> TIFFSeekProc
> callback, but I am not really sure where to get started with this.
Could
> someone show me an example piece of code?  Would I have to write
callbacks
> for all the procs listed in the TIFFClientOpen call or would I be able
to
> just pass NULLs to the ones I dont want to use?  As you can see, I
really
> am
> not sure where to get started, if somebody could show me an example
> program
> that uses the TIFFClientOpen it would help a lot.
> 
> Thanks again,
> 
> Steven Luke
> --
> Steven J. Luke
> Kimmel Cancer Center Bioimaging Facility
> Thomas Jefferson University
> Philadelphia, Pennsylvania
> 
> 
> To subscribe or unsubscribe email tiff-request@olympiakos.com with
> subscribe
> or unsubscribe in the email body.  Libtiff home page:
> http://www.libtiff.org



To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org

