public class EnumeratedAxis extends AbstractCalibratedAxis
CalibratedAxis
whose coordinate values are explicitly enumerated by
a list. Out-of-bounds calibrated values are linearly extrapolated from the
two nearest known coordinates. Non-integer calibrated values are linearly
interpolated from the two nearest integer indices.Constructor and Description |
---|
EnumeratedAxis(AxisType type,
double[] values)
Creates an axis whose calibrated values are defined by the given
values array. |
EnumeratedAxis(AxisType type,
List<? extends Number> values)
Creates an axis whose calibrated values are defined by the given list of
values . |
EnumeratedAxis(AxisType type,
String unit,
double[] values)
Creates an axis whose calibrated values are defined by the given
values array. |
Modifier and Type | Method and Description |
---|---|
double |
calibratedValue(double rawValue)
Returns a calibrated value given a raw position along the axis.
|
EnumeratedAxis |
copy()
Creates an exact duplicate of this axis.
|
boolean |
equals(Object o) |
String |
generalEquation()
Gets the general equation representing values along this axis; for
instance:
y = m*x + b . |
int |
hashCode() |
String |
particularEquation()
Gets the particular equation representing values along this axis; for
instance:
y = (14)*x + (4) . |
double |
rawValue(double calibratedValue)
Returns a raw value given a calibrated position along the axis.
|
void |
setValues(double[] values)
Sets the axis's calibrated values.
|
averageScale, setUnit, unit
setType, type
public EnumeratedAxis(AxisType type, List<? extends Number> values)
values
. This is a convenience constructor which copies the list
values to a new array internally.type
- The type of axis (e.g. Axes.X
or Axes.TIME
.values
- List of calibrated values. The first element of the list is
the calibrated value at raw position 0, the second element is the
calibrated value at raw position 1, and so forth. Intermediate and
out-of-bounds calibrated values are inferred by linear
interpolation or extrapolation, respectively.public EnumeratedAxis(AxisType type, double[] values)
values
array.type
- The type of axis (e.g. Axes.X
or Axes.TIME
.values
- Array of calibrated values. The first element of the array is
the calibrated value at raw position 0, the second element is the
calibrated value at raw position 1, and so forth. Intermediate and
out-of-bounds calibrated values are inferred by linear
interpolation or extrapolation, respectively.public EnumeratedAxis(AxisType type, String unit, double[] values)
values
array.type
- The type of axis (e.g. Axes.X
or Axes.TIME
.unit
- The unit of the axis (e.g. microns or seconds).values
- Array of calibrated values. The first element of the array is
the calibrated value at raw position 0, the second element is the
calibrated value at raw position 1, and so forth. Intermediate and
out-of-bounds calibrated values are inferred by linear
interpolation or extrapolation, respectively.public void setValues(double[] values)
values
- Array of calibrated values. The first element of the array is
the calibrated value at raw position 0, the second element is the
calibrated value at raw position 1, and so forth. Intermediate and
out-of-bounds calibrated values are inferred by linear
interpolation or extrapolation, respectively.public int hashCode()
hashCode
in class AbstractCalibratedAxis
public boolean equals(Object o)
equals
in class AbstractCalibratedAxis
public double calibratedValue(double rawValue)
CalibratedAxis
public double rawValue(double calibratedValue)
CalibratedAxis
public String generalEquation()
CalibratedAxis
y = m*x + b
.public String particularEquation()
CalibratedAxis
y = (14)*x + (4)
.public EnumeratedAxis copy()
CalibratedAxis
Copyright © 2014–2022 ImageJ. All rights reserved.