|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer
at.tuwien.ifs.somtoolbox.visualization.AbstractMatrixVisualizer
public abstract class AbstractMatrixVisualizer
Nested Class Summary |
---|
Nested classes/interfaces inherited from class at.tuwien.ifs.somtoolbox.visualization.AbstractBackgroundImageVisualizer |
---|
AbstractBackgroundImageVisualizer.ContourInterpolationMode, AbstractBackgroundImageVisualizer.ContourMode, AbstractBackgroundImageVisualizer.VisualizationControlPanel |
Field Summary | |
---|---|
protected double |
maximumMatrixValue
|
protected double |
minimumMatrixValue
|
protected Palette |
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 | |
---|---|
AbstractMatrixVisualizer()
|
Method Summary | |
---|---|
protected cern.colt.matrix.DoubleMatrix2D |
computeHitHistogram(GrowingSOM gsom)
Computes the hit-histogram from the given GrowingSOM . |
protected flanagan.interpolation.BiCubicSplineFast |
computeSpline(GrowingSOM gsom,
cern.colt.matrix.DoubleMatrix2D matrix,
int width,
int height,
int unitWidth,
int unitHeight)
|
protected int |
constrainWithinPalette(int ci)
|
protected BufferedImage |
createImage(GrowingSOM gsom,
cern.colt.matrix.DoubleMatrix2D matrix,
int width,
int height,
boolean interpolate)
Creates an image from a matrix of heights. |
protected void |
drawContour(Graphics2D g,
cern.colt.matrix.DoubleMatrix2D matrix,
int width,
int height,
boolean fill)
|
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. |
Palette |
getCurrentPalette()
Returns the Palette this visualisation currently is set to. |
double |
getMaximumMatrixValue()
|
double |
getMinimumMatrixValue()
|
Color[] |
getPalette()
Gets the currently used palette. |
String |
getPreferredPaletteName()
Default implementation using Palettes.getDefaultPalette() . |
BufferedImage |
getVisualization(int index,
GrowingSOM gsom,
int width,
int height)
overriding the method in the superclass as we have a different cache key, and to set the min & max matrix values to -1 |
void |
invalidateCache(Palette palette)
Deletes all cached elements that use the Palette with the given index. |
void |
reversePalette()
Reverts the currently used palette. |
protected void |
setInterpolate(boolean interpolate)
|
void |
setPalette(Palette newPalette)
Sets a new palette. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Palette palette
protected double minimumMatrixValue
protected double maximumMatrixValue
Constructor Detail |
---|
public AbstractMatrixVisualizer()
Method Detail |
---|
public double getMinimumMatrixValue()
public double getMaximumMatrixValue()
public BufferedImage getVisualization(int index, GrowingSOM gsom, int width, int height) throws SOMToolboxException
getVisualization
in interface BackgroundImageVisualizer
getVisualization
in class AbstractBackgroundImageVisualizer
index
- the index of the variant to usegsom
- the GrowingSOM to take build the visualisation forwidth
- the desired width of the image, in pixelsheight
- the desired height of the image, in pixels
SOMToolboxException
- If there was an error creating the visualisationBackgroundImageVisualizer.getVisualization(int,
at.tuwien.ifs.somtoolbox.models.GrowingSOM, int, int)
protected String getCacheKey(GrowingSOM gsom, int index, int width, int height)
AbstractBackgroundImageVisualizer
getCacheKey
in class AbstractBackgroundImageVisualizer
protected void setInterpolate(boolean interpolate)
protected void drawContour(Graphics2D g, cern.colt.matrix.DoubleMatrix2D matrix, int width, int height, boolean fill) throws SOMToolboxException
SOMToolboxException
protected BufferedImage createImage(GrowingSOM gsom, cern.colt.matrix.DoubleMatrix2D matrix, int width, int height, boolean interpolate) throws SOMToolboxException
gsom
- The GrowingSOM to generate the image formatrix
- The matrix with the calucalted heights.width
- the desired width of the image, in pixelsheight
- the desired height of the image, in pixels.interpolate
- indicates whether the image should be interpolated if the widht or height exceeds the matrix
dimensions.
SOMToolboxException
protected flanagan.interpolation.BiCubicSplineFast computeSpline(GrowingSOM gsom, cern.colt.matrix.DoubleMatrix2D matrix, int width, int height, int unitWidth, int unitHeight)
protected int constrainWithinPalette(int ci)
public Color[] getPalette()
MatrixVisualizer
getPalette
in interface MatrixVisualizer
public void setPalette(Palette newPalette)
MatrixVisualizer
setPalette
in interface MatrixVisualizer
newPalette
- the new palettepublic void reversePalette()
MatrixVisualizer
reversePalette
in interface MatrixVisualizer
public Palette getCurrentPalette()
MatrixVisualizer
Palette
this visualisation currently is set to.
getCurrentPalette
in interface MatrixVisualizer
public String getPreferredPaletteName()
Palettes.getDefaultPalette()
. Subclasses that want to use a different
palette should overwrite this method.
getPreferredPaletteName
in interface MatrixVisualizer
public void invalidateCache(Palette palette)
Palette
with the given index.
protected cern.colt.matrix.DoubleMatrix2D computeHitHistogram(GrowingSOM gsom) throws LayerAccessException
GrowingSOM
. Also sets the values of
minimumMatrixValue
and maximumMatrixValue
LayerAccessException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |