public class ComponentMappingTransform extends AbstractMixedTransform implements ComponentMapping, Concatenable<ComponentMapping>, PreConcatenable<ComponentMapping>
The intended use of ComponentMapping is as a dimension permutation. The mapping is implemented as a inverse lookup, i.e., every component of the target is read from a source component. Note, that it is not allowed to set this array such that a source component is mapped to several target components!
Modifier and Type | Field and Description |
---|---|
protected int[] |
component
for each component of the target vector: from which source vector
component should it be taken.
|
numTargetDimensions
Constructor and Description |
---|
ComponentMappingTransform(int targetDim) |
ComponentMappingTransform(int[] component) |
Modifier and Type | Method and Description |
---|---|
void |
apply(int[] source,
int[] target)
Apply the
Transform to a source vector to obtain a target vector. |
void |
apply(Localizable source,
Positionable target)
|
void |
apply(long[] source,
long[] target)
Apply the
Transform to a source vector to obtain a target vector. |
ComponentMappingTransform |
concatenate(ComponentMapping t)
Concatenate this object with a.
|
int |
getComponentMapping(int d)
Get the source dimension which is mapped to the d-th target dimension
(see
Mixed.getComponentMapping(int[]) ). |
void |
getComponentMapping(int[] component)
Get an array indicating for each target dimensions from which source
dimension it is taken.
|
Class<ComponentMapping> |
getConcatenableClass() |
double[][] |
getMatrix()
Get the matrix that transforms homogeneous source points to homogeneous
target points.
|
Class<ComponentMapping> |
getPreConcatenableClass() |
ComponentMappingTransform |
preConcatenate(ComponentMapping t)
Pre-concatenate this object with a.
|
void |
setComponentMapping(int[] component)
Set for each target dimensions from which source dimension it is taken.
|
getComponentInversion, getComponentInversion, getComponentZero, getComponentZero, getTranslation, getTranslation, numSourceDimensions, numTargetDimensions, transform
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getComponentInversion, getComponentInversion, getComponentZero, getComponentZero, getTranslation, getTranslation
numSourceDimensions, numTargetDimensions
transform
protected final int[] component
public ComponentMappingTransform(int targetDim)
public ComponentMappingTransform(int[] component)
component
- array specifying for each component of the target vector from
which source vector component should it be taken.public void getComponentMapping(int[] component)
Mixed
For instance, if the transform maps 2D (x,y) coordinates to the first two
components of a 3D (x,y,z) coordinate, the result will be [0, 1, x].
Here, the value of x is undefined because the third target dimension does
not correspond to any source dimension. See Mixed.getComponentZero(boolean[])
.
getComponentMapping
in interface Mixed
getComponentMapping
in class AbstractMixedTransform
component
- array of size at least the target dimension to store the
result.public int getComponentMapping(int d)
Mixed
Mixed.getComponentMapping(int[])
).getComponentMapping
in interface Mixed
getComponentMapping
in class AbstractMixedTransform
public void setComponentMapping(int[] component)
For instance, if the transform maps 3D (x,y,z) coordinates to 2D (z,x,y) coordinate this will be [2, 0, 1].
component
- array that says for each component of the target vector from
which source vector component it should be taken.public double[][] getMatrix()
Mixed
public void apply(long[] source, long[] target)
Transform
Transform
to a source vector to obtain a target vector.public void apply(int[] source, int[] target)
Transform
Transform
to a source vector to obtain a target vector.public void apply(Localizable source, Positionable target)
Transform
public ComponentMappingTransform concatenate(ComponentMapping t)
Concatenable
concatenate
in interface Concatenable<ComponentMapping>
public Class<ComponentMapping> getConcatenableClass()
getConcatenableClass
in interface Concatenable<ComponentMapping>
public ComponentMappingTransform preConcatenate(ComponentMapping t)
PreConcatenable
preConcatenate
in interface PreConcatenable<ComponentMapping>
public Class<ComponentMapping> getPreConcatenableClass()
getPreConcatenableClass
in interface PreConcatenable<ComponentMapping>
Copyright © 2015–2022 ImgLib2. All rights reserved.