ui.recognizer
Class Calibration

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by ui.recognizer.Calibration
All Implemented Interfaces:
Shape, Serializable, Cloneable
Direct Known Subclasses:
PlotCalibration

public class Calibration
extends Rectangle

A class containing calibration information necessary for the correct mapping from image coordinates to data coordinates.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float
 
Field Summary
static double DEFAULT_MAXX
           
static double DEFAULT_MAXY
           
static double DEFAULT_MINX
           
static double DEFAULT_MINY
           
static double DEFAULT_UNITX
           
static double DEFAULT_UNITY
           
protected  double maxX
           
protected  double maxY
           
protected  double minX
           
protected  double minY
           
protected  double unitX
           
protected  double unitY
           
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
Calibration()
           
Calibration(Rectangle aBorder)
           
Calibration(Rectangle aBorder, double aMinX, double aMinY, double aMaxX, double aMaxY)
           
Calibration(Rectangle aBorder, double aMinX, double aMinY, double aMaxX, double aMaxY, double aUnitX, double aUnitY)
           
 
Method Summary
 double getMaxX()
          Get the maximum x value of the calibration zone.
 double getMaxY()
          Get the maximum y value of the calibration zone.
 double getMinX()
          Get the minimum x value of the calibration zone.
 double getMinY()
          Get the minimum y value of the calibration zone.
 double getUnitX()
          Get the unit of the X-axis.
 double getUnitY()
          Get the unit of the Y-axis.
 ImageCoordinate map(DataCoordinate aDataCoordinate)
          Convert data coordinate into an image coordinate.
 DataCoordinate map(ImageCoordinate anImageCoordinate)
          Convert an image coordinate into a data coordinate.
 ImageCoordinate mapInDataUnits(DataCoordinate aDataCoordinate)
          Convert data coordinate into an image coordinate in the native unit of the data.
 void setMaxX(double aMaxX)
          Set the maximum x value of the calibration zone.
 void setMaxY(double aMaxY)
          Set the maximum y value of the calibration zone.
 void setMinX(double aMinX)
          Set the minimum x value of the calibration zone.
 void setMinY(double aMinY)
          Set the minimum y value of the calibration zone.
 void setUnitX(double aUnitX)
           
 void setUnitY(double aUnitY)
           
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Field Detail

DEFAULT_MINX

public static final double DEFAULT_MINX
See Also:
Constant Field Values

DEFAULT_MINY

public static final double DEFAULT_MINY
See Also:
Constant Field Values

DEFAULT_MAXX

public static final double DEFAULT_MAXX
See Also:
Constant Field Values

DEFAULT_MAXY

public static final double DEFAULT_MAXY
See Also:
Constant Field Values

DEFAULT_UNITX

public static final double DEFAULT_UNITX
See Also:
Constant Field Values

DEFAULT_UNITY

public static final double DEFAULT_UNITY
See Also:
Constant Field Values

minX

protected double minX

minY

protected double minY

maxX

protected double maxX

maxY

protected double maxY

unitX

protected double unitX

unitY

protected double unitY
Constructor Detail

Calibration

public Calibration()

Calibration

public Calibration(Rectangle aBorder)

Calibration

public Calibration(Rectangle aBorder,
                   double aMinX,
                   double aMinY,
                   double aMaxX,
                   double aMaxY)

Calibration

public Calibration(Rectangle aBorder,
                   double aMinX,
                   double aMinY,
                   double aMaxX,
                   double aMaxY,
                   double aUnitX,
                   double aUnitY)
Method Detail

map

public DataCoordinate map(ImageCoordinate anImageCoordinate)
Convert an image coordinate into a data coordinate.

Parameters:
anImageCoordinate - a coordinate in image format
Returns:
a data coordinate mapped from the image coordinate

mapInDataUnits

public ImageCoordinate mapInDataUnits(DataCoordinate aDataCoordinate)
Convert data coordinate into an image coordinate in the native unit of the data.

Parameters:
aDataCoordinate - a coordinate in data format
Returns:
a coordinate in image format mapped from the data coordinate

map

public ImageCoordinate map(DataCoordinate aDataCoordinate)
Convert data coordinate into an image coordinate.

Parameters:
aDataCoordinate - a coordinate in data format
Returns:
a coordinate in image format mapped from the data coordinate

getUnitX

public double getUnitX()
Get the unit of the X-axis. Multiply getX() by this number to obtain the scaled x unit.


setUnitX

public void setUnitX(double aUnitX)

getUnitY

public double getUnitY()
Get the unit of the Y-axis. Multiply getY() by this number to obtain the scaled y unit.


setUnitY

public void setUnitY(double aUnitY)

getMinX

public double getMinX()
Get the minimum x value of the calibration zone.

Overrides:
getMinX in class RectangularShape
Returns:
the minimum x value in calibration zone in double precision
See Also:
setMinX(double)

setMinX

public void setMinX(double aMinX)
Set the minimum x value of the calibration zone.

Parameters:
aMinX - the minimum x value in the calibration zone in double precision
See Also:
getMinX()

getMinY

public double getMinY()
Get the minimum y value of the calibration zone.

Overrides:
getMinY in class RectangularShape
Returns:
the minimum intensity in the calibration zone in double precision

setMinY

public void setMinY(double aMinY)
Set the minimum y value of the calibration zone.

Parameters:
aMinY - the minimum intensity in the calibration zone in double precision

getMaxX

public double getMaxX()
Get the maximum x value of the calibration zone.

Overrides:
getMaxX in class RectangularShape
Returns:
the maximum x value in the calibration zone in double precision
See Also:
setMaxX(double)

setMaxX

public void setMaxX(double aMaxX)
Set the maximum x value of the calibration zone.

Parameters:
aMaxX - the maximum wavelength in the calibration zone in double precision

getMaxY

public double getMaxY()
Get the maximum y value of the calibration zone.

Overrides:
getMaxY in class RectangularShape
Returns:
the maximum intensity in the calibration zone in double precision

setMaxY

public void setMaxY(double aMaxY)
Set the maximum y value of the calibration zone.

Parameters:
aMaxY - the maximum intensity in the calibration zone in double precision