Return-Path: <owner-tiff@olympiakos.com>
Received: from localhost (ak4719.spb.edu [127.0.0.1])
	by ak4719.spb.edu (8.12.1/8.12.1/Debian -5) with ESMTP id h2J72vug002788
	for <dron@localhost>; Wed, 19 Mar 2003 10:03:17 +0300
Received: from pop.in02.prd.whowhere.com [209.202.220.196]
	by localhost with POP3 (fetchmail-6.2.0)
	for dron@localhost (single-drop); Wed, 19 Mar 2003 10:03:17 +0300 (MSK)
Received: from gate7.olympiakos.com ([64.32.199.150]) by whowhere.com; Tue, 18 Mar 2003 22:59:07 -0000
X-Envelope-Sender: owner-tiff@olympiakos.com
Received: by gate7.olympiakos.com (Postfix, from userid 65534)
	id B988D1108E; Tue, 18 Mar 2003 17:58:56 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
	by gate7.olympiakos.com (Postfix) with SMTP
	id 9E4DD11084; Tue, 18 Mar 2003 17:58:56 -0500 (EST)
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Tue, 18 Mar 2003 17:58:36 -0500
Delivered-To: tiff-outgoing@gate7.olympiakos.com
Received: by gate7.olympiakos.com (Postfix, from userid 16)
	id D2C831108C; Tue, 18 Mar 2003 17:58:35 -0500 (EST)
Delivered-To: tiff@olympiakos.com
Received: from sheridan.dina.kvl.dk (sheridan.dina.kvl.dk [130.225.40.227])
	by gate7.olympiakos.com (Postfix) with ESMTP id 4AB8911084
	for <tiff@olympiakos.com>; Tue, 18 Mar 2003 17:58:34 -0500 (EST)
Received: from knuth.dina.kvl.dk (mail@knuth.dina.kvl.dk [130.225.40.229])
	by sheridan.dina.kvl.dk (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id XAA27410
	for <tiff@olympiakos.com>; Tue, 18 Mar 2003 23:58:33 +0100
Received: from ekstrom by knuth.dina.kvl.dk with local (Exim 3.36 #1 (Debian))
	id 18vQ2T-00064Y-00
	for <tiff@olympiakos.com>; Tue, 18 Mar 2003 23:58:33 +0100
Date: Tue, 18 Mar 2003 23:58:33 +0100
From: Claus Ekstroem <claus@ekstroem.dk>
To: tiff@olympiakos.com
Subject: Grayscale 16-bit images
Message-ID: <20030318225833.GC23156@dina.kvl.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
User-Agent: Mutt/1.4i
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
X-Status: A
Content-Length: 1840
Lines: 51

Hi,

I'm completely new to tiff images and libtiff in particular so bear with me if I asking something that is beeding 
obvious. From searching the net (and the archives) I can see that this seems to be a fairly common answer, but I can't 
find any solutions or real documentation to guide me. So here goes....

I'm trying to read a 16-bit grayscale image:

Width           2200
Height          1695
BitsPerSample   16
SamplesPerPixel 1

The pixels are a scan from a microarray experiment (a "DNA chip") sp I need to access the intensities of each pixel and I 
need all 16 bits of information. Currently, I considered the following piece of code:

     if (TIFFReadRGBAImage(tif, imageWidth, imageHeight, raster, 0)) { 
          long index = 0;
          for (e = imageHeight-1; e!=-1; e--) {
            for(c = 0; c < imageWidth; c++){          
              int Red = TIFFGetR(raster[e * imageWidth + c]);
              int Green = TIFFGetG(raster[e * imageWidth + c]);
              int Blue = TIFFGetB(raster[e * imageWidth + c]);
              data[index] = Red;
              index++;
            }
            
          }
      }

but that is clealy wrong as the image is converted to 8 bit and the colour-channels become identical. I figure reading 
the file as a RGBAImage is the wrong approach, so could someone mail me a couple of lines of code to read and access the 
individual pixels?

All the best,

Claus

*****************************************
Claus Thorn Ekstrøm <ekstrom@dina.kvl.dk>
Dept of Mathematics and Physics, KVL
Thorvaldsensvej 40
DK-1871 Frederiksberg C
Denmark
Phone:[+45] 3528 2341
Fax:  [+45] 3528 2350
*****************************************


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

