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 intm_NumColsthe number of columns to use.protected intm_NumRowsthe number of rows to use.protected intm_OverlapXthe overlap on the x axis.protected intm_OverlapYthe overlap on the y axis.protected Stringm_Prefixthe 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 intcalcOffset(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.voiddefineOptions()Adds options to the internal list of options.protected DimensiondetermineDimensions(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.intgetNumCols()Returns the number of columns in the grid.intgetNumRows()Returns the number of rows in the grid.intgetOverlapX()Returns the overlap on the x axis.intgetOverlapY()Returns the overlap on the y axis.StringgetPrefix()Returns the field prefix used in the report.StringglobalInfo()Returns a string describing the object.intmaxNumImagesRequired()Returns the maximum number of images that are required for the operation.intminNumImagesRequired()Returns the minimum number of images that are required for the operation.StringnumColsTipText()Returns the tip text for this property.StringnumRowsTipText()Returns the tip text for this property.StringoverlapXTipText()Returns the tip text for this property.StringoverlapYTipText()Returns the tip text for this property.StringprefixTipText()Returns the tip text for this property.voidsetNumCols(int value)Sets the number of columns in the grid.voidsetNumRows(int value)Sets the number of rows in the grid.voidsetOverlapX(int value)Sets the overlap on the x axis.voidsetOverlapY(int value)Sets the overlap on the y axis.voidsetPrefix(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
getClassCrossReferences
public Class[] getClassCrossReferences()
Returns the cross-referenced classes.- Specified by:
getClassCrossReferencesin interfaceClassCrossReference- Returns:
- the classes
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setPrefix
public void setPrefix(String value)
Sets the field prefix used in the report.- Specified by:
setPrefixin interfaceObjectPrefixHandler- Parameters:
value- the field prefix
-
getPrefix
public String getPrefix()
Returns the field prefix used in the report.- Specified by:
getPrefixin interfaceObjectPrefixHandler- Returns:
- the field prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipTextin 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:
minNumImagesRequiredin 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:
maxNumImagesRequiredin 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:
doProcessin classAbstractMultiImageOperation<BufferedImageContainer>- Parameters:
images- the images to process- Returns:
- the generated image(s)
-
-