public abstract class QuantumStrategy extends Object
quantize(double)
by delegating to the configured quantum map. Encapsulate a
computation strategy for the quantization process i.e. LUT and Approximation.
Implement onWindowChange()
to get notified when the input interval
changes.Modifier and Type | Field and Description |
---|---|
static int |
DECILE
Determines the number of sub-intervals of the [globalMin, globalMax]
interval.
|
static int |
MAX
Maximum value (
255 ) allowed for the upper bound of the
codomain interval. |
static int |
MIN
Minimum value (
0 ) allowed for the lower bound of the
codomain interval. |
protected Pixels |
pixels
The pixels this strategy is for.
|
protected QuantumDef |
qDef
Reference to a quantumDef object.
|
protected QuantumMap |
valueMapper
Reference to the value mapper.
|
Modifier | Constructor and Description |
---|---|
protected |
QuantumStrategy(QuantumDef qd,
Pixels pixels)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
double |
getCurveCoefficient()
Returns the coefficient identifying a curve within a given family.
|
Family |
getFamily()
Returns the mapping family.
|
double |
getGlobalMax()
Returns the maximum of all maxima.
|
double |
getGlobalMin()
Returns the minimum of all minima.
|
protected Double |
getMiddleRange(double value)
Returns the range the values belongs to.
|
boolean |
getNoiseReduction()
Returns
true if the noise reduction algorithm
is turned on, false if turned off. |
double |
getOriginalGlobalMax()
Returns the original maximum of all minima.
|
double |
getOriginalGlobalMin()
Returns the original minimum of all minima.
|
double |
getPixelsTypeMax()
Returns the upper bound of the pixels range or
0
if the value couldn't be set. |
double |
getPixelsTypeMin()
Returns the lower bound of the pixels range or
0
if the value couldn't be set. |
double |
getWindowEnd()
Returns the upper bound of the input interval.
|
double |
getWindowStart()
Returns the lower bound of the input interval.
|
protected abstract void |
onWindowChange()
Notifies when the input interval has changed or the mapping strategy has
changed.
|
abstract int |
quantize(double value)
Maps a value from [windowStart, windowEnd] to a value in the codomain
interval.
|
void |
setExtent(double globalMin,
double globalMax)
Sets the maximum range of the input window.
|
void |
setMap(QuantumMap qMap)
Sets the quantum map.
|
void |
setMapping(Family family,
double k,
boolean noiseReduction)
Sets the selected family, the curve coefficient and the noise reduction
flag.
|
void |
setQuantizationMap(Family family,
double k,
boolean noiseReduction)
Sets the selected family, the curve coefficient and the noise reduction
flag and rebuilds the look-up table.
|
void |
setWindow(double start,
double end)
Sets the input window interval.
|
public static final int MAX
255
) allowed for the upper bound of the
codomain interval.public static final int MIN
0
) allowed for the lower bound of the
codomain interval.public static final int DECILE
protected final QuantumDef qDef
protected final Pixels pixels
protected QuantumMap valueMapper
protected QuantumStrategy(QuantumDef qd, Pixels pixels)
qd
- The QuantumDef
this strategy is for.pixels
- The pixels to handle.protected Double getMiddleRange(double value)
value
- The value to handlepublic void setExtent(double globalMin, double globalMax)
globalMin
- The minimum of all minima for a specified stack.globalMax
- The maximum of all maxima for a specified stack.public void setWindow(double start, double end)
start
- The lower bound of the interval.end
- The upper bound of the interval.public void setMapping(Family family, double k, boolean noiseReduction)
family
- The mapping family.k
- The curve coefficient.noiseReduction
- The noise reduction flag.public void setQuantizationMap(Family family, double k, boolean noiseReduction)
family
- The mapping family.k
- The curve coefficient.noiseReduction
- The noise reduction flag.public void setMap(QuantumMap qMap)
qMap
- The value to set.public Family getFamily()
public double getCurveCoefficient()
public boolean getNoiseReduction()
true
if the noise reduction algorithm
is turned on, false
if turned off.public double getGlobalMin()
public double getGlobalMax()
public double getOriginalGlobalMin()
public double getOriginalGlobalMax()
public double getPixelsTypeMin()
0
if the value couldn't be set.public double getPixelsTypeMax()
0
if the value couldn't be set.public double getWindowStart()
public double getWindowEnd()
protected abstract void onWindowChange()
public abstract int quantize(double value) throws QuantizationException
value
- The pixel intensity value.QuantizationException
- If the specified value is not in the interval [globalMin,
globalMax].
Version: 5.2.8-ice35-b57
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.