Package omeis.providers.re.quantum
Class QuantumStrategy
- java.lang.Object
-
- omeis.providers.re.quantum.QuantumStrategy
-
- Direct Known Subclasses:
BinaryMaskQuantizer,Quantization_32_bit,Quantization_8_16_bit,Quantization_float
public abstract class QuantumStrategy extends java.lang.ObjectSubclasses Work on explicit pixel types. Taking into account the pixel types, transform the pixel intensity value passed toquantize(double)by delegating to the configured quantum map. Encapsulate a computation strategy for the quantization process i.e. LUT and Approximation. ImplementonWindowChange()to get notified when the input interval changes.- Since:
- OME2.2
-
-
Field Summary
Fields Modifier and Type Field Description static intDECILEDetermines the number of sub-intervals of the [globalMin, globalMax] interval.static intMAXMaximum value (255) allowed for the upper bound of the codomain interval.static intMINMinimum value (0) allowed for the lower bound of the codomain interval.protected ome.model.core.PixelspixelsThe pixels this strategy is for.protected ome.model.display.QuantumDefqDefReference to a quantumDef object.protected QuantumMapvalueMapperReference to the value mapper.
-
Constructor Summary
Constructors Modifier Constructor Description protectedQuantumStrategy(ome.model.display.QuantumDef qd, ome.model.core.Pixels pixels)Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description doublegetCurveCoefficient()Returns the coefficient identifying a curve within a given family.ome.model.enums.FamilygetFamily()Returns the mapping family.doublegetGlobalMax()Returns the maximum of all maxima.doublegetGlobalMin()Returns the minimum of all minima.protected java.lang.DoublegetMiddleRange(double value)Returns the range the values belongs to.booleangetNoiseReduction()Returnstrueif the noise reduction algorithm is turned on,falseif turned off.doublegetOriginalGlobalMax()Returns the original maximum of all minima.doublegetOriginalGlobalMin()Returns the original minimum of all minima.doublegetPixelsTypeMax()Returns the upper bound of the pixels range or0if the value couldn't be set.doublegetPixelsTypeMin()Returns the lower bound of the pixels range or0if the value couldn't be set.doublegetWindowEnd()Returns the upper bound of the input interval.doublegetWindowStart()Returns the lower bound of the input interval.protected abstract voidonWindowChange()Notifies when the input interval has changed or the mapping strategy has changed.abstract intquantize(double value)Maps a value from [windowStart, windowEnd] to a value in the codomain interval.voidsetExtent(double globalMin, double globalMax)Sets the maximum range of the input window.voidsetMap(QuantumMap qMap)Sets the quantum map.voidsetMapping(ome.model.enums.Family family, double k, boolean noiseReduction)Sets the selected family, the curve coefficient and the noise reduction flag.voidsetQuantizationMap(ome.model.enums.Family family, double k, boolean noiseReduction)Sets the selected family, the curve coefficient and the noise reduction flag and rebuilds the look-up table.voidsetWindow(double start, double end)Sets the input window interval.
-
-
-
Field Detail
-
MAX
public static final int MAX
Maximum value (255) allowed for the upper bound of the codomain interval.- See Also:
- Constant Field Values
-
MIN
public static final int MIN
Minimum value (0) allowed for the lower bound of the codomain interval.- See Also:
- Constant Field Values
-
DECILE
public static final int DECILE
Determines the number of sub-intervals of the [globalMin, globalMax] interval.- See Also:
- Constant Field Values
-
qDef
protected final ome.model.display.QuantumDef qDef
Reference to a quantumDef object.
-
pixels
protected final ome.model.core.Pixels pixels
The pixels this strategy is for.
-
valueMapper
protected QuantumMap valueMapper
Reference to the value mapper.
-
-
Method Detail
-
getMiddleRange
protected java.lang.Double getMiddleRange(double value)
Returns the range the values belongs to.- Parameters:
value- The value to handle- Returns:
- See above.
-
setExtent
public void setExtent(double globalMin, double globalMax)Sets the maximum range of the input window.- Parameters:
globalMin- The minimum of all minima for a specified stack.globalMax- The maximum of all maxima for a specified stack.
-
setWindow
public void setWindow(double start, double end)Sets the input window interval.- Parameters:
start- The lower bound of the interval.end- The upper bound of the interval.
-
setMapping
public void setMapping(ome.model.enums.Family family, double k, boolean noiseReduction)Sets the selected family, the curve coefficient and the noise reduction flag.- Parameters:
family- The mapping family.k- The curve coefficient.noiseReduction- The noise reduction flag.
-
setQuantizationMap
public void setQuantizationMap(ome.model.enums.Family family, double k, boolean noiseReduction)Sets the selected family, the curve coefficient and the noise reduction flag and rebuilds the look-up table.- Parameters:
family- The mapping family.k- The curve coefficient.noiseReduction- The noise reduction flag.
-
setMap
public void setMap(QuantumMap qMap)
Sets the quantum map.- Parameters:
qMap- The value to set.
-
getFamily
public ome.model.enums.Family getFamily()
Returns the mapping family.- Returns:
- See above.
-
getCurveCoefficient
public double getCurveCoefficient()
Returns the coefficient identifying a curve within a given family.- Returns:
- See above.
-
getNoiseReduction
public boolean getNoiseReduction()
Returnstrueif the noise reduction algorithm is turned on,falseif turned off.- Returns:
- See above.
-
getGlobalMin
public double getGlobalMin()
Returns the minimum of all minima.- Returns:
- See above.
-
getGlobalMax
public double getGlobalMax()
Returns the maximum of all maxima.- Returns:
- See above.
-
getOriginalGlobalMin
public double getOriginalGlobalMin()
Returns the original minimum of all minima.- Returns:
- See above.
-
getOriginalGlobalMax
public double getOriginalGlobalMax()
Returns the original maximum of all minima.- Returns:
- See above.
-
getPixelsTypeMin
public double getPixelsTypeMin()
Returns the lower bound of the pixels range or0if the value couldn't be set.- Returns:
- See above.
-
getPixelsTypeMax
public double getPixelsTypeMax()
Returns the upper bound of the pixels range or0if the value couldn't be set.- Returns:
- See above.
-
getWindowStart
public double getWindowStart()
Returns the lower bound of the input interval.- Returns:
- See above.
-
getWindowEnd
public double getWindowEnd()
Returns the upper bound of the input interval.- Returns:
- See above.
-
onWindowChange
protected abstract void onWindowChange()
Notifies when the input interval has changed or the mapping strategy has changed.
-
quantize
public abstract int quantize(double value) throws QuantizationExceptionMaps a value from [windowStart, windowEnd] to a value in the codomain interval.- Parameters:
value- The pixel intensity value.- Returns:
- The value in the codomain interval i.e. sub-interval of [0, 255].
- Throws:
QuantizationException- If the specified value is not in the interval [globalMin, globalMax].
-
-