Class MergeGrid
-
- All Implemented Interfaces:
ClassCrossReference
,CrossReference
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,ObjectPrefixHandler
,Serializable
public class MergeGrid extends AbstractBufferedImageMultiImageOperation implements ClassCrossReference, ObjectPrefixHandler
Merges a grid of sub-images into a single image, including the annotations.
Opposite operation to adams.data.image.transformer.subimages.Grid.
Expects the image array to represent the cells in the grid in a row-wise fashion.
Only combines object annotations from reports, other field values will be discarded.
Does not remove overlapping objects, see adams.flow.transformer.DeleteOverlappingImageObjects.
See also:
adams.data.image.transformer.subimages.Grid
adams.flow.transformer.DeleteOverlappingImageObjects
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-prefix <java.lang.String> (property: prefix) The report field prefix used in the report. default: Object.
-num-cols <int> (property: numCols) The number of columns. default: 1 minimum: 1
-num-rows <int> (property: numRows) The number of rows. default: 1 minimum: 1
-overlap-x <int> (property: overlapX) The overlap on the x axis. default: 0 minimum: 0
-overlap-y <int> (property: overlapY) The overlap on the y axis. default: 0 minimum: 0
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_NumCols
the number of columns to use.protected int
m_NumRows
the number of rows to use.protected int
m_OverlapX
the overlap on the x axis.protected int
m_OverlapY
the overlap on the y axis.protected String
m_Prefix
the prefix to use when generating a report.-
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 MergeGrid()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
calcOffset(BufferedImageContainer[] images, int index, boolean calcX)
Calculates the X or Y offset for the specified image from the array for insertion in the new image.void
defineOptions()
Adds options to the internal list of options.protected Dimension
determineDimensions(BufferedImageContainer[] images)
Determines the dimensions of the combined images.protected BufferedImageContainer[]
doProcess(BufferedImageContainer[] images)
Performs the actual processing of the images.Class[]
getClassCrossReferences()
Returns the cross-referenced classes.int
getNumCols()
Returns the number of columns in the grid.int
getNumRows()
Returns the number of rows in the grid.int
getOverlapX()
Returns the overlap on the x axis.int
getOverlapY()
Returns the overlap on the y axis.String
getPrefix()
Returns the field prefix used in the report.String
globalInfo()
Returns a string describing the object.int
maxNumImagesRequired()
Returns the maximum number of images that are required for the operation.int
minNumImagesRequired()
Returns the minimum number of images that are required for the operation.String
numColsTipText()
Returns the tip text for this property.String
numRowsTipText()
Returns the tip text for this property.String
overlapXTipText()
Returns the tip text for this property.String
overlapYTipText()
Returns the tip text for this property.String
prefixTipText()
Returns the tip text for this property.void
setNumCols(int value)
Sets the number of columns in the grid.void
setNumRows(int value)
Sets the number of rows in the grid.void
setOverlapX(int value)
Sets the overlap on the x axis.void
setOverlapY(int value)
Sets the overlap on the y axis.void
setPrefix(String value)
Sets the field prefix used in the report.-
Methods inherited from class adams.data.image.AbstractMultiImageOperation
check, checkSameDimensions, checkSameDimensions, process
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, 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
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Prefix
protected String m_Prefix
the prefix to use when generating a report.
-
m_NumCols
protected int m_NumCols
the number of columns to use.
-
m_NumRows
protected int m_NumRows
the number of rows to use.
-
m_OverlapX
protected int m_OverlapX
the overlap on the x axis.
-
m_OverlapY
protected int m_OverlapY
the overlap on the y axis.
-
-
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
-
getClassCrossReferences
public Class[] getClassCrossReferences()
Returns the cross-referenced classes.- Specified by:
getClassCrossReferences
in interfaceClassCrossReference
- Returns:
- the classes
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefix
in interfaceObjectPrefixHandler
- Parameters:
value
- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefix
in interfaceObjectPrefixHandler
- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipText
in interfaceObjectPrefixHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumCols
public void setNumCols(int value)
Sets the number of columns in the grid.- Parameters:
value
- the number of columns
-
getNumCols
public int getNumCols()
Returns the number of columns in the grid.- Returns:
- the number of columns
-
numColsTipText
public String numColsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setNumRows
public void setNumRows(int value)
Sets the number of rows in the grid.- Parameters:
value
- the number of rows
-
getNumRows
public int getNumRows()
Returns the number of rows in the grid.- Returns:
- the number of rows
-
numRowsTipText
public String numRowsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setOverlapX
public void setOverlapX(int value)
Sets the overlap on the x axis.- Parameters:
value
- the overlap
-
getOverlapX
public int getOverlapX()
Returns the overlap on the x axis.- Returns:
- the overlap
-
overlapXTipText
public String overlapXTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setOverlapY
public void setOverlapY(int value)
Sets the overlap on the y axis.- Parameters:
value
- the overlap
-
getOverlapY
public int getOverlapY()
Returns the overlap on the y axis.- Returns:
- the overlap
-
overlapYTipText
public String overlapYTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
minNumImagesRequired
public int minNumImagesRequired()
Returns the minimum number of images that are required for the operation.- Specified by:
minNumImagesRequired
in classAbstractMultiImageOperation<BufferedImageContainer>
- Returns:
- the number of images that are required, <= 0 means no lower limit
-
maxNumImagesRequired
public int maxNumImagesRequired()
Returns the maximum number of images that are required for the operation.- Specified by:
maxNumImagesRequired
in classAbstractMultiImageOperation<BufferedImageContainer>
- Returns:
- the number of images that are required, <= 0 means no upper limit
-
determineDimensions
protected Dimension determineDimensions(BufferedImageContainer[] images)
Determines the dimensions of the combined images.- Parameters:
images
- the images making up the grid- Returns:
- the combined dimensions
-
calcOffset
protected int calcOffset(BufferedImageContainer[] images, int index, boolean calcX)
Calculates the X or Y offset for the specified image from the array for insertion in the new image.- Parameters:
images
- the array images to useindex
- the index in the array to calculate the offset forcalcX
- whether to calculate the X or Y offset- Returns:
- the offset
-
doProcess
protected BufferedImageContainer[] doProcess(BufferedImageContainer[] images)
Performs the actual processing of the images.- Specified by:
doProcess
in classAbstractMultiImageOperation<BufferedImageContainer>
- Parameters:
images
- the images to process- Returns:
- the generated image(s)
-
-