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.ColorGradientGenerator
m_Generator
The generator to useprotected Color[]
m_GradientColors
the gradient colorsprotected double
m_MaxRange
Maximum value of the rangeprotected double
m_MinRange
Minimum value of the rangeprotected Color
m_MissingColor
colour to use to display a missing valueprotected int
m_ScaleFactor
scale factor to enlarge the heatmapprotected boolean
m_ShowKey
Whether to display the colour key on the heatmapprotected boolean
m_UseCustomRange
Whether 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 Class
accepts()
void
defineOptions()
Adds options to the internal list of options.protected Object
doConvert()
Performs the actual conversion.Class
generates()
String
generatorTipText()
Returns the tip text for this property.adams.gui.visualization.core.ColorGradientGenerator
getGenerator()
Returns the number of gradient colors to use.protected Color[]
getGradientColors()
Generates the gradient colors.double
getMaxRange()
Get the maximum value in the user defined rangedouble
getMinRange()
Get the mimum value in the user defined rangeColor
getMissingColor()
Get the colour to use for a missing valueint
getScaleFactor()
Get the scale factor to enlarge the heatmap byboolean
getShowKey()
Get whether to display the colour key with the heatmapboolean
getUseCustomRange()
Set whether to use a custom rangeString
globalInfo()
Returns a string describing the object.double
grayToIntensity(Heatmap map, int gray)
Turns the gray value back into an intensity value.String
maxRangeTipText()
Tip text for this propertyString
minRangeTipText()
Tip text for this propertyString
missingColorTipText()
Tip text for this propertyprotected void
reset()
Resets the object.String
scaleFactorTipText()
Tip text for this propertyvoid
setGenerator(adams.gui.visualization.core.ColorGradientGenerator value)
Sets the number of gradient colors to use.void
setMaxRange(double value)
Set the maximum value in the user defined rangevoid
setMinRange(double value)
Set the minimum value in the user defined rangevoid
setMissingColor(Color val)
Set the colour to use for a missing valuevoid
setScaleFactor(int val)
Set the scale factor to enlarge the heatmap byvoid
setShowKey(boolean value)
Set whether to display the colour key with the heatmapvoid
setUseCustomRange(boolean value)
Set whether to use a custom rangeString
showKeyTipText()
Tip text for this propertyString
useCustomRangeTipText()
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:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in 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:
defineOptions
in interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.core.option.AbstractOptionHandler
-
reset
protected void reset()
Resets the object.- Overrides:
reset
in 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:
accepts
in interfaceadams.data.conversion.Conversion
- Specified by:
accepts
in classadams.data.conversion.AbstractConversion
-
generates
public Class generates()
- Specified by:
generates
in interfaceadams.data.conversion.Conversion
- Specified by:
generates
in 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:
doConvert
in 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:
grayToIntensity
in interfaceHeatmapToBufferedImageConversion
- Parameters:
map
- the map that got convertedgray
- the gray value (0-255)- Returns:
- the generated intensity value
-
-