Class NumberOfBinsGenerator


  • public abstract class NumberOfBinsGenerator
    extends Object

    This class is designed to assist approaching a specific problem. To experiment on the performance of some parameters (such as Entropy and Uniformity), we would need to decide what domain for the argument nOfBins (i.e., number of bins) should those parameters be tested on. For JP2, the decision is simple. A pre-defined set of nOfBins could be used across different wavelength channels. However, when it comes to clipped FITS formats, the range of color intensities varies from a wavelength to another. Therefore, a dynamic domain is required. Using this class, we generate such domain depending on the (wavelength, or to be exact) min and max values of the color intensity. However, for JP2 images, the domain remain the same across different wavelengths.
    In case of FITS images, the color intensities are usually extremely skewed and makes the histogram of the image mainly piled on the few left-most bins. It should also be noted that after clipped of these images, the color values are no longer integers. So, bin size is not bounded to 1 as its minimum width. Therefore, in case of FITS images one could multiply the upper bound of the color intensities by 10, and then use these methods.
    Example: For AIA_94 images, the range after clipping is [0, 44] while in most of the image, the maximum color intensity is less than 1, resulting in allowing all 4096 pixel colors in the left-most bar of the histogram. If we artificially use [0, 44X10], the following candidates for nOfBins will be generated:
    {20, 41, 62, 83, 104, 125, 146, 167, 188, 209, 230, 251, 272, 293, 314, 335, 356, 377, 398, 419, 440}
    which allows much thinner bins.


    The pre-defined static field, TOTAL_NUMBER_OF_TRIALS, indicates the size of the queried domain. In case a different value is needed, instead of changing this field, use those methods which have the extra argument total.
    Author:
    Azim Ahmadzadeh, Data Mining Lab, Georgia State University
    • Field Detail

    • Constructor Detail

      • NumberOfBinsGenerator

        public NumberOfBinsGenerator()
    • Method Detail

      • findNOfBinsForIndex_Bounded

        public static int findNOfBinsForIndex_Bounded​(double min,
                                                      double max,
                                                      int index)
        This function uses the histogram function for finding the array of all possible nOfBins that should be tried for the range [min,max], and returns the index-th element of the array. For instance, for AIA94 images of FITS format, the clipped range is [0,44], therefore the following array of nOfBins will be generated: {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 44}, thus, for index = 0 for example, it returns 2; the first element of the array.
        Parameters:
        min - minimum intensity value
        max - maximum intensity value
        index - starts at zero, as the first element
        Returns:
      • findNOfBinsForIndex_Bounded

        public static int findNOfBinsForIndex_Bounded​(double min,
                                                      double max,
                                                      int index,
                                                      int total)
        This is similar to findNOfBinsForIndex except that it allows different values for the constant field TOTAL_NUMBER_OF_TRAILS.
        Parameters:
        min - minimum intensity value
        max - maximum intensity value
        index - starts at zero, as the first element
        total - total number of bins out of which the index-th nOfBins should be returned.
        Returns:
      • findAllNOfBins_Bounded

        public static int[] findAllNOfBins_Bounded​(double min,
                                                   double max)
        Parameters:
        min -
        max -
        Returns:
      • findAllNOfBins_Bounded

        public static int[] findAllNOfBins_Bounded​(double min,
                                                   double max,
                                                   int total)
        Parameters:
        min -
        max -
        Returns: