Package net.imglib2.transform.integer
Class AbstractMixedTransform
java.lang.Object
net.imglib2.transform.integer.AbstractMixedTransform
- All Implemented Interfaces:
BoundingBoxTransform
,Mixed
,Transform
- Direct Known Subclasses:
ComponentMappingTransform
,MixedTransform
,SlicingTransform
,TranslationTransform
,TranslationTransform.InverseTranslationTransform
TODO
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int
dimension of target vector. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
getComponentInversion
(boolean[] invert) Get an array indicating for each target component, whether the source component it is taken from should be inverted.boolean
getComponentInversion
(int d) Get the d-th component of inversion vector (seeMixed.getComponentInversion(boolean[])
).int
getComponentMapping
(int d) Get the source dimension which is mapped to the d-th target dimension (seeMixed.getComponentMapping(int[])
).void
getComponentMapping
(int[] component) Get an array indicating for each target dimensions from which source dimension it is taken.void
getComponentZero
(boolean[] zero) Get a boolean array indicating which target dimensions are _not_ taken from source dimensions.boolean
getComponentZero
(int d) Get the d-th component of zeroing vector (seeMixed.getComponentZero(boolean[])
).long
getTranslation
(int d) Get the d-th component of translation (seeMixed.getTranslation(long[])
).void
getTranslation
(long[] translation) Get the translation.int
Returns n, the dimension of the source vector.int
Returns m, the dimension of the target vector.transform
(BoundingBox boundingBox) Return a transformed bounding box.
-
Field Details
-
numTargetDimensions
protected final int numTargetDimensionsdimension of target vector.
-
-
Constructor Details
-
AbstractMixedTransform
protected AbstractMixedTransform(int numTargetDimensions)
-
-
Method Details
-
numSourceDimensions
public int numSourceDimensions()Description copied from interface:Transform
Returns n, the dimension of the source vector.- Specified by:
numSourceDimensions
in interfaceTransform
- Returns:
- the dimension of the source vector.
-
numTargetDimensions
public int numTargetDimensions()Description copied from interface:Transform
Returns m, the dimension of the target vector.- Specified by:
numTargetDimensions
in interfaceTransform
- Returns:
- the dimension of the target vector.
-
getTranslation
public void getTranslation(long[] translation) Description copied from interface:Mixed
Get the translation. Translation is added to the target vector after applying permutation, projection, inversion operations.- Specified by:
getTranslation
in interfaceMixed
- Parameters:
translation
- array of size at least the target dimension to store the result.
-
getTranslation
public long getTranslation(int d) Description copied from interface:Mixed
Get the d-th component of translation (seeMixed.getTranslation(long[])
).- Specified by:
getTranslation
in interfaceMixed
- Parameters:
d
-
-
getComponentZero
public void getComponentZero(boolean[] zero) Description copied from interface:Mixed
Get a boolean array indicating which target dimensions are _not_ taken from source dimensions.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 [false, false, true]
- Specified by:
getComponentZero
in interfaceMixed
- Parameters:
zero
- array of size at least the target dimension to store the result.
-
getComponentZero
public boolean getComponentZero(int d) Description copied from interface:Mixed
Get the d-th component of zeroing vector (seeMixed.getComponentZero(boolean[])
).- Specified by:
getComponentZero
in interfaceMixed
- Parameters:
d
-
-
getComponentMapping
public void getComponentMapping(int[] component) Description copied from interface:Mixed
Get an array indicating for each target dimensions from which source dimension it is taken.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[])
.- Specified by:
getComponentMapping
in interfaceMixed
- Parameters:
component
- array of size at least the target dimension to store the result.
-
getComponentMapping
public int getComponentMapping(int d) Description copied from interface:Mixed
Get the source dimension which is mapped to the d-th target dimension (seeMixed.getComponentMapping(int[])
).- Specified by:
getComponentMapping
in interfaceMixed
- Parameters:
d
-
-
getComponentInversion
public void getComponentInversion(boolean[] invert) Description copied from interface:Mixed
Get an array indicating for each target component, whether the source component it is taken from should be inverted.For instance, if rotating a 2D (x,y) coordinates by 180 degrees will map it to (-x,-y). In this case, the result will be [true, true].
- Specified by:
getComponentInversion
in interfaceMixed
- Parameters:
invert
- array of size at least the target dimension to store the result.
-
getComponentInversion
public boolean getComponentInversion(int d) Description copied from interface:Mixed
Get the d-th component of inversion vector (seeMixed.getComponentInversion(boolean[])
).- Specified by:
getComponentInversion
in interfaceMixed
- Parameters:
d
-
-
transform
Description copied from interface:BoundingBoxTransform
Return a transformed bounding box. The transformation can be carried out in-place.- Specified by:
transform
in interfaceBoundingBoxTransform
- Parameters:
boundingBox
-- Returns:
- the transformed bounding box
-