public class ScaleAndTranslation extends Object implements ScaleAndTranslationGet, Concatenable<ScaleAndTranslationGet>, PreConcatenable<ScaleAndTranslationGet>
AffineTransform
with
entries on the diagonal only.Constructor and Description |
---|
ScaleAndTranslation(double[] scales,
double[] translations) |
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)
|
void |
applyInverse(double[] source,
double[] target)
Apply the inverse transform to a target vector to obtain a source vector.
|
void |
applyInverse(float[] source,
float[] target)
Apply the inverse transform to a target vector to obtain a source vector.
|
void |
applyInverse(RealPositionable source,
RealLocalizable target)
Apply the inverse transform to a target
RealLocalizable to obtain
a source RealPositionable . |
ScaleAndTranslation |
concatenate(ScaleAndTranslationGet a)
Concatenate this object with a.
|
ScaleAndTranslation |
copy()
Create a deep copy of this
RealTransform . |
ScaleAndTranslation |
createInverse() |
RealPoint |
d(int d)
Get the constant partial differential vector for dimension d.
|
double |
get(int row,
int column)
Get a field of the n×(n+1) affine transformation
matrix.
|
Class<ScaleAndTranslationGet> |
getConcatenableClass() |
Class<ScaleAndTranslationGet> |
getPreConcatenableClass() |
double[] |
getRowPackedCopy()
Get a copy of the n×(n+1) affine transformation
matrix as a row packed array similar to Jama.
|
double |
getScale(int d)
Get a field of the n-dimensional scale vector.
|
double[] |
getScaleCopy()
Get a copy of the n-dimensional scale vector.
|
double |
getTranslation(int d)
Get a field of the n-dimensionsional translation vector.
|
double[] |
getTranslationCopy()
Get a copy of the n-dimensionsional translation vector.
|
ScaleAndTranslation |
inverse()
Get the inverse transform.
|
boolean |
isIdentity()
Check if the
RealTransform is identity. |
int |
numDimensions()
Gets the space's number of dimensions.
|
int |
numSourceDimensions()
Returns n, the minimal number of dimension of the source vector.
|
int |
numTargetDimensions()
Returns m, the minimal dimension of the target vector.
|
ScaleAndTranslation |
preConcatenate(ScaleAndTranslationGet a)
Pre-concatenate this object with a.
|
public ScaleAndTranslation(double[] scales, double[] translations)
scales
- Array containing scalestranslations
- Array containing translationspublic int numSourceDimensions()
RealTransform
numSourceDimensions
in interface RealTransform
public int numTargetDimensions()
RealTransform
numTargetDimensions
in interface RealTransform
public void apply(double[] source, double[] target)
RealTransform
RealTransform
to a source vector to obtain a target
vector.apply
in interface RealTransform
source
- 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)
RealTransform
RealTransform
to a source vector to obtain a target
vector.apply
in interface RealTransform
source
- 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)
RealTransform
apply
in interface RealTransform
source
- source coordinates, numDimensions()
must be >=
RealTransform.numSourceDimensions()
target
- set this to the target coordinates,
numDimensions()
must
be >=
RealTransform.numTargetDimensions()
public void applyInverse(double[] source, double[] target)
InvertibleRealTransform
applyInverse
in interface InvertibleRealTransform
source
- set this to the source coordinates.target
- target coordinates.public void applyInverse(float[] source, float[] target)
InvertibleRealTransform
applyInverse
in interface InvertibleRealTransform
source
- set this to the source coordinates.target
- target coordinates.public void applyInverse(RealPositionable source, RealLocalizable target)
InvertibleRealTransform
RealLocalizable
to obtain
a source RealPositionable
.applyInverse
in interface InvertibleRealTransform
source
- set this to the source coordinates.target
- target coordinates.public ScaleAndTranslation inverse()
InvertibleRealTransform
inverse
in interface AffineGet
inverse
in interface InvertibleRealTransform
inverse
in interface ScaleAndTranslationGet
public ScaleAndTranslation createInverse()
public ScaleAndTranslation copy()
RealTransform
RealTransform
.
Deep copying is required to make sure that stateful RealTransforms
can be duplicated for concurrent code.
copy
in interface AffineGet
copy
in interface InvertibleRealTransform
copy
in interface RealTransform
copy
in interface ScaleAndTranslationGet
public double getScale(int d)
ScaleAndTranslationGet
getScale
in interface ScaleAndTranslationGet
d
- the dimensionpublic double[] getScaleCopy()
ScaleAndTranslationGet
getScaleCopy
in interface ScaleAndTranslationGet
public double get(int row, int column)
AffineGet
public double[] getRowPackedCopy()
AffineGet
getRowPackedCopy
in interface AffineGet
public RealPoint d(int d)
AffineGet
public int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
public double getTranslation(int d)
ScaleAndTranslationGet
getTranslation
in interface ScaleAndTranslationGet
d
- the dimensionpublic double[] getTranslationCopy()
ScaleAndTranslationGet
getTranslationCopy
in interface ScaleAndTranslationGet
public ScaleAndTranslation preConcatenate(ScaleAndTranslationGet a)
PreConcatenable
preConcatenate
in interface PreConcatenable<ScaleAndTranslationGet>
public Class<ScaleAndTranslationGet> getPreConcatenableClass()
getPreConcatenableClass
in interface PreConcatenable<ScaleAndTranslationGet>
public ScaleAndTranslation concatenate(ScaleAndTranslationGet a)
Concatenable
concatenate
in interface Concatenable<ScaleAndTranslationGet>
public Class<ScaleAndTranslationGet> getConcatenableClass()
getConcatenableClass
in interface Concatenable<ScaleAndTranslationGet>
public boolean isIdentity()
RealTransform
RealTransform
is identity.isIdentity
in interface RealTransform
Copyright © 2015–2022 ImgLib2. All rights reserved.