public class PositionFieldTransform extends Object implements RealTransform
RealTransform by continuous coordinate lookup.| Modifier and Type | Field and Description |
|---|---|
protected net.imglib2.RealRandomAccess<? extends net.imglib2.RealLocalizable> |
access |
protected int |
numTargetDimensions |
| Constructor and Description |
|---|
PositionFieldTransform(net.imglib2.RandomAccessibleInterval<T> positions) |
PositionFieldTransform(net.imglib2.RandomAccessibleInterval<T> positions,
AffineGet pixelToPhysical) |
PositionFieldTransform(net.imglib2.RandomAccessibleInterval<T> positions,
double... spacing) |
PositionFieldTransform(net.imglib2.RandomAccessibleInterval<T> positions,
double[] spacing,
double[] offset) |
PositionFieldTransform(net.imglib2.RealRandomAccess<? extends net.imglib2.RealLocalizable> positionAccesses) |
PositionFieldTransform(net.imglib2.RealRandomAccessible<? extends net.imglib2.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(net.imglib2.RealLocalizable source,
net.imglib2.RealPositionable target)
|
RealTransform |
copy()
Create a deep copy of this
RealTransform. |
static net.imglib2.RandomAccessibleInterval<net.imglib2.type.numeric.real.DoubleType> |
createPositionField(RealTransform transform,
net.imglib2.Interval interval,
double[] spacing)
Creates a
RandomAccessibleInterval of DoubleType
containing the positions of a PositionFieldTransform for a given
RealTransform. |
static net.imglib2.RandomAccessibleInterval<net.imglib2.type.numeric.real.DoubleType> |
createPositionField(RealTransform transform,
net.imglib2.Interval interval,
double[] spacing,
double[] offset)
Creates a
RandomAccessibleInterval of DoubleType
containing the positions of a PositionFieldTransform for a given
RealTransform. |
static <T extends net.imglib2.type.numeric.RealType<T>> |
createPositionField(RealTransform transform,
net.imglib2.Interval interval,
double[] spacing,
double[] offset,
Supplier<net.imglib2.view.composite.RealComposite<T>> supplier)
Creates a
RandomAccessibleInterval containing the positions of a
PositionFieldTransform for a given RealTransform. |
static <T extends net.imglib2.type.numeric.RealType<T>> |
createPositionField(RealTransform transform,
net.imglib2.Interval interval,
RealTransform gridTransform,
Supplier<net.imglib2.view.composite.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, waitapply, applyDimension, applyDimension, applyDimension, boundingInterval, isIdentityprotected final net.imglib2.RealRandomAccess<? extends net.imglib2.RealLocalizable> access
protected final int numTargetDimensions
public PositionFieldTransform(net.imglib2.RealRandomAccess<? extends net.imglib2.RealLocalizable> positionAccesses)
public PositionFieldTransform(net.imglib2.RealRandomAccessible<? extends net.imglib2.RealLocalizable> positions)
public PositionFieldTransform(net.imglib2.RandomAccessibleInterval<T> positions)
T - position typepositions - interleaved target coordinate, this means that the components
of the target coordinates are in the 0th dimensionpublic PositionFieldTransform(net.imglib2.RandomAccessibleInterval<T> positions, AffineGet pixelToPhysical)
T - position typepositions - 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(net.imglib2.RandomAccessibleInterval<T> positions, double... spacing)
T - position typepositions - interleaved target coordinate, this means that the components
of the target coordinates are in the 0th dimensionspacing - the pixel spacingpublic PositionFieldTransform(net.imglib2.RandomAccessibleInterval<T> positions, double[] spacing, double[] offset)
T - position typepositions - 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(net.imglib2.RealLocalizable source, net.imglib2.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 net.imglib2.RandomAccessibleInterval<net.imglib2.type.numeric.real.DoubleType> createPositionField(RealTransform transform, net.imglib2.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 net.imglib2.RandomAccessibleInterval<net.imglib2.type.numeric.real.DoubleType> createPositionField(RealTransform transform, net.imglib2.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 net.imglib2.type.numeric.RealType<T>> net.imglib2.RandomAccessibleInterval<T> createPositionField(RealTransform transform, net.imglib2.Interval interval, double[] spacing, double[] offset, Supplier<net.imglib2.view.composite.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 - output typetransform - 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 net.imglib2.type.numeric.RealType<T>> net.imglib2.RandomAccessibleInterval<T> createPositionField(RealTransform transform, net.imglib2.Interval interval, RealTransform gridTransform, Supplier<net.imglib2.view.composite.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 - output typetransform - the transform to be convertedinterval - intervalgridTransform - transformation from the discrete grid to the transform's
source coordinatessupplier - supplier for intermediate RealComposite typeCopyright © 2009–2025 ImgLib2. All rights reserved.