public class InterpolatingMicrosphere
extends java.lang.Object
MicrosphereProjectionInterpolator algorithm.| Modifier and Type | Class and Description |
|---|---|
private static class |
InterpolatingMicrosphere.Facet
Microsphere "facet" (surface element).
|
private static class |
InterpolatingMicrosphere.FacetData
Data associated with each
InterpolatingMicrosphere.Facet. |
| Modifier and Type | Field and Description |
|---|---|
private double |
background
Background value.
|
private double |
darkThreshold
Lowest non-zero illumination.
|
private int |
dimension
Space dimension.
|
private double |
maxDarkFraction
Maximum fraction of the facets that can be dark.
|
private java.util.List<InterpolatingMicrosphere.Facet> |
microsphere
Microsphere.
|
private java.util.List<InterpolatingMicrosphere.FacetData> |
microsphereData
Microsphere data.
|
private int |
size
Number of surface elements.
|
| Modifier | Constructor and Description |
|---|---|
protected |
InterpolatingMicrosphere(InterpolatingMicrosphere other)
Copy constructor.
|
protected |
InterpolatingMicrosphere(int dimension,
int size,
double maxDarkFraction,
double darkThreshold,
double background)
Create an unitialiazed sphere.
|
|
InterpolatingMicrosphere(int dimension,
int size,
double maxDarkFraction,
double darkThreshold,
double background,
UnitSphereRandomVectorGenerator rand)
Create a sphere from randomly sampled vectors.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(double[] normal,
boolean copy)
Replace
i-th facet of the microsphere. |
private void |
clear()
Reset the all the
facets data to zero. |
InterpolatingMicrosphere |
copy()
Perform a copy.
|
int |
getDimension()
Get the space dimensionality.
|
int |
getSize()
Get the size of the sphere.
|
private void |
illuminate(double[] sampleDirection,
double sampleValue,
double weight)
Illumination.
|
private double |
interpolate()
Interpolation.
|
double |
value(double[] point,
double[][] samplePoints,
double[] sampleValues,
double exponent,
double noInterpolationTolerance)
Estimate the value at the requested location.
|
private final java.util.List<InterpolatingMicrosphere.Facet> microsphere
private final java.util.List<InterpolatingMicrosphere.FacetData> microsphereData
private final int dimension
private final int size
private final double maxDarkFraction
private final double darkThreshold
private final double background
protected InterpolatingMicrosphere(int dimension,
int size,
double maxDarkFraction,
double darkThreshold,
double background)
add(double[]) add
method in order to initialize all the sphere's facets.dimension - Dimension of the data space.size - Number of surface elements of the sphere.maxDarkFraction - Maximum fraction of the facets that can be dark.
If the fraction of "non-illuminated" facets is larger, no estimation
of the value will be performed, and the background value will
be returned instead.darkThreshold - Value of the illumination below which a facet is
considered dark.background - Value returned when the maxDarkFraction
threshold is exceeded.NotStrictlyPositiveException - if dimension <= 0
or size <= 0.NotPositiveException - if darkThreshold < 0.OutOfRangeException - if maxDarkFraction does not
belong to the interval [0, 1].public InterpolatingMicrosphere(int dimension,
int size,
double maxDarkFraction,
double darkThreshold,
double background,
UnitSphereRandomVectorGenerator rand)
dimension - Dimension of the data space.size - Number of surface elements of the sphere.rand - Unit vector generator for creating the microsphere.maxDarkFraction - Maximum fraction of the facets that can be dark.
If the fraction of "non-illuminated" facets is larger, no estimation
of the value will be performed, and the background value will
be returned instead.darkThreshold - Value of the illumination below which a facet
is considered dark.background - Value returned when the maxDarkFraction
threshold is exceeded.DimensionMismatchException - if the size of the generated
vectors does not match the dimension set in the constructor.NotStrictlyPositiveException - if dimension <= 0
or size <= 0.NotPositiveException - if darkThreshold < 0.OutOfRangeException - if maxDarkFraction does not
belong to the interval [0, 1].protected InterpolatingMicrosphere(InterpolatingMicrosphere other)
other - Instance to copy.public InterpolatingMicrosphere copy()
public int getDimension()
public int getSize()
public double value(double[] point,
double[][] samplePoints,
double[] sampleValues,
double exponent,
double noInterpolationTolerance)
point, contribution
of the given samplePoints to each sphere facet is computed
(illumination) and the interpolation is performed (integration of
the illumination).point - Interpolation point.samplePoints - Sampling data points.sampleValues - Sampling data values at the corresponding
samplePoints.exponent - Exponent used in the power law that computes
the weights (distance dimming factor) of the sample data.noInterpolationTolerance - When the distance between the
point and one of the samplePoints is less than
this value, no interpolation will be performed, and the value
of the sample will just be returned.point.NotPositiveException - if exponent < 0.protected void add(double[] normal,
boolean copy)
i-th facet of the microsphere.
Method for initializing the microsphere facets.normal - Facet's normal vector.copy - Whether to copy the given array.DimensionMismatchException - if the length of n
does not match the space dimension.MaxCountExceededException - if the method has been called
more times than the size of the sphere.private double interpolate()
private void illuminate(double[] sampleDirection,
double sampleValue,
double weight)
sampleDirection - Vector whose origin is at the interpolation
point and tail is at the sample location.sampleValue - Data value of the sample.weight - Weight.private void clear()
facets data to zero.Copyright (c) 2003-2017 Apache Software Foundation