at.tuwien.ifs.somtoolbox.visualization
Class EntropyVisualizer

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer
      extended by at.tuwien.ifs.somtoolbox.visualization.AbstractMatrixVisualizer
          extended by at.tuwien.ifs.somtoolbox.visualization.EntropyVisualizer
All Implemented Interfaces:
BackgroundImageVisualizer, MatrixVisualizer, QualityMeasureVisualizer, Comparable<BackgroundImageVisualizer>

public class EntropyVisualizer
extends AbstractMatrixVisualizer
implements QualityMeasureVisualizer

Version:
$Id: EntropyVisualizer.java 3587 2010-05-21 10:35:33Z mayer $
Author:
Martin Waitzbauer (0226025)

Nested Class Summary
 
Nested classes/interfaces inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer
AbstractBackgroundImageVisualizer.ContourInterpolationMode, AbstractBackgroundImageVisualizer.ContourMode, AbstractBackgroundImageVisualizer.VisualizationControlPanel
 
Field Summary
private  ArrayList<Double> entropyclass_list
           
private  ArrayList<HashMap<String,Integer>> entropyclassnames_list
           
 SOMRegion MAXENTROPY_REGION
           
(package private)  double min_visible_class
           
 SOMRegion MINENTROPY_REGION
           
protected  Hashtable<String,RegionManager> regionCache
           
private  RegionManager regionManager
           
private  int zoom
           
 
Fields inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractMatrixVisualizer
maximumMatrixValue, minimumMatrixValue, palette
 
Fields inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer
cache, CACHE_KEY_SECTION_SEPARATOR, CACHE_KEY_SEPARATOR, contourInterpolationMode, contourMode, controlPanel, currentZDimSlice, inputObjects, interpolate, log, map, MAX_CACHE_SIZE_MB, neededInputObjects, NUM_VISUALIZATIONS, numberOfContours, opacity, preferredScaleFactor, VISUALIZATION_DESCRIPTIONS, VISUALIZATION_NAMES, VISUALIZATION_SHORT_NAMES, visualizationUpdateListener, zSize
 
Fields inherited from interface at.tuwien.ifs.somtoolbox.visualization.BackgroundImageVisualizer
DEFAULT_BACKGROUND_VISUALIZATION_SCALE
 
Constructor Summary
EntropyVisualizer()
           
 
Method Summary
 double ClassEntropy(int index)
          returns the entropy for class with 'index'
 String[][] ClassEntropyNames(int index)
          returns every other class+hits contained in the regions with classmembers from the given index, or null if index exceeds the possible number of classes
 BufferedImage createVisualization(int index, GrowingSOM gsom, int width, int height)
          Creates a visualisation image.
 void fillRegions(int index, Graphics2D g)
          Fills the Regions
private  Color getBestFittingColor(double c1, double max)
          Spreads the current Region Entropy Error along the whole Palette Interval.
 double getMaximumEntropy()
          returns the maximum entropy regions value as double;F
 String[][] getMaximumEntropyRegionNames()
          returns the Maximum Entropy Region's Class Names
 double getMinimumEntropy()
          returns the minimum entropy regions value as double;
 double getPercOfZeroEntropyRegions()
          returns the percentage of regions with 0 Entropy
private  void mergeClasses(ArrayList<String[][]> target)
          helper method: go through all regions in the arraylist(all of which have the same index) and count classnames and hits.
 
Methods inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractMatrixVisualizer
computeHitHistogram, computeSpline, constrainWithinPalette, createImage, drawContour, getCacheKey, getCurrentPalette, getMaximumMatrixValue, getMinimumMatrixValue, getPalette, getPreferredPaletteName, getVisualization, invalidateCache, reversePalette, setInterpolate, setPalette
 
Methods inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer
appendToCacheKey, buildCacheKey, checkNeededObjectsAvailable, checkVariantIndex, clearVisualisationCache, compareTo, createVisualization, drawBackground, getControlPanel, getHTMLVisualisationControl, getNumberOfVisualizations, getPreferredScaleFactor, getVariantException, getVisualizationDescription, getVisualizationDescriptions, getVisualizationFlavours, getVisualizationFlavours, getVisualizationFlavours, getVisualizationName, getVisualizationNames, getVisualizationShortName, getVisualizationShortNames, invalidateCache, logImageCache, needsAdditionalFiles, setInputObjects, setMap, setSOMData, setVisualizationUpdateListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface at.tuwien.ifs.somtoolbox.visualization.BackgroundImageVisualizer
getControlPanel, getHTMLVisualisationControl, getNumberOfVisualizations, getPreferredScaleFactor, getVisualization, getVisualizationDescription, getVisualizationDescriptions, getVisualizationFlavours, getVisualizationFlavours, getVisualizationFlavours, getVisualizationName, getVisualizationNames, getVisualizationShortName, getVisualizationShortNames, needsAdditionalFiles, setInputObjects, setMap, setSOMData, setVisualizationUpdateListener
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

zoom

private int zoom

min_visible_class

double min_visible_class

MAXENTROPY_REGION

public final SOMRegion MAXENTROPY_REGION

MINENTROPY_REGION

public final SOMRegion MINENTROPY_REGION

regionCache

protected Hashtable<String,RegionManager> regionCache

regionManager

private RegionManager regionManager

entropyclass_list

private ArrayList<Double> entropyclass_list

entropyclassnames_list

private ArrayList<HashMap<String,Integer>> entropyclassnames_list
Constructor Detail

EntropyVisualizer

public EntropyVisualizer()
Method Detail

createVisualization

public BufferedImage createVisualization(int index,
                                         GrowingSOM gsom,
                                         int width,
                                         int height)
                                  throws SOMToolboxException
Description copied from class: AbstractBackgroundImageVisualizer
Creates a visualisation image. Subclasses must implement this method.

Specified by:
createVisualization in class AbstractBackgroundImageVisualizer
Parameters:
index - the index of the variant to use
gsom - the GrowingSOM to take build the visualisation for
width - the desired width of the image, in pixels
height - the desired height of the image, in pixels.
Returns:
an image for this visualisation.
Throws:
SOMToolboxException

fillRegions

public void fillRegions(int index,
                        Graphics2D g)
Fills the Regions

Parameters:
index - Index specifies the Class to be displayed, if index is set to -1, all the classes are painted

getBestFittingColor

private Color getBestFittingColor(double c1,
                                  double max)
Spreads the current Region Entropy Error along the whole Palette Interval. (Entropy Error uses to be very small, and thus generates only colors in a small interval)


getMaximumEntropy

public double getMaximumEntropy()
returns the maximum entropy regions value as double;F


getMinimumEntropy

public double getMinimumEntropy()
returns the minimum entropy regions value as double;


getMaximumEntropyRegionNames

public String[][] getMaximumEntropyRegionNames()
returns the Maximum Entropy Region's Class Names


getPercOfZeroEntropyRegions

public double getPercOfZeroEntropyRegions()
returns the percentage of regions with 0 Entropy

Returns:
counter

ClassEntropy

public double ClassEntropy(int index)
returns the entropy for class with 'index'


mergeClasses

private void mergeClasses(ArrayList<String[][]> target)
helper method: go through all regions in the arraylist(all of which have the same index) and count classnames and hits.

Parameters:
target - is an arraylist , containing all different Regions with the specified Class index as Main class

ClassEntropyNames

public String[][] ClassEntropyNames(int index)
returns every other class+hits contained in the regions with classmembers from the given index, or null if index exceeds the possible number of classes