Package adams.data.conversion
Class HeatmapToBufferedImageWithKey
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.conversion.AbstractConversion
-
- adams.data.conversion.HeatmapToBufferedImageWithKey
-
- All Implemented Interfaces:
adams.core.AdditionalInformationHandler,adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.QuickInfoSupporter,adams.core.ShallowCopySupporter<adams.data.conversion.AbstractConversion>,adams.core.SizeOfHandler,adams.core.Stoppable,adams.data.conversion.Conversion,HeatmapToBufferedImageConversion,Serializable
public class HeatmapToBufferedImageWithKey extends adams.data.conversion.AbstractConversion implements HeatmapToBufferedImageConversion
Turns a heatmap into a BufferedImage, allows the generation of a key in the image.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-generator <adams.gui.visualization.core.ColorGradientGenerator> (property: generator) The generator to use for creating the gradient colors. default: adams.gui.visualization.core.BiColorGenerator
-use-custom-range <boolean> (property: useCustomRange) Whether to use a custom user defined range rather than the range from the incoming heatmap default: false
-min-range <double> (property: minRange) the minimum value of the heatmap colour range default: -1.0
-max-range <double> (property: maxRange) the maximum value to use in the colour range default: 100.0
-show-key <boolean> (property: showKey) Whether to display a key displaying the values corresponding to certain colours on the heatmap default: false
-scale-factor <int> (property: scaleFactor) scale factor with which to increase the size of the heatmap image default: 1
-missing-color <java.awt.Color> (property: missingColor) The color to use if a value in the heatmap is missing default: #ffffff
- Author:
- michael.fowke
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.gui.visualization.core.ColorGradientGeneratorm_GeneratorThe generator to useprotected Color[]m_GradientColorsthe gradient colorsprotected doublem_MaxRangeMaximum value of the rangeprotected doublem_MinRangeMinimum value of the rangeprotected Colorm_MissingColorcolour to use to display a missing valueprotected intm_ScaleFactorscale factor to enlarge the heatmapprotected booleanm_ShowKeyWhether to display the colour key on the heatmapprotected booleanm_UseCustomRangeWhether to use a use defined range
-
Constructor Summary
Constructors Constructor Description HeatmapToBufferedImageWithKey()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Classaccepts()voiddefineOptions()Adds options to the internal list of options.protected ObjectdoConvert()Performs the actual conversion.Classgenerates()StringgeneratorTipText()Returns the tip text for this property.adams.gui.visualization.core.ColorGradientGeneratorgetGenerator()Returns the number of gradient colors to use.protected Color[]getGradientColors()Generates the gradient colors.doublegetMaxRange()Get the maximum value in the user defined rangedoublegetMinRange()Get the mimum value in the user defined rangeColorgetMissingColor()Get the colour to use for a missing valueintgetScaleFactor()Get the scale factor to enlarge the heatmap bybooleangetShowKey()Get whether to display the colour key with the heatmapbooleangetUseCustomRange()Set whether to use a custom rangeStringglobalInfo()Returns a string describing the object.doublegrayToIntensity(Heatmap map, int gray)Turns the gray value back into an intensity value.StringmaxRangeTipText()Tip text for this propertyStringminRangeTipText()Tip text for this propertyStringmissingColorTipText()Tip text for this propertyprotected voidreset()Resets the object.StringscaleFactorTipText()Tip text for this propertyvoidsetGenerator(adams.gui.visualization.core.ColorGradientGenerator value)Sets the number of gradient colors to use.voidsetMaxRange(double value)Set the maximum value in the user defined rangevoidsetMinRange(double value)Set the minimum value in the user defined rangevoidsetMissingColor(Color val)Set the colour to use for a missing valuevoidsetScaleFactor(int val)Set the scale factor to enlarge the heatmap byvoidsetShowKey(boolean value)Set whether to display the colour key with the heatmapvoidsetUseCustomRange(boolean value)Set whether to use a custom rangeStringshowKeyTipText()Tip text for this propertyStringuseCustomRangeTipText()Tip text for this property-
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, getQuickInfo, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
m_Generator
protected adams.gui.visualization.core.ColorGradientGenerator m_Generator
The generator to use
-
m_UseCustomRange
protected boolean m_UseCustomRange
Whether to use a use defined range
-
m_MinRange
protected double m_MinRange
Minimum value of the range
-
m_MaxRange
protected double m_MaxRange
Maximum value of the range
-
m_ShowKey
protected boolean m_ShowKey
Whether to display the colour key on the heatmap
-
m_ScaleFactor
protected int m_ScaleFactor
scale factor to enlarge the heatmap
-
m_MissingColor
protected Color m_MissingColor
colour to use to display a missing value
-
m_GradientColors
protected Color[] m_GradientColors
the gradient colors
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the object.- Overrides:
resetin classadams.data.conversion.AbstractConversion
-
setGenerator
public void setGenerator(adams.gui.visualization.core.ColorGradientGenerator value)
Sets the number of gradient colors to use.- Parameters:
value- the number of colors
-
getGenerator
public adams.gui.visualization.core.ColorGradientGenerator getGenerator()
Returns the number of gradient colors to use.- Returns:
- the number of colors
-
generatorTipText
public String generatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUseCustomRange
public void setUseCustomRange(boolean value)
Set whether to use a custom range- Parameters:
value- Whether to use a user defined range
-
getUseCustomRange
public boolean getUseCustomRange()
Set whether to use a custom range- Returns:
- Whether to use a user defined range
-
useCustomRangeTipText
public String useCustomRangeTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
setMinRange
public void setMinRange(double value)
Set the minimum value in the user defined range- Parameters:
value- Minimum value
-
getMinRange
public double getMinRange()
Get the mimum value in the user defined range- Returns:
- Minimum value
-
minRangeTipText
public String minRangeTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
setMaxRange
public void setMaxRange(double value)
Set the maximum value in the user defined range- Parameters:
value- maximum value
-
getMaxRange
public double getMaxRange()
Get the maximum value in the user defined range- Returns:
- The maximum value
-
maxRangeTipText
public String maxRangeTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
setShowKey
public void setShowKey(boolean value)
Set whether to display the colour key with the heatmap- Parameters:
value- Whether to display key
-
getShowKey
public boolean getShowKey()
Get whether to display the colour key with the heatmap- Returns:
- Whether to display the key
-
showKeyTipText
public String showKeyTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
setScaleFactor
public void setScaleFactor(int val)
Set the scale factor to enlarge the heatmap by- Parameters:
val- Scale factor
-
getScaleFactor
public int getScaleFactor()
Get the scale factor to enlarge the heatmap by- Returns:
- Scale factor
-
scaleFactorTipText
public String scaleFactorTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
setMissingColor
public void setMissingColor(Color val)
Set the colour to use for a missing value- Parameters:
val- Colour for representing a missing value
-
getMissingColor
public Color getMissingColor()
Get the colour to use for a missing value- Returns:
- Colour for representing a missing value
-
missingColorTipText
public String missingColorTipText()
Tip text for this property- Returns:
- Description for displaying in the GUI
-
accepts
public Class accepts()
- Specified by:
acceptsin interfaceadams.data.conversion.Conversion- Specified by:
acceptsin classadams.data.conversion.AbstractConversion
-
generates
public Class generates()
- Specified by:
generatesin interfaceadams.data.conversion.Conversion- Specified by:
generatesin classadams.data.conversion.AbstractConversion
-
getGradientColors
protected Color[] getGradientColors()
Generates the gradient colors.- Returns:
- the colors
-
doConvert
protected Object doConvert() throws Exception
Performs the actual conversion.- Specified by:
doConvertin classadams.data.conversion.AbstractConversion- Returns:
- the converted object
- Throws:
Exception- if conversion fails
-
grayToIntensity
public double grayToIntensity(Heatmap map, int gray)
Turns the gray value back into an intensity value.- Specified by:
grayToIntensityin interfaceHeatmapToBufferedImageConversion- Parameters:
map- the map that got convertedgray- the gray value (0-255)- Returns:
- the generated intensity value
-
-