public class DisplacementFieldTransform extends PositionFieldTransform
RealTransform by continuous offset lookup.| Modifier and Type | Field and Description |
|---|---|
protected int |
numTargetDimensions |
access| Constructor and Description |
|---|
DisplacementFieldTransform(RandomAccessibleInterval<T> displacements) |
DisplacementFieldTransform(RandomAccessibleInterval<T> displacements,
AffineGet pixelToPhysical) |
DisplacementFieldTransform(RandomAccessibleInterval<T> displacements,
double... spacing) |
DisplacementFieldTransform(RandomAccessibleInterval<T> displacements,
double[] spacing,
double[] offset) |
DisplacementFieldTransform(RealRandomAccess<? extends RealLocalizable> displacementsAccess) |
DisplacementFieldTransform(RealRandomAccessible<? extends RealLocalizable> displacements) |
| 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> |
createDisplacementField(RealTransform transform,
Interval interval,
double[] spacing)
Creates a
RandomAccessibleInterval of DoubleType
containing the displacements of a DisplacementFieldTransform for
a given RealTransform. |
static RandomAccessibleInterval<DoubleType> |
createDisplacementField(RealTransform transform,
Interval interval,
double[] spacing,
double[] offset)
Creates a
RandomAccessibleInterval of DoubleType
containing the displacements of a DisplacementFieldTransform for
a given RealTransform. |
static <T extends RealType<T>> |
createDisplacementField(RealTransform transform,
Interval interval,
double[] spacing,
double[] offset,
Supplier<RealComposite<T>> supplier)
Creates a
RandomAccessibleInterval containing the displacements
of a DisplacementFieldTransform for a given
RealTransform. |
static <T extends RealType<T>> |
createDisplacementField(RealTransform transform,
Interval interval,
RealTransform gridTransform,
Supplier<RealComposite<T>> supplier)
Creates a
RandomAccessibleInterval containing the displacements
of a DisplacementFieldTransform for a given
RealTransform. |
int |
numTargetDimensions()
Returns m, the minimal dimension of the target vector.
|
createPositionField, createPositionField, createPositionField, createPositionField, numSourceDimensionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisIdentitypublic DisplacementFieldTransform(RealRandomAccess<? extends RealLocalizable> displacementsAccess)
public DisplacementFieldTransform(RealRandomAccessible<? extends RealLocalizable> displacements)
public DisplacementFieldTransform(RandomAccessibleInterval<T> displacements)
T - type of the displacementsdisplacements - interleaved displacement vectors, this means that the
components of the displacement vectors are in the 0th
dimensionpublic DisplacementFieldTransform(RandomAccessibleInterval<T> displacements, AffineGet pixelToPhysical)
T - type of the displacementsdisplacements - interleaved displacement vectors, this means that the
components of the displacement vectors are in the 0th
dimensionpixelToPhysical - a transformation from pixel coordinates to physical
coordinatespublic DisplacementFieldTransform(RandomAccessibleInterval<T> displacements, double... spacing)
T - type of the displacementsdisplacements - interleaved displacement vectors, this means that the
components of the displacement vectors are in the 0th
dimensionspacing - the pixel spacingpublic DisplacementFieldTransform(RandomAccessibleInterval<T> displacements, double[] spacing, double[] offset)
T - type of the displacementsdisplacements - interleaved displacement vectors, this means that the
components of the displacement vectors are in the 0th
dimensionspacing - the pixel spacingoffset - the pixel offsetpublic int numTargetDimensions()
RealTransformnumTargetDimensions in interface RealTransformnumTargetDimensions in class PositionFieldTransformpublic void apply(double[] source,
double[] target)
RealTransformRealTransform to a source vector to obtain a target
vector.apply in interface RealTransformapply in class PositionFieldTransformsource - 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 RealTransformapply in class PositionFieldTransformsource - 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 RealTransformapply in class PositionFieldTransformsource - 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 RealTransformcopy in class PositionFieldTransformpublic static RandomAccessibleInterval<DoubleType> createDisplacementField(RealTransform transform, Interval interval, double[] spacing)
RandomAccessibleInterval of DoubleType
containing the displacements of a DisplacementFieldTransform 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 DisplacementFieldTransform.
Components of the displacements 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 displacement 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> createDisplacementField(RealTransform transform, Interval interval, double[] spacing, double[] offset)
RandomAccessibleInterval of DoubleType
containing the displacements of a DisplacementFieldTransform 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 DisplacementFieldTransform.
Components of the displacements 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 displacement 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> createDisplacementField(RealTransform transform, Interval interval, double[] spacing, double[] offset, Supplier<RealComposite<T>> supplier)
RandomAccessibleInterval containing the displacements
of a DisplacementFieldTransform 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
DisplacementFieldTransform.
Components of the displacements 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 displacement 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> createDisplacementField(RealTransform transform, Interval interval, RealTransform gridTransform, Supplier<RealComposite<T>> supplier)
RandomAccessibleInterval containing the displacements
of a DisplacementFieldTransform 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
DisplacementFieldTransform.
Components of the displacements 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 displacement 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–2024 ImgLib2. All rights reserved.