Posted by
Wayne Rasband on
May 14, 2008; 9:28pm
URL: http://imagej.273.s1.nabble.com/16-bit-FITS-automatic-conversion-tp3696219p3696221.html
> I have two questions, both related to opening a 16-bit (signed) FITS
> image:
>
> 1. There are no BSCALE or BZERO keywords in the header, but "Show
> Info..." reveals the calibration
> function it claims to be using: y = -32768.0 + 1.0x. It also says
> 'Unit: "gray value"' although I
> don't see this anywhere in the header (no BUNIT keyword). Where is
> this coming from? Does
> ImageJ automatically convert between signed and unsigned values,
> despite the lack of a BZERO
> keyword?
ImageJ supports signed 16-bit images by adding 32,768 and then using
the y = -32768 + x calibration function to recover the original signed
values.
> 2. On this image, the status bar reveals two different "values" for
> every pixel. For example:
> value = 235.00 (33003)
> I see that they differ by 32768. But which of these is the "raw"
> value that is stored in the FITS
> image array, and which is the "calibrated" value? The calibration
> function above suggests the
> parenthetical value is the raw value, but my boss is telling me
> otherwise. (I have opened this file
> in SAOImage ds9 and IDL, and the values I get are the smaller ones,
> which aren't in parentheses
> here. So if those AREN'T the raw values, then all FITS readers must
> know to make this conversion,
> right?)
For signed 16-bit images, the first value is the signed value and the
value in parentheses is the signed value plus 32,368. Otherwise, the
first value is the calibrated value and the value in parentheses is the
raw value.
> 3. I'm using ImageProcessor.getPixelValue in my plugin to access
> these values, recently changed
> from getPixel. The documentation isn't clear on the difference
> between these two functions. Does
> one return the parenthetical value above, and the other return the
> other value?
The getPixelValue(x,y) method returns the calibrated (first) value and
getPixel(x,y) returns the raw value (the one in parenthesis).
-wayne