public class PolynomialTransform2D extends Object implements RealTransform
| Modifier and Type | Field and Description |
|---|---|
protected double[] |
a
holds two coefficients for each polynomial coefficient, including 1
initialized at 0 order, i.e.
|
protected int |
order
order of the polynomial transform
|
protected double[] |
polTerms
register to hold all polynomial terms during applyInPlace following the
order specified at
http://bishopw.loni.ucla.edu/AIR5/2Dnonlinear.html#polylist
excluding 1 because we want to avoid repeated multiplication with 1
|
| Constructor and Description |
|---|
PolynomialTransform2D() |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(double[] source,
double[] target)
Apply the
RealTransform to a source vector to obtain a target
vector. |
void |
apply(float[] source,
float[] target)
Apply the
RealTransform to a source vector to obtain a target
vector. |
void |
apply(RealLocalizable source,
RealPositionable target)
|
RealTransform |
copy()
Create a deep copy of this
RealTransform. |
static int |
numPolTerms(int order)
Calculate the number of polynomial terms for a 2d polynomial transform
of given order.
|
int |
numSourceDimensions()
Returns n, the minimal number of dimension of the source vector.
|
int |
numTargetDimensions()
Returns m, the minimal dimension of the target vector.
|
static int |
orderOf(int numPolTerms)
Calculate the maximum order of a polynom whose number of polyynomial
terms is smaller or equal a given number.
|
protected void |
populateTerms(double x,
double y) |
protected void |
printTerms() |
void |
set(double... a)
Set the coefficients.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisIdentityprotected int order
protected double[] a
protected double[] polTerms
public static final int orderOf(int numPolTerms)
numPolTerms - the number of termspublic static final int numPolTerms(int order)
order - of the polynomialpublic void set(double... a)
PolynomialTransform2D which is set to the
highest order that is fully specified by the provided coefficients.
The coefficients are interpreted in the order specified at
http://bishopw.loni.ucla.edu/AIR5/2Dnonlinear.html#polylist
, first for x', then for y'. It is thus not possible to omit higher
order coefficients assuming that they would become 0. The passed vararg
array is used directly without copy which enables direct access to the
coefficients from calling code. Use this option wisely.a - coefficientsprotected void populateTerms(double x,
double y)
protected void printTerms()
public int numSourceDimensions()
RealTransformnumSourceDimensions in interface RealTransformpublic int numTargetDimensions()
RealTransformnumTargetDimensions in interface RealTransformpublic void apply(double[] source,
double[] target)
RealTransformRealTransform to a source vector to obtain a target
vector.apply in interface RealTransformsource - source coordinates, length must be >=
RealTransform.numSourceDimensions()target - set this to the target coordinates, length must be >=
RealTransform.numTargetDimensions()public void apply(float[] source,
float[] target)
RealTransformRealTransform to a source vector to obtain a target
vector.apply in interface RealTransformsource - source coordinates, length must be >=
RealTransform.numSourceDimensions()target - set this to the target coordinates, length must be >=
RealTransform.numTargetDimensions()public void apply(RealLocalizable source, RealPositionable target)
RealTransformapply in interface RealTransformsource - source coordinates, numDimensions() must be >=
RealTransform.numSourceDimensions()target - set this to the target coordinates,
numDimensions() must
be >= RealTransform.numTargetDimensions()public RealTransform copy()
RealTransformRealTransform.
Deep copying is required to make sure that stateful RealTransforms can be duplicated for concurrent code.
copy in interface RealTransformCopyright © 2015–2022 ImgLib2. All rights reserved.