Package ij.measure
Class Calibration
java.lang.Object
ij.measure.Calibration
- All Implemented Interfaces:
Cloneable
Calibration objects contain an image's spatial and density calibration data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final String
static final int
static final int
static final int
double
Frame rate in frames per seconddouble
Frame interval in 'timeUnit'sstatic final int
static final int
Plugin writers can use this string to store information about the image.static final int
static final int
boolean
static final int
double
Pixel depth in 'unit'sdouble
Pixel height in 'unit'sdouble
Pixel width in 'unit'sstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
double
X origin in pixels.double
Y origin in pixels.double
Z origin in pixels. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new Calibration object using the default values.Calibration
(ImagePlus imp) Constructs a new Calibration object using the default values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if this image is density calibrated.clone()
copy()
Returns a clone of this object.void
boolean
equals
(Calibration cal) Compares two Calibration objects for equality.double[]
Returns the calibration function coefficients.float[]
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
Returns the calibration function ID.boolean
Returns the 'invertY' flag.double
getRawValue
(double value) Converts a density calibrated value into a raw pixel value.double
getRawX
(double x) Converts a x-coordinate in physical units to pixels.double
getRawY
(double y) Converts a y-coodinate in physical units to pixels.double
getRawY
(double y, int imageHeight) Converts a y-coodinate in physical units to pixels, taking into account the 'invertY' flag.Returns the distance unit (e.g.getUnit()
Returns the default length unit (e.g.getUnits()
Returns the plural form of the length unit (e.g.Returns the value unit.double
getX
(double x) Converts a x-coodinate in pixels to physical units (e.g.getXUnit()
Returns the X length unit.double
getY
(double y) Converts a y-coordinate in pixels to physical units (e.g.double
getY
(double y, int imageHeight) Converts a y-coordinate in pixels to physical units (e.g.getYUnit()
Returns the Y length unit, or the default unit if 'yunit' is null.double
getZ
(double z) Converts a z-coordinate in pixels to physical units (e.g.getZUnit()
Returns the Z length unit, or the default unit if 'zunit' is null.boolean
Returns true if this is a signed 16-bit image.boolean
scaled()
Returns true if this image is spatially calibrated.void
Sets the calibration table.void
setFunction
(int function, double[] coefficients, String unit) Sets the calibration function, coefficient table and unit (e.g.void
setFunction
(int function, double[] coefficients, String unit, boolean zeroClip) void
Disables the density calibation if the specified image has a differenent bit depth.void
setInvertY
(boolean invertYCoordinates) Sets the 'invertY' flag.static void
setLoopBackAndForth
(boolean loop) Set the default state of the animation "Loop back and forth" flagvoid
Sets up a calibration function that subtracts 32,768 from pixel values.void
setTimeUnit
(String unit) Sets the time unit (e.g.void
Sets the default length unit (e.g.void
setValueUnit
(String unit) Sets the value unit.void
Sets the X length unit.void
Sets the Y length unit.void
Sets the Z length unit.toString()
boolean
zeroClip()
Returns true if zero clipping is enabled.
-
Field Details
-
STRAIGHT_LINE
public static final int STRAIGHT_LINE- See Also:
-
POLY2
public static final int POLY2- See Also:
-
POLY3
public static final int POLY3- See Also:
-
POLY4
public static final int POLY4- See Also:
-
EXPONENTIAL
public static final int EXPONENTIAL- See Also:
-
POWER
public static final int POWER- See Also:
-
LOG
public static final int LOG- See Also:
-
RODBARD
public static final int RODBARD- See Also:
-
GAMMA_VARIATE
public static final int GAMMA_VARIATE- See Also:
-
LOG2
public static final int LOG2- See Also:
-
RODBARD2
public static final int RODBARD2- See Also:
-
EXP_WITH_OFFSET
public static final int EXP_WITH_OFFSET- See Also:
-
GAUSSIAN
public static final int GAUSSIAN- See Also:
-
EXP_RECOVERY
public static final int EXP_RECOVERY- See Also:
-
NONE
public static final int NONE- See Also:
-
UNCALIBRATED_OD
public static final int UNCALIBRATED_OD- See Also:
-
CUSTOM
public static final int CUSTOM- See Also:
-
DEFAULT_VALUE_UNIT
- See Also:
-
pixelWidth
public double pixelWidthPixel width in 'unit's -
pixelHeight
public double pixelHeightPixel height in 'unit's -
pixelDepth
public double pixelDepthPixel depth in 'unit's -
frameInterval
public double frameIntervalFrame interval in 'timeUnit's -
fps
public double fpsFrame rate in frames per second -
loop
public boolean loop -
xOrigin
public double xOriginX origin in pixels. -
yOrigin
public double yOriginY origin in pixels. -
zOrigin
public double zOriginZ origin in pixels. -
info
Plugin writers can use this string to store information about the image. This string is saved in the TIFF header if it is not longer than 64 characters and it contains no '=' or '\n' characters.
-
-
Constructor Details
-
Calibration
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 Details
-
scaled
public boolean scaled()Returns true if this image is spatially calibrated. -
setUnit
Sets the default length unit (e.g. "mm", "inch"). -
setXUnit
Sets the X length unit. -
setYUnit
Sets the Y length unit. -
setZUnit
Sets the Z length unit. -
getUnit
Returns the default length unit (e.g. "micron", "inch"). -
getXUnit
Returns the X length unit. -
getYUnit
Returns the Y length unit, or the default unit if 'yunit' is null. -
getZUnit
Returns the Z length unit, or the default unit if 'zunit' is null. -
getUnits
Returns the plural form of the length unit (e.g. "microns", "inches"). -
setTimeUnit
Sets the time unit (e.g. "sec", "msec"). -
getTimeUnit
Returns the distance unit (e.g. "sec", "msec"). -
getX
public double getX(double x) Converts a x-coodinate in pixels to physical units (e.g. mm). -
getY
public double getY(double y) Converts a y-coordinate in pixels to physical units (e.g. mm). -
getY
public double getY(double y, int imageHeight) Converts a y-coordinate in pixels to physical units (e.g. mm), taking into account the invertY and global "Invert Y Coordinates" flags. -
getZ
public double getZ(double z) Converts a z-coordinate in pixels to physical units (e.g. mm). -
getRawX
public double getRawX(double x) Converts a x-coordinate in physical units to pixels. -
getRawY
public double getRawY(double y) Converts a y-coodinate in physical units to pixels. -
getRawY
public double getRawY(double y, int imageHeight) Converts a y-coodinate in physical units to pixels, taking into account the 'invertY' flag. -
setFunction
Sets the calibration function, coefficient table and unit (e.g. "OD"). -
setFunction
-
setImage
Disables the density calibation if the specified image has a differenent bit depth. -
disableDensityCalibration
public void disableDensityCalibration() -
getValueUnit
Returns the value unit. -
setValueUnit
Sets the value 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. With 8-bit images, the table has a length of 256. With 16-bit images, the length is 65536. -
setCTable
Sets the calibration table. With 8-bit images, the table must have a length of 256. With 16-bit images, it must be 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
Returns a clone of this object. -
clone
-
equals
Compares two Calibration objects for equality. -
isSigned16Bit
public boolean isSigned16Bit()Returns true if this is a signed 16-bit image. -
setSigned16BitCalibration
public void setSigned16BitCalibration()Sets up a calibration function that subtracts 32,768 from pixel values. -
zeroClip
public boolean zeroClip()Returns true if zero clipping is enabled. -
setInvertY
public void setInvertY(boolean invertYCoordinates) Sets the 'invertY' flag. -
getInvertY
public boolean getInvertY()Returns the 'invertY' flag. -
setLoopBackAndForth
public static void setLoopBackAndForth(boolean loop) Set the default state of the animation "Loop back and forth" flag -
toString
-