Class NumberOfBinsGenerator
- java.lang.Object
-
- edu.gsu.cs.dmlab.imageproc.imageparam.util.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 argumenttotal
.- Author:
- Azim Ahmadzadeh, Data Mining Lab, Georgia State University
-
-
Field Summary
Fields Modifier and Type Field Description static int
TOTAL_NUMBER_OF_TRIALS
-
Constructor Summary
Constructors Constructor Description NumberOfBinsGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]
findAllNOfBins_Bounded(double min, double max)
static int[]
findAllNOfBins_Bounded(double min, double max, int total)
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.static int
findNOfBinsForIndex_Bounded(double min, double max, int index, int total)
This is similar tofindNOfBinsForIndex
except that it allows different values for the constant fieldTOTAL_NUMBER_OF_TRAILS
.
-
-
-
Field Detail
-
TOTAL_NUMBER_OF_TRIALS
public static final int TOTAL_NUMBER_OF_TRIALS
- See Also:
- Constant Field Values
-
-
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 valuemax
- maximum intensity valueindex
- 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 tofindNOfBinsForIndex
except that it allows different values for the constant fieldTOTAL_NUMBER_OF_TRAILS
.- Parameters:
min
- minimum intensity valuemax
- maximum intensity valueindex
- starts at zero, as the first elementtotal
- total number of bins out of which theindex
-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:
-
-