ij.measure
Class Calibration

java.lang.Object
  |
  +--ij.measure.Calibration

public class Calibration
extends java.lang.Object

Calibration objects contain an image's spatial and density calibration data.


Field Summary
static int EXPONENTIAL
           
 double frameInterval
          Frame interval in seconds
static int GAMMA_VARIATE
           
 boolean invertY
          Set true to display cartesian coordinates (not yet implemented).
static int LOG
           
static int NONE
           
 double pixelDepth
          Pixel depth in 'unit's
 double pixelHeight
          Pixel height in 'unit's
 double pixelWidth
          Pixel width in 'unit's
static int POLY2
           
static int POLY3
           
static int POLY4
           
static int POWER
           
static int RODBARD
           
static int STRAIGHT_LINE
           
static int UNCALIBRATED_OD
           
 int xOrigin
          X origin in pixels.
 int yOrigin
          Y origin in pixels.
 
Constructor Summary
Calibration()
          Constructs a new Calibration object using the default values.
Calibration(ImagePlus imp)
          Constructs a new Calibration object using the default values.
 
Method Summary
 boolean calibrated()
          Returns true if this image is density calibrated.
 Calibration copy()
          Returns a clone of this object.
 void disableDensityCalibration()
           
 double[] getCoefficients()
          Returns the calibration function coefficients.
 float[] getCTable()
          Returns the calibration table.
 double getCValue(double value)
          Converts a raw pixel value to a density calibrated value.
 double getCValue(int value)
          Converts a raw pixel value to a density calibrated value.
 int getFunction()
          Returns the calibration function ID.
 double getRawValue(double value)
          Converts a density calibrated value into a raw pixel value.
 java.lang.String getUnit()
          Returns the distance unit (e.g.
 java.lang.String getUnits()
          Returns the plural form of the distance unit (e.g.
 java.lang.String getValueUnit()
          Returns the density unit.
 double getX(int x)
          Convertes an x-coodinate in pixels to physical units (e.g.
 double getY(int y)
          Convertes an x-coodinate in pixels to physical units (e.g.
 boolean scaled()
          Returns true if this image is spatially calibrated.
 void setFunction(int function, double[] coefficients, java.lang.String unit)
          Sets the calibration function, coefficient table and unit (e.g.
 void setUnit(java.lang.String unit)
          Sets the distance unit (e.g.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STRAIGHT_LINE

public static final int STRAIGHT_LINE

POLY2

public static final int POLY2

POLY3

public static final int POLY3

POLY4

public static final int POLY4

EXPONENTIAL

public static final int EXPONENTIAL

POWER

public static final int POWER

LOG

public static final int LOG

RODBARD

public static final int RODBARD

GAMMA_VARIATE

public static final int GAMMA_VARIATE

NONE

public static final int NONE

UNCALIBRATED_OD

public static final int UNCALIBRATED_OD

pixelWidth

public double pixelWidth
Pixel width in 'unit's

pixelHeight

public double pixelHeight
Pixel height in 'unit's

pixelDepth

public double pixelDepth
Pixel depth in 'unit's

frameInterval

public double frameInterval
Frame interval in seconds

xOrigin

public int xOrigin
X origin in pixels.

yOrigin

public int yOrigin
Y origin in pixels.

invertY

public boolean invertY
Set true to display cartesian coordinates (not yet implemented).
Constructor Detail

Calibration

public Calibration(ImagePlus imp)
Constructs a new Calibration object using the default values.

Calibration

public Calibration()
Constructs a new Calibration object using the default values. For density calibration, the image is assumed to be 8-bits.
Method Detail

scaled

public boolean scaled()
Returns true if this image is spatially calibrated.

setUnit

public void setUnit(java.lang.String unit)
Sets the distance unit (e.g. "mm", "inch").

getUnit

public java.lang.String getUnit()
Returns the distance unit (e.g. "micron", "inch").

getUnits

public java.lang.String getUnits()
Returns the plural form of the distance unit (e.g. "microns", "inches").

getX

public double getX(int x)
Convertes an x-coodinate in pixels to physical units (e.g. mm).

getY

public double getY(int y)
Convertes an x-coodinate in pixels to physical units (e.g. mm).

setFunction

public void setFunction(int function,
                        double[] coefficients,
                        java.lang.String unit)
Sets the calibration function, coefficient table and unit (e.g. "OD").

disableDensityCalibration

public void disableDensityCalibration()

getValueUnit

public java.lang.String getValueUnit()
Returns the density unit.

getCoefficients

public double[] getCoefficients()
Returns the calibration function coefficients.

calibrated

public boolean calibrated()
Returns true if this image is density calibrated.

getFunction

public int getFunction()
Returns the calibration function ID.

getCTable

public float[] getCTable()
Returns the calibration table. For 8-bit images, the table has a length of 256, for 16-bit images, the length is 65536.

getCValue

public double getCValue(int value)
Converts a raw pixel value to a density calibrated value.

getCValue

public double getCValue(double value)
Converts a raw pixel value to a density calibrated value.

getRawValue

public double getRawValue(double value)
Converts a density calibrated value into a raw pixel value.

copy

public Calibration copy()
Returns a clone of this object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object