Package adams.data.image.transformer
Class SuppliedImageMask
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ImageTransformer<BufferedImageContainer>
,FlowContextHandler
,Serializable
,Comparable
public class SuppliedImageMask extends AbstractBufferedImageTransformer
Masks out regions on the image using a supplied image from internal storage, making them transparent.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-mask <adams.flow.control.StorageName> (property: mask) The name of the storage name (image) to use as mask. default: storage
-down <boolean> (property: down) If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent). default: true
-threshold <int> (property: threshold) Threshold value used for binarization, specify -1 to automatically determine a threshold. default: 127 minimum: -1 maximum: 255
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Down
If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent).protected StorageName
m_Mask
the image in internal storage.protected int[][]
m_MaskMatrix
the mask image.protected int
m_Threshold
Threshold value used for binarization, specify -1 to automatically determine a threshold.-
Fields inherited from class adams.data.image.AbstractImageTransformer
m_FlowContext
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description SuppliedImageMask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected BufferedImageContainer[]
doTransform(BufferedImageContainer container)
Masks the image.String
downTipText()
Returns the tip text for this property.boolean
getDown()
Get whether mask is applied below or above the threshold.StorageName
getMask()
Gets the storage name of the mask image.int
getThreshold()
Get the manual threshold value.String
globalInfo()
Returns a string describing the object.protected void
initMask()
Initializes the mask if necessary.String
maskTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
setDown(boolean value)
Set whether mask is applied below or above the threshold.void
setMask(StorageName value)
Sets storage name of the mask image.void
setThreshold(int value)
Set the manual threshold value.String
thresholdTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.image.transformer.AbstractBufferedImageTransformer
forCommandLine, forName, getTransformations
-
Methods inherited from class adams.data.image.AbstractImageTransformer
checkImage, cleanUp, compareTo, destroy, equals, getFlowContext, getQuickInfo, initialize, setFlowContext, shallowCopy, shallowCopy, transform
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_Mask
protected StorageName m_Mask
the image in internal storage.
-
m_Down
protected boolean m_Down
If true, then pixels <= threshold are not masked and the others' alpha channel are set to 0 (made transparent).
-
m_Threshold
protected int m_Threshold
Threshold value used for binarization, specify -1 to automatically determine a threshold.
-
m_MaskMatrix
protected int[][] m_MaskMatrix
the mask image.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- 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 interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
getMask
public StorageName getMask()
Gets the storage name of the mask image.- Returns:
- the storage name
-
setMask
public void setMask(StorageName value)
Sets storage name of the mask image.- Parameters:
value
- the storage name
-
maskTipText
public String maskTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDown
public boolean getDown()
Get whether mask is applied below or above the threshold.- Returns:
- threshold direction
-
setDown
public void setDown(boolean value)
Set whether mask is applied below or above the threshold.- Parameters:
value
- threshold direction
-
downTipText
public String downTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getThreshold
public int getThreshold()
Get the manual threshold value.- Returns:
- manual threshold value
-
setThreshold
public void setThreshold(int value)
Set the manual threshold value.- Parameters:
value
- manual threshold value
-
thresholdTipText
public String thresholdTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
initMask
protected void initMask()
Initializes the mask if necessary.
-
doTransform
protected BufferedImageContainer[] doTransform(BufferedImageContainer container)
Masks the image.- Specified by:
doTransform
in classAbstractImageTransformer<BufferedImageContainer>
- Parameters:
container
- the image to be processed- Returns:
- the masked image
-
-