T - displacement component type. should be DoubleType or FloatTypepublic class DisplacementField<T extends net.imglib2.type.NativeType<T> & net.imglib2.type.numeric.RealType<T>> extends Object implements net.imglib2.EuclideanSpace, net.imglib2.Typed<T>
A "normalized" field expresses displacements in units relative to the displacement grid's own pixel spacing. Consequently, downsampling the grid by a factor of N requires scaling the displacement vectors by 1/N to maintain normalization.
| Constructor and Description |
|---|
DisplacementField(BlockSupplier<T> displacements,
double[] scale,
double[] translation)
Constructs a displacement field with the specified normalized displacements, scale, and translation.
|
| Modifier and Type | Method and Description |
|---|---|
BlockSupplier<T> |
displacements()
Displacement vector field.
|
T |
getType() |
int |
numDimensions() |
double[] |
scale()
The
displacement field coordinates and
displacement vectors should be scaled by this factor when looking up
intensities in a source image. |
double[] |
translation()
When interpolating
displacements() into a position field for
value look-up in the source image, this translation vector is added. |
public DisplacementField(BlockSupplier<T> displacements, double[] scale, double[] translation)
A "normalized" field expresses displacements in units relative to the displacement grid's own pixel spacing. Consequently, downsampling the grid by a factor of N requires scaling the displacement vectors by 1/N to maintain normalization.
displacements - provides displacement vectors, with components of the
displacement vector in dimension 0. (shifting all other
dimensions by 1. That is, the BlockSupplier has numDimensions() + 1 dimensions.)scale - displacement field coordinates and
displacement vectors should be scaled by this factor when looking up
intensities in a source image.translation - when interpolating displacements() into a position field for
value look-up in the source image, this translation should be added.
(This happens after scaling, so the translation is in units of source
image pixels).public int numDimensions()
numDimensions in interface net.imglib2.EuclideanSpacepublic T getType()
getType in interface net.imglib2.Typed<T extends net.imglib2.type.NativeType<T> & net.imglib2.type.numeric.RealType<T>>public BlockSupplier<T> displacements()
The components of the displacement vector are in dimension 0, shifting
all other dimensions by 1. (The returned BlockSupplier has numDimensions() + 1 dimensions.)
public double[] scale()
displacement field coordinates and
displacement vectors should be scaled by this factor when looking up
intensities in a source image.
In other words, this is the spacing of the displacement field grid in units of source image pixels.
public double[] translation()
displacements() into a position field for
value look-up in the source image, this translation vector is added.
(This happens after scaling, so the translation is in units of source
image pixels).
For example, this can be used to compensate for half-pixel offsets when applying downsampled displacement fields to full-resolution images.
Copyright © 2009–2026 ImgLib2. All rights reserved.