at.tuwien.ifs.somtoolbox.visualization
Class RhythmPatternsAttributeVisualizer

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.RhythmPatternsAttributeVisualizer
All Implemented Interfaces:
BackgroundImageVisualizer, MatrixVisualizer, ActionListener, Comparable<BackgroundImageVisualizer>, EventListener

public class RhythmPatternsAttributeVisualizer
extends AbstractMatrixVisualizer
implements BackgroundImageVisualizer, ActionListener

Version:
$Id: RhythmPatternsAttributeVisualizer.java 3874 2010-11-02 14:14:38Z mayer $
Author:
Michael Dittenbach, Rudolf Mayer

Nested Class Summary
private  class RhythmPatternsAttributeVisualizer.RPAControlPanel
           
 
Nested classes/interfaces inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer
AbstractBackgroundImageVisualizer.ContourInterpolationMode, AbstractBackgroundImageVisualizer.ContourMode, AbstractBackgroundImageVisualizer.VisualizationControlPanel
 
Field Summary
private static String[] attributeTypes
           
private static String BASS
           
private  double[][] bassValues
           
private  double[][] lfdValues
           
private static String LOW_FREQ_DOM
           
private static String MAX_FLUX
           
private  double[][] maxfluxValues
           
private static String NON_AGGRESSIVE
           
private  double[][] nonaggValues
           
private  String selectedAttributeType
           
 
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
RhythmPatternsAttributeVisualizer()
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
private  BufferedImage createImage(double[][] values, int width, int height, boolean interpolate)
           
 BufferedImage createVisualization(int index, GrowingSOM gsom, int width, int height)
          Creates a visualisation image.
protected  String getCacheKey(GrowingSOM gsom, int index, int width, int height)
          The key of a cache is created as follows: VisualisationShortName + Hashcode of the SOM + Width + Height + Opacity.
Sub-classes might add more information to the cache, if needed.
protected  String getCacheKey(GrowingSOM gsom, int index, int width, int height, String attributeType)
           
 int getNumberOfAttributeTypes()
           
 String getSelectedAttributeType()
           
 HashMap<String,BufferedImage> getVisualizationFlavours(int variantIndex, GrowingSOM gsom, int width, int height)
          Saves all flavours of RP attribute types (#attributeTypes).
 HashMap<String,BufferedImage> getVisualizationFlavours(int variantIndex, GrowingSOM gsom, int width, int height, int maxFlavours)
          Default implementation equal to AbstractBackgroundImageVisualizer.getVisualizationFlavours(int, GrowingSOM, int, int).
 HashMap<String,BufferedImage> getVisualizationFlavours(int variantIndex, GrowingSOM gsom, int width, int height, Map<String,String> flavourParameters)
          Default implementation equal to AbstractBackgroundImageVisualizer.getVisualizationFlavours(int, GrowingSOM, int, int).
private  void initVisualizationMatrices(GrowingSOM gsom, int width, int height)
           
 void selectNextAttributeType()
           
 
Methods inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractMatrixVisualizer
computeHitHistogram, computeSpline, constrainWithinPalette, createImage, drawContour, 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, 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, getVisualizationName, getVisualizationNames, getVisualizationShortName, getVisualizationShortNames, needsAdditionalFiles, setInputObjects, setMap, setSOMData, setVisualizationUpdateListener
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

LOW_FREQ_DOM

private static final String LOW_FREQ_DOM
See Also:
Constant Field Values

NON_AGGRESSIVE

private static final String NON_AGGRESSIVE
See Also:
Constant Field Values

BASS

private static final String BASS
See Also:
Constant Field Values

MAX_FLUX

private static final String MAX_FLUX
See Also:
Constant Field Values

attributeTypes

private static final String[] attributeTypes

maxfluxValues

private double[][] maxfluxValues

bassValues

private double[][] bassValues

nonaggValues

private double[][] nonaggValues

lfdValues

private double[][] lfdValues

selectedAttributeType

private String selectedAttributeType
Constructor Detail

RhythmPatternsAttributeVisualizer

public RhythmPatternsAttributeVisualizer()
Method Detail

getCacheKey

protected String getCacheKey(GrowingSOM gsom,
                             int index,
                             int width,
                             int height)
Description copied from class: AbstractBackgroundImageVisualizer
The key of a cache is created as follows: VisualisationShortName + Hashcode of the SOM + Width + Height + Opacity.
Sub-classes might add more information to the cache, if needed.

Overrides:
getCacheKey in class AbstractMatrixVisualizer

getCacheKey

protected String getCacheKey(GrowingSOM gsom,
                             int index,
                             int width,
                             int height,
                             String attributeType)

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

initVisualizationMatrices

private void initVisualizationMatrices(GrowingSOM gsom,
                                       int width,
                                       int height)
                                throws SOMToolboxException
Throws:
SOMToolboxException

createImage

private BufferedImage createImage(double[][] values,
                                  int width,
                                  int height,
                                  boolean interpolate)

getSelectedAttributeType

public String getSelectedAttributeType()

selectNextAttributeType

public void selectNextAttributeType()

getNumberOfAttributeTypes

public int getNumberOfAttributeTypes()

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

getVisualizationFlavours

public HashMap<String,BufferedImage> getVisualizationFlavours(int variantIndex,
                                                              GrowingSOM gsom,
                                                              int width,
                                                              int height)
                                                       throws SOMToolboxException
Saves all flavours of RP attribute types (#attributeTypes).

Specified by:
getVisualizationFlavours in interface BackgroundImageVisualizer
Overrides:
getVisualizationFlavours in class AbstractBackgroundImageVisualizer
Throws:
SOMToolboxException

getVisualizationFlavours

public HashMap<String,BufferedImage> getVisualizationFlavours(int variantIndex,
                                                              GrowingSOM gsom,
                                                              int width,
                                                              int height,
                                                              int maxFlavours)
                                                       throws SOMToolboxException
Description copied from class: AbstractBackgroundImageVisualizer
Default implementation equal to AbstractBackgroundImageVisualizer.getVisualizationFlavours(int, GrowingSOM, int, int).

Specified by:
getVisualizationFlavours in interface BackgroundImageVisualizer
Overrides:
getVisualizationFlavours in class AbstractBackgroundImageVisualizer
Throws:
SOMToolboxException

getVisualizationFlavours

public HashMap<String,BufferedImage> getVisualizationFlavours(int variantIndex,
                                                              GrowingSOM gsom,
                                                              int width,
                                                              int height,
                                                              Map<String,String> flavourParameters)
                                                       throws SOMToolboxException
Description copied from class: AbstractBackgroundImageVisualizer
Default implementation equal to AbstractBackgroundImageVisualizer.getVisualizationFlavours(int, GrowingSOM, int, int).

Specified by:
getVisualizationFlavours in interface BackgroundImageVisualizer
Overrides:
getVisualizationFlavours in class AbstractBackgroundImageVisualizer
Throws:
SOMToolboxException