- java.lang.Object
-
- ij.measure.Calibration
-
-
Field Summary
Fields Modifier and Type Field Description static intCUSTOMstatic StringDEFAULT_VALUE_UNITstatic intEXP_RECOVERYstatic intEXP_WITH_OFFSETstatic intEXPONENTIALdoublefpsFrame rate in frames per seconddoubleframeIntervalFrame interval in 'timeUnit'sstatic intGAMMA_VARIATEstatic intGAUSSIANStringinfoPlugin writers can use this string to store information about the image.static intLOGstatic intLOG2booleanloopstatic intNONEdoublepixelDepthPixel depth in 'unit'sdoublepixelHeightPixel height in 'unit'sdoublepixelWidthPixel width in 'unit'sstatic intPOLY2static intPOLY3static intPOLY4static intPOWERstatic intRODBARDstatic intRODBARD2static intSTRAIGHT_LINEstatic intUNCALIBRATED_ODdoublexOriginX origin in pixels.doubleyOriginY origin in pixels.doublezOriginZ origin in pixels.
-
Constructor Summary
Constructors Constructor Description Calibration()Constructs a new Calibration object using the default values.Calibration(ImagePlus imp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancalibrated()Returns true if this image is density calibrated.Objectclone()Calibrationcopy()Returns a clone of this object.voiddisableDensityCalibration()booleanequals(Calibration cal)Compares two Calibration objects for equality.double[]getCoefficients()Returns the calibration function coefficients.float[]getCTable()Returns the calibration table.doublegetCValue(double value)Converts a raw pixel value to a density calibrated value.doublegetCValue(int value)Converts a raw pixel value to a density calibrated value.intgetFunction()Returns the calibration function ID.booleangetInvertY()Returns the 'invertY' flag.doublegetRawValue(double value)Converts a density calibrated value into a raw pixel value.doublegetRawX(double x)Converts a x-coordinate in physical units to pixels.doublegetRawY(double y)Converts a y-coodinate in physical units to pixels.doublegetRawY(double y, int imageHeight)Converts a y-coodinate in physical units to pixels, taking into account the 'invertY' flag.doublegetRawZ(double z)Converts a z-coodinate in physical units to pixels.StringgetTimeUnit()Returns the distance unit (e.g.StringgetUnit()Returns the default length unit (e.g.StringgetUnits()Returns the plural form of the length unit (e.g.StringgetValueUnit()Returns the value unit.doublegetX(double x)Converts a x-coodinate in pixels to physical units (e.g.StringgetXUnit()Returns the X length unit.StringgetXUnits()Returns the plural form of the X length unit (e.g.doublegetY(double y)Converts a y-coordinate in pixels to physical units (e.g.doublegetY(double y, int imageHeight)Converts a y-coordinate in pixels to physical units (e.g.StringgetYUnit()Returns the Y length unit, or the default unit if 'yunit' is null.StringgetYUnits()Returns the plural form of the Y length unit (e.g.doublegetZ(double z)Converts a z-coordinate in pixels to physical units (e.g.StringgetZUnit()Returns the Z length unit, or the default unit if 'zunit' is null.StringgetZUnits()Returns the plural form of the Z length unit (e.g.booleanisSigned16Bit()Returns true if this is a signed 16-bit image.booleanscaled()Returns 'true' if this image is spatially calibrated.booleanscaledOrOffset()Returns 'true' if this image is spatially calibrated or has offsets.voidsetCTable(float[] table, String unit)Sets the calibration table.voidsetFunction(int function, double[] coefficients, String unit)Sets the calibration function, coefficient table and unit (e.g.voidsetFunction(int function, double[] coefficients, String unit, boolean zeroClip)voidsetImage(ImagePlus imp)Disables the density calibation if the specified image has a differenent bit depth.voidsetInvertY(boolean invertYCoordinates)Sets the 'invertY' flag.static voidsetLoopBackAndForth(boolean loop)Set the default state of the animation "Loop back and forth" flagvoidsetSigned16BitCalibration()Sets up a calibration function that subtracts 32,768 from pixel values.voidsetTimeUnit(String unit)Sets the time unit (e.g.voidsetUnit(String unit)Sets the default length unit (e.g.voidsetValueUnit(String unit)Sets the value unit.voidsetXUnit(String unit)Sets the X length unit.voidsetYUnit(String unit)Sets the Y length unit.voidsetZUnit(String unit)Sets the Z length unit.StringtoString()booleanzeroClip()Returns true if zero clipping is enabled.
-
-
-
Field Detail
-
STRAIGHT_LINE
public static final int STRAIGHT_LINE
- See Also:
- Constant Field Values
-
POLY2
public static final int POLY2
- See Also:
- Constant Field Values
-
POLY3
public static final int POLY3
- See Also:
- Constant Field Values
-
POLY4
public static final int POLY4
- See Also:
- Constant Field Values
-
EXPONENTIAL
public static final int EXPONENTIAL
- See Also:
- Constant Field Values
-
POWER
public static final int POWER
- See Also:
- Constant Field Values
-
LOG
public static final int LOG
- See Also:
- Constant Field Values
-
RODBARD
public static final int RODBARD
- See Also:
- Constant Field Values
-
GAMMA_VARIATE
public static final int GAMMA_VARIATE
- See Also:
- Constant Field Values
-
LOG2
public static final int LOG2
- See Also:
- Constant Field Values
-
RODBARD2
public static final int RODBARD2
- See Also:
- Constant Field Values
-
EXP_WITH_OFFSET
public static final int EXP_WITH_OFFSET
- See Also:
- Constant Field Values
-
GAUSSIAN
public static final int GAUSSIAN
- See Also:
- Constant Field Values
-
EXP_RECOVERY
public static final int EXP_RECOVERY
- See Also:
- Constant Field Values
-
NONE
public static final int NONE
- See Also:
- Constant Field Values
-
UNCALIBRATED_OD
public static final int UNCALIBRATED_OD
- See Also:
- Constant Field Values
-
CUSTOM
public static final int CUSTOM
- See Also:
- Constant Field Values
-
DEFAULT_VALUE_UNIT
public static final String DEFAULT_VALUE_UNIT
- See Also:
- Constant Field Values
-
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 'timeUnit's
-
fps
public double fps
Frame rate in frames per second
-
loop
public boolean loop
-
xOrigin
public double xOrigin
X origin in pixels.
-
yOrigin
public double yOrigin
Y origin in pixels.
-
zOrigin
public double zOrigin
Z origin in pixels.
-
info
public String 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 Detail
-
Calibration
public Calibration()
Constructs a new Calibration object using the default values.
-
Calibration
public Calibration(ImagePlus imp)
-
-
Method Detail
-
scaled
public boolean scaled()
Returns 'true' if this image is spatially calibrated.
-
scaledOrOffset
public boolean scaledOrOffset()
Returns 'true' if this image is spatially calibrated or has offsets.
-
setUnit
public void setUnit(String unit)
Sets the default length unit (e.g. "mm", "inch").
-
setXUnit
public void setXUnit(String unit)
Sets the X length unit.
-
setYUnit
public void setYUnit(String unit)
Sets the Y length unit.
-
setZUnit
public void setZUnit(String unit)
Sets the Z length unit.
-
getUnit
public String getUnit()
Returns the default length unit (e.g. "micron", "inch").
-
getXUnit
public String getXUnit()
Returns the X length unit.
-
getYUnit
public String getYUnit()
Returns the Y length unit, or the default unit if 'yunit' is null.
-
getZUnit
public String getZUnit()
Returns the Z length unit, or the default unit if 'zunit' is null.
-
getUnits
public String getUnits()
Returns the plural form of the length unit (e.g. "microns", "inches").
-
getXUnits
public String getXUnits()
Returns the plural form of the X length unit (e.g. "microns", "inches"), or of the default unit if 'xunit' is null.
-
getYUnits
public String getYUnits()
Returns the plural form of the Y length unit (e.g. "microns", "inches"), or of the default unit if 'yunit' is null.
-
getZUnits
public String getZUnits()
Returns the plural form of the Z length unit (e.g. "microns", "inches"), or of the default unit if 'zunit' is null.
-
setTimeUnit
public void setTimeUnit(String unit)
Sets the time unit (e.g. "sec", "msec").
-
getTimeUnit
public String 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.
-
getRawZ
public double getRawZ(double z)
Converts a z-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
public void setFunction(int function, double[] coefficients, String unit)Sets the calibration function, coefficient table and unit (e.g. "OD").
-
setFunction
public void setFunction(int function, double[] coefficients, String unit, boolean zeroClip)
-
setImage
public void setImage(ImagePlus imp)
Disables the density calibation if the specified image has a differenent bit depth.
-
disableDensityCalibration
public void disableDensityCalibration()
-
getValueUnit
public String getValueUnit()
Returns the value unit.
-
setValueUnit
public void setValueUnit(String unit)
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
public void setCTable(float[] table, String unit)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
public Calibration copy()
Returns a clone of this object.
-
equals
public boolean equals(Calibration cal)
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
-
-