omeis.providers.re.quantum
Class QuantumStrategy

java.lang.Object
  extended by omeis.providers.re.quantum.QuantumStrategy
Direct Known Subclasses:
BinaryMaskQuantizer, Quantization_8_16_bit

public abstract class QuantumStrategy
extends Object

TODO: review javadoc. Subclasses Work on explicit pixel types. Taking into account the pixel types, transform the pixel intensity value passed to 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.

Since:
OME2.2
Version:
2.2 (Internal version: $Revision: 4421 $ $Date: 2005/06/20 14:12:05 $)
Author:
Jean-Marie Burel      j.burel@dundee.ac.uk,
Andrea Falconi      a.falconi@dundee.ac.uk

Field Summary
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  ome.model.display.QuantumDef qDef
          Reference to a quantumDef object.
protected  ome.model.enums.PixelsType type
          The type of pixels this strategy is for.
protected  QuantumMap valueMapper
          Reference to the value mapper.
 
Constructor Summary
protected QuantumStrategy(ome.model.display.QuantumDef qd, ome.model.enums.PixelsType pt)
          Creates a new instance.
 
Method Summary
 double getCurveCoefficient()
          Returns the coefficient identifying a curve within a given family.
 ome.model.enums.Family getFamily()
          Returns the mapping family.
 double getGlobalMax()
          Returns the maximum of all maxima.
 double getGlobalMin()
          Returns the minimum of all minima.
 boolean getNoiseReduction()
          Returns true if the noise reduction algorithm is turned on, false if turned off.
 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(ome.model.enums.Family family, double k, boolean noiseReduction)
          Sets the selected family, the curve coefficient and the noise reduction flag.
 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.
 void setWindow(double start, double end)
          Sets the input window interval.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


type

protected final ome.model.enums.PixelsType type
The type of pixels this strategy is for.


valueMapper

protected QuantumMap valueMapper
Reference to the value mapper.

Constructor Detail

QuantumStrategy

protected QuantumStrategy(ome.model.display.QuantumDef qd,
                          ome.model.enums.PixelsType pt)
Creates a new instance.

Parameters:
qd - The QuantumDef this strategy is for.
pt -
Method Detail

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()
Returns true if the noise reduction algorithm is turned on, false if 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.

getPixelsTypeMin

public double getPixelsTypeMin()
Returns the lower bound of the pixels range or 0 if the value couldn't be set.

Returns:
See above.

getPixelsTypeMax

public double getPixelsTypeMax()
Returns the upper bound of the pixels range or 0 if 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 QuantizationException
Maps a value from [windowStart, windowEnd] to a value in the codomain interval.

Parameters:
value - The pixel intensity value.
Returns:
int 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].


OmeroJava Api

Version: Beta-4.1.1-r5927-b91

Copyright © 2009 The University of Dundee. All Rights Reserved.