public class BlendedGridder3 extends java.lang.Object implements Gridder3
The first step is to compute for all samples the distance to the nearest known sample and the value of that known sample. This first step produces a distance map and a nearest-neighbor interpolant.
The second step is to blend (smooth) the nearest-neighbor interpolant, where the extent of smoothing varies spatially and is proportional to distances in the distance map.
In tensor-guided gridding, we replace distance with time. Time is a simple term for non-Euclidean distance measured in a metric-tensor field. So "nearest" now means nearest in time. In the first step we compute a time map by solving an eikonal equation with coefficients that may be both anisotropic and spatially varying. In the second step, we blend the nearest-neighbor interpolant with an anisotropic and spatially varying smoothing filter.
The default tensor field is homogeneous and isotropic. In this special case, time is equivalent to distance, and tensor-guided gridding is similar to gridding with Sibson's natural neighbor interpolant.
Reference: Hale, D., 2009, Image-guided blended neighbor interpolation, CWP-634
Constructor and Description |
---|
BlendedGridder3()
Constructs a gridder for default tensors.
|
BlendedGridder3(float[] f,
float[] x1,
float[] x2,
float[] x3)
Constructs a gridder for default tensors and specified samples.
|
BlendedGridder3(Tensors3 tensors)
Constructs a gridder for the specified tensors.
|
BlendedGridder3(Tensors3 tensors,
float[] f,
float[] x1,
float[] x2,
float[] x3)
Constructs a gridder for the specified tensors and samples.
|
Modifier and Type | Method and Description |
---|---|
double |
getTimeMarkerS()
Experimental use only.
|
float[][][] |
grid(Sampling s1,
Sampling s2,
Sampling s3)
Computes gridded sample values from the known sample values.
|
void |
gridBlended(float[][][] t,
float[][][] p,
float[][][] q)
Computes gridded values using blended neighbors.
|
void |
gridNearest(float[][][] t,
float[][][] p)
Computes gridded values using nearest neighbors.
|
float[][][] |
gridNearest(float pnull,
float[][][] p)
Computes gridded values using nearest neighbors.
|
void |
setBlending(boolean blending)
Enables or disables blending in
grid(Sampling,Sampling,Sampling) . |
void |
setBlendingKernel(LocalDiffusionKernel ldk)
Sets the local diffusion kernel used to perform blending.
|
void |
setScattered(float[] f,
float[] x1,
float[] x2,
float[] x3)
Sets the known (scattered) samples.
|
void |
setSmoothness(double smoothness)
Sets the smoothness of the interpolation of gridded values.
|
void |
setTensors(Tensors3 tensors)
Sets the tensor field used by this gridder.
|
void |
setTimeMarkerX(boolean tmx)
Experimental use only.
|
void |
setTimeMax(double tmax)
Sets the maximum time computed by this gridder.
|
public BlendedGridder3()
public BlendedGridder3(float[] f, float[] x1, float[] x2, float[] x3)
f
- array of sample values f(x1,x2,x3).x1
- array of sample x1 coordinates.x2
- array of sample x2 coordinates.x3
- array of sample x3 coordinates.public BlendedGridder3(Tensors3 tensors)
tensors
- the tensors.public BlendedGridder3(Tensors3 tensors, float[] f, float[] x1, float[] x2, float[] x3)
tensors
- the tensors.f
- array of sample values f(x1,x2,x3).x1
- array of sample x1 coordinates.x2
- array of sample x2 coordinates.x3
- array of sample x3 coordinates.public void setTensors(Tensors3 tensors)
tensors
- the tensors; null for default tensors.public void setBlending(boolean blending)
grid(Sampling,Sampling,Sampling)
.
If true (the default), that method will perform both of the two
steps described; that is, it will blend (smooth) after computing
the nearest neighbor interpolant. If false, that method will perform
only the first step and return the nearest neighbor interpolant.blending
- true, for blending; false, otherwise.public void setBlendingKernel(LocalDiffusionKernel ldk)
ldk
- the local diffusion kernel.public void setSmoothness(double smoothness)
smoothness
- the smoothness.public void setTimeMax(double tmax)
tmax
- the maximum time.public void setTimeMarkerX(boolean tmx)
public double getTimeMarkerS()
public float[][][] gridNearest(float pnull, float[][][] p)
This method also computes and returns an array of times to nearest-neighbor samples. Times are zero for known samples and are positive for gridded samples.
pnull
- the null value representing unknown samples.p
- array of sample values to be gridded.public void gridNearest(float[][][] t, float[][][] p)
t
- array of times to nearest known samples.p
- array of nearest-neighbor gridded values.public void gridBlended(float[][][] t, float[][][] p, float[][][] q)
t
- array of times to nearest known samples.p
- array of nearest-neighbor gridded values.q
- array of blended-neighbor gridded values.public void setScattered(float[] f, float[] x1, float[] x2, float[] x3)
Gridder3
setScattered
in interface Gridder3
f
- array of sample values f(x1,x2,x3).x1
- array of sample x1 coordinates.x2
- array of sample x2 coordinates.x3
- array of sample x3 coordinates.public float[][][] grid(Sampling s1, Sampling s2, Sampling s3)
Gridder3