public class PositionFieldTransform extends Object implements RealTransform
RealTransform by continuous coordinate lookup.| Modifier and Type | Field and Description |
|---|---|
protected RealRandomAccess<? extends RealLocalizable> |
access |
protected int |
numTargetDimensions |
| Constructor and Description |
|---|
PositionFieldTransform(RandomAccessibleInterval<T> positions) |
PositionFieldTransform(RandomAccessibleInterval<T> positions,
AffineGet pixelToPhysical) |
PositionFieldTransform(RandomAccessibleInterval<T> positions,
double... spacing) |
PositionFieldTransform(RandomAccessibleInterval<T> positions,
double[] spacing,
double[] offset) |
PositionFieldTransform(RealRandomAccess<? extends RealLocalizable> positionAccesses) |
PositionFieldTransform(RealRandomAccessible<? extends RealLocalizable> positions) |
| 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 RandomAccessibleInterval<DoubleType> |
createPositionField(RealTransform transform,
Interval interval,
double[] spacing)
Creates a
RandomAccessibleInterval of DoubleType
containing the positions of a PositionFieldTransform for a given
RealTransform. |
static RandomAccessibleInterval<DoubleType> |
createPositionField(RealTransform transform,
Interval interval,
double[] spacing,
double[] offset)
Creates a
RandomAccessibleInterval of DoubleType
containing the positions of a PositionFieldTransform for a given
RealTransform. |
static <T extends RealType<T>> |
createPositionField(RealTransform transform,
Interval interval,
double[] spacing,
double[] offset,
Supplier<RealComposite<T>> supplier)
Creates a
RandomAccessibleInterval containing the positions of a
PositionFieldTransform for a given RealTransform. |
static <T extends RealType<T>> |
createPositionField(RealTransform transform,
Interval interval,
RealTransform gridTransform,
Supplier<RealComposite<T>> supplier)
Creates a
RandomAccessibleInterval containing the positions of a
PositionFieldTransform for a given RealTransform. |
int |
numSourceDimensions()
Returns n, the minimal number of dimension of the source vector.
|
int |
numTargetDimensions()
Returns m, the minimal dimension of the target vector.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisIdentityprotected final RealRandomAccess<? extends RealLocalizable> access
protected final int numTargetDimensions
public PositionFieldTransform(RealRandomAccess<? extends RealLocalizable> positionAccesses)
public PositionFieldTransform(RealRandomAccessible<? extends RealLocalizable> positions)
public PositionFieldTransform(RandomAccessibleInterval<T> positions)
T - type of the positionspositions - interleaved target coordinate, this means that the components
of the target coordinates are in the 0th dimensionpublic PositionFieldTransform(RandomAccessibleInterval<T> positions, AffineGet pixelToPhysical)
T - positions - interleaved target coordinate, this means that the components
of the target coordinates are in the 0th dimensionpixelToPhysical - a transformation from pixel coordinates to physical
coordinatespublic PositionFieldTransform(RandomAccessibleInterval<T> positions, double... spacing)
T - type of the positionspositions - interleaved target coordinate, this means that the components
of the target coordinates are in the 0th dimensionspacing - the pixel spacingpublic PositionFieldTransform(RandomAccessibleInterval<T> positions, double[] spacing, double[] offset)
T - type of the positionspositions - interleaved target coordinate, this means that the components
of the target coordinates are in the 0th dimensionspacing - the pixel spacingoffset - the pixel offsetpublic 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 RealTransformpublic static RandomAccessibleInterval<DoubleType> createPositionField(RealTransform transform, Interval interval, double[] spacing)
RandomAccessibleInterval of DoubleType
containing the positions of a PositionFieldTransform for a given
RealTransform. This can be useful for saving a transformation as
a displacement field, but generally should be not used to create a
PositionFieldTransform.
Components of the positions are in the 0th dimension, the extents of the
field are given by the given Interval. The output interval will
therefore be of size:
[ transform.numTargetDimensions(), interval.dimension(0), ...,
interval.dimension( N-1 )]
The spacing parameter specifies how the discrete coordinates of the output position field map to the input source coordinates of the transform.
transform - the transform to be convertedinterval - intervalspacing - the spacing of the gridpublic static RandomAccessibleInterval<DoubleType> createPositionField(RealTransform transform, Interval interval, double[] spacing, double[] offset)
RandomAccessibleInterval of DoubleType
containing the positions of a PositionFieldTransform for a given
RealTransform. This can be useful for saving a transformation as
a displacement field, but generally should be not used to create a
PositionFieldTransform.
Components of the positions are in the 0th dimension, the extents of the
field are given by the given Interval. The output interval will
therefore be of size:
[ transform.numTargetDimensions(), interval.dimension(0), ...,
interval.dimension( N-1 )]
The spacing and offset parameters specify how the discrete coordinates of the output position field map to the input source coordinates of the transform.
transform - the transform to be convertedinterval - intervalspacing - the spacing of the gridoffset - the offset of the output in physical unitspublic static <T extends RealType<T>> RandomAccessibleInterval<T> createPositionField(RealTransform transform, Interval interval, double[] spacing, double[] offset, Supplier<RealComposite<T>> supplier)
RandomAccessibleInterval containing the positions of a
PositionFieldTransform for a given RealTransform. This
can be useful for saving a transformation as a displacement field, but
generally should be not used to create a PositionFieldTransform.
Components of the positions are in the 0th dimension, the extents of the
field are given by the given Interval. The output interval will
therefore be of size:
[ transform.numTargetDimensions(), interval.dimension(0), ...,
interval.dimension( N-1 )]
The spacing and offset parameters specify how the discrete coordinates of the output position field map to the input source coordinates of the transform.
The given supplier determines the output type and must provide
RealComposites of size greater than or equal to the transforms
target dimension. For example,
() -> DoubleType.createVector(transform.numTargetDimensions())
T - the type of the outputtransform - the transform to be convertedinterval - intervalspacing - the spacing of the gridoffset - the offset of the output in physical unitssupplier - supplier for intermediate RealComposite typepublic static <T extends RealType<T>> RandomAccessibleInterval<T> createPositionField(RealTransform transform, Interval interval, RealTransform gridTransform, Supplier<RealComposite<T>> supplier)
RandomAccessibleInterval containing the positions of a
PositionFieldTransform for a given RealTransform. This
can be useful for saving a transformation as a displacement field, but
generally should be not used to create a PositionFieldTransform.
Components of the positions are in the 0th dimension, the extents of the
field are given by the given Interval. The output interval will
therefore be of size:
[ transform.numTargetDimensions(), interval.dimension(0), ...,
interval.dimension( N-1 )]
The RealTransform specifies how the discrete coordinates of the
output position field map to the input source coordinates of the
transform, i.e. it enables setting the spacing and offset of the
displacement field grid.
The given supplier determines the output type and must provide
RealComposites of size greater than or equal to the transforms
target dimension. For example,
() -> DoubleType.createVector(transform.numTargetDimensions())
T - the type of the outputtransform - the transform to be convertedinterval - intervalgridTransform - transformation from the discrete grid to the transform's
source coordinatessupplier - supplier for intermediate RealComposite typeCopyright © 2009–2022 ImgLib2. All rights reserved.