Class QuantumFactory


  • public class QuantumFactory
    extends java.lang.Object
    Factory to create objects to carry out quantization for a given context. This class defines the constants to be used to identify a QuantumMap within a quantization context. It also defines the constants to be used to define the bit depth of the quantized output interval.
    Since:
    OME2.2
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEPTH_1BIT
      Flag to select a 1-bit depth (=2^1-1) output interval.
      static int DEPTH_2BIT
      Flag to select a 2-bit depth (=2^2-1) output interval.
      static int DEPTH_3BIT
      Flag to select a 3-bit depth (=2^3-1) output interval.
      static int DEPTH_4BIT
      Flag to select a 4-bit depth (=2^4-1) output interval.
      static int DEPTH_5BIT
      Flag to select a 5-bit depth (=2^5-1) output interval.
      static int DEPTH_6BIT
      Flag to select a 6-bit depth (=2^6-1) output interval.
      static int DEPTH_7BIT
      Flag to select a 7-bit depth (=2^7-1) output interval.
      static int DEPTH_8BIT
      Flag to select a 8-bit depth (=2^8-1) output interval.
      static java.lang.String EXPONENTIAL
      Deprecated.
      static java.lang.String LINEAR
      Deprecated.
      static java.lang.String LOGARITHMIC
      Deprecated.
      static boolean NOISE_REDUCTION
      Default value.
      static java.lang.String POLYNOMIAL
      Deprecated.
    • Constructor Summary

      Constructors 
      Constructor Description
      QuantumFactory​(java.util.List<ome.model.enums.Family> families)
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ome.model.enums.Family getFamily​(java.lang.String value)
      Helper method to retrieve a Family enumeration from the database.
      QuantumStrategy getStrategy​(ome.model.display.QuantumDef qd, ome.model.core.Pixels pixels)
      Returns a strategy to carry out the quantization process whose context is defined by pd.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEPTH_1BIT

        public static final int DEPTH_1BIT
        Flag to select a 1-bit depth (=2^1-1) output interval.
        See Also:
        Constant Field Values
      • DEPTH_2BIT

        public static final int DEPTH_2BIT
        Flag to select a 2-bit depth (=2^2-1) output interval.
        See Also:
        Constant Field Values
      • DEPTH_3BIT

        public static final int DEPTH_3BIT
        Flag to select a 3-bit depth (=2^3-1) output interval.
        See Also:
        Constant Field Values
      • DEPTH_4BIT

        public static final int DEPTH_4BIT
        Flag to select a 4-bit depth (=2^4-1) output interval.
        See Also:
        Constant Field Values
      • DEPTH_5BIT

        public static final int DEPTH_5BIT
        Flag to select a 5-bit depth (=2^5-1) output interval.
        See Also:
        Constant Field Values
      • DEPTH_6BIT

        public static final int DEPTH_6BIT
        Flag to select a 6-bit depth (=2^6-1) output interval.
        See Also:
        Constant Field Values
      • DEPTH_7BIT

        public static final int DEPTH_7BIT
        Flag to select a 7-bit depth (=2^7-1) output interval.
        See Also:
        Constant Field Values
      • DEPTH_8BIT

        public static final int DEPTH_8BIT
        Flag to select a 8-bit depth (=2^8-1) output interval.
        See Also:
        Constant Field Values
      • LINEAR

        @Deprecated
        public static final java.lang.String LINEAR
        Deprecated.
        Flag to select a linear map for the quantization process. The equation of the map is of the form y = a*x + b. The a and b coefficients depend on the input and output (codomain) interval of the map.
        See Also:
        Constant Field Values
      • EXPONENTIAL

        @Deprecated
        public static final java.lang.String EXPONENTIAL
        Deprecated.
        Flag to select a exponential map for the quantization process. The equation of the map is of the form y = a*(exp(x^k)) + b. The a and b coefficients depend on the input and output (codomain) interval of the map. The k coefficient is the one specified by the context.
        See Also:
        Constant Field Values
      • LOGARITHMIC

        @Deprecated
        public static final java.lang.String LOGARITHMIC
        Deprecated.
        Flag to select a logarithmic map for the quantization process. The equation of the map is of the form y = a*log(x) + b. The a and b coefficients depend on the input and output (codomain) interval of the map.
        See Also:
        Constant Field Values
      • POLYNOMIAL

        @Deprecated
        public static final java.lang.String POLYNOMIAL
        Deprecated.
        Flag to select a polynomial map for the quantization process. The equation of the map is of the form y = a*x^k + b. The a and b coefficients depend on the input and output (codomain) interval of the map. The k coefficient is the one specified by the context. Note that LINEAR is a special case of polynomial (k = 1). We keep the LINEAR constant for some UI reason but we apply the same algorithm.
        See Also:
        Constant Field Values
      • NOISE_REDUCTION

        public static final boolean NOISE_REDUCTION
        Default value.
        See Also:
        Constant Field Values
    • Constructor Detail

      • QuantumFactory

        public QuantumFactory​(java.util.List<ome.model.enums.Family> families)
        Default constructor.
        Parameters:
        families - the enumerated list of all families.
    • Method Detail

      • getFamily

        public ome.model.enums.Family getFamily​(java.lang.String value)
        Helper method to retrieve a Family enumeration from the database.
        Parameters:
        value - The enumeration value.
        Returns:
        A family enumeration object.
      • getStrategy

        public QuantumStrategy getStrategy​(ome.model.display.QuantumDef qd,
                                           ome.model.core.Pixels pixels)
        Returns a strategy to carry out the quantization process whose context is defined by pd.
        Parameters:
        qd - Defines the quantization context. Mustn't be null and its values must have been properly specified.
        pixels - The pixels to handle.
        Returns:
        A QuantumStrategy suitable for the specified context.