at.tuwien.ifs.somtoolbox.apps.viewer
Class RhythmPattern

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.apps.viewer.RhythmPattern

public class RhythmPattern
extends Object

Creates a visualization of Rhythm Pattern feature vectors.

Version:
$Id: RhythmPattern.java 3589 2010-05-21 10:42:01Z mayer $
Author:
Thomas Lidy

Field Summary
 int bx
           
 int by
           
private static int DEFAULT_bx
           
private static int DEFAULT_by
           
private  double[][] mat
           
private  double maxv
           
private  double minv
           
private  Color[] palette
           
private  int xdim
           
private  int ydim
           
 
Constructor Summary
RhythmPattern(double[] vec)
          This constructor uses pre-defined hard-coded values; it is not recommended to use this constructor it is intended for backward compatibility for RP feature vector files without the $DATA_TYPE header
RhythmPattern(double[] vec, int xdim, int ydim)
          this constructor uses default graphics block size
RhythmPattern(double[] vec, int xdim, int ydim, int blocksize_x, int blocksize_y)
           
RhythmPattern(cern.colt.matrix.DoubleMatrix1D vec)
          This constructor uses pre-defined hard-coded values; it is not recommended to use this constructor it is intended for backward compatibility for RP feature vector files without the $DATA_TYPE header
RhythmPattern(cern.colt.matrix.DoubleMatrix1D vec, int xdim, int ydim)
          constructor with feature vector given as DoubleMatrix1D (as provided by class SOMLibSparseInputData)
RhythmPattern(cern.colt.matrix.DoubleMatrix1D vec, int xdim, int ydim, int blocksize_x, int blocksize_y)
           
 
Method Summary
 BufferedImage getImage()
           
 double[][] getMatrix()
           
 Dimension getSize()
           
 int getXdim()
           
 int getYdim()
           
private  Color[] initMatlabPalette()
          this palette is the MATLAB jet colormap it consists of 6 fixed color values which are interpolated through 64 values
private  void initPaint()
           
 void paint(Graphics g)
          paints on Graphics object provided (either by local method or by a Dialog window)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xdim

private int xdim

ydim

private int ydim

mat

private double[][] mat

minv

private double minv

maxv

private double maxv

DEFAULT_bx

private static final int DEFAULT_bx
See Also:
Constant Field Values

DEFAULT_by

private static final int DEFAULT_by
See Also:
Constant Field Values

bx

public int bx

by

public int by

palette

private Color[] palette
Constructor Detail

RhythmPattern

public RhythmPattern(double[] vec)
              throws DataDimensionException
This constructor uses pre-defined hard-coded values; it is not recommended to use this constructor it is intended for backward compatibility for RP feature vector files without the $DATA_TYPE header

Throws:
DataDimensionException

RhythmPattern

public RhythmPattern(double[] vec,
                     int xdim,
                     int ydim)
              throws DataDimensionException
this constructor uses default graphics block size

Parameters:
vec - feature vector given as double[] array (as used for weight vectors)
xdim - the RP matrix dimension (x)
ydim - the RP matrix dimension (y)
Throws:
DataDimensionException

RhythmPattern

public RhythmPattern(double[] vec,
                     int xdim,
                     int ydim,
                     int blocksize_x,
                     int blocksize_y)
              throws DataDimensionException
Parameters:
vec - feature vector given as double[] array (as used for weight vectors)
xdim - the RP matrix dimension (x)
ydim - the RP matrix dimension (y)
blocksize_x - the blocksize for a RP graphics data point (x)
blocksize_y - the blocksize for a RP graphics data point (y)
Throws:
DataDimensionException

RhythmPattern

public RhythmPattern(cern.colt.matrix.DoubleMatrix1D vec)
              throws DataDimensionException
This constructor uses pre-defined hard-coded values; it is not recommended to use this constructor it is intended for backward compatibility for RP feature vector files without the $DATA_TYPE header

Throws:
DataDimensionException

RhythmPattern

public RhythmPattern(cern.colt.matrix.DoubleMatrix1D vec,
                     int xdim,
                     int ydim)
              throws DataDimensionException
constructor with feature vector given as DoubleMatrix1D (as provided by class SOMLibSparseInputData)

Throws:
DataDimensionException

RhythmPattern

public RhythmPattern(cern.colt.matrix.DoubleMatrix1D vec,
                     int xdim,
                     int ydim,
                     int blocksize_x,
                     int blocksize_y)
              throws DataDimensionException
Parameters:
vec - feature vector given as DoubleMatrix1D (as provided by class SOMLibSparseInputData)
xdim - the RP matrix dimension (x)
ydim - the RP matrix dimension (y)
blocksize_x - the blocksize for a RP graphics data point (x)
blocksize_y - the blocksize for a RP graphics data point (y)
Throws:
DataDimensionException
Method Detail

initPaint

private void initPaint()

getXdim

public int getXdim()
Returns:
x dimension of RP matrix

getYdim

public int getYdim()
Returns:
y dimension of RP matrix

getSize

public Dimension getSize()
Returns:
size of RhythmPattern in pixels

getMatrix

public double[][] getMatrix()
Returns:
RP matrix as double[][] array

getImage

public BufferedImage getImage()
Returns:
a RhythmPattern as a BufferedImage

paint

public void paint(Graphics g)
paints on Graphics object provided (either by local method or by a Dialog window)


initMatlabPalette

private Color[] initMatlabPalette()
this palette is the MATLAB jet colormap it consists of 6 fixed color values which are interpolated through 64 values