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 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.
    • Constructor Detail

      • MergeGrid

        public MergeGrid()
    • Method Detail

      • setPrefix

        public void setPrefix​(String value)
        Sets the field prefix used in the report.
        Specified by:
        setPrefix in interface ObjectPrefixHandler
        Parameters:
        value - the field prefix
      • prefixTipText

        public String prefixTipText()
        Returns the tip text for this property.
        Specified by:
        prefixTipText in interface ObjectPrefixHandler
        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
      • 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 use
        index - the index in the array to calculate the offset for
        calcX - whether to calculate the X or Y offset
        Returns:
        the offset