home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.soft-sys.khoros
- Path: sparky!uunet!usc!elroy.jpl.nasa.gov!henry!mathew
- From: mathew@elroy.Jpl.Nasa.Gov (Mathew Yeates)
- Subject: Re: Unsigned Image Data
- Message-ID: <mathew.725703211@henry>
- Sender: news@elroy.jpl.nasa.gov (Usenet)
- Nntp-Posting-Host: henry.jpl.nasa.gov
- Organization: Image Analysis Systems Group, JPL
- References: <42334@pprg.eece.unm.edu.pprg.unm.edu> <mathew.725698131@henry>
- Date: Wed, 30 Dec 1992 08:13:31 GMT
- Lines: 36
-
- mathew@elroy.Jpl.Nasa.Gov (Mathew Yeates) writes:
-
-
- >Is there a khoros function for handling unsigned integers?
- >i.e. 8, 16, and 32 bit integer pixels.
- >For example, one CCD system I have produces 16 bit unsigned
- >pixels in a FITS file format. The fits2viff conversion program
- >doesn't like 16 bit FITS files, so I tried raw2viff which treats
- >the data as 16 bit signed values.
- >Robert A. Nolan a.k.a. nolan@kane.rpsmaui.com
-
- Optionally, you can figure out how to convert from one representation
- to another. Im on a Sun Sparc and to convert the number to its
- correct unsigned value, I add 2^16 = 65536 to all negative pixels.
- So the following takes a raw unsigned short data file and converts
- to a VIFF int file.
-
- ---------------------------ushort2int---------------------------------
-
- #!/bin/sh
- #usage: kscript filename rows cols
- #creates: filename.viff
-
- #first convert to int file
- raw2viff -i $1 -r $2 -c $3 -t short -o -|\
- vconvert -i - -o /tmp/ushort2int.tmp -s 1.0 -t int
-
- #offset only negative pixels
- vclip -i /tmp/ushort2int.tmp -l -2e15 -u 0 -o -| \
- voffset -i /tmp/ushort2int.tmp -o $1.viff -m - -x 65536
-
- rm -f /tmp/ushort2int.tmp
- -------------------------------------------------------------------
-
- Mathew
-
-