Class BoxAligner

Object
org.anchoranalysis.bean.AnchorBean<BoxAligner>
org.anchoranalysis.image.bean.spatial.arrange.align.BoxAligner
Direct Known Subclasses:
Align, Grow

public abstract class BoxAligner
extends AnchorBean<BoxAligner>
Aligns a smaller BoundingBox to fit inside a larger BoundingBox.

The smaller box may also be identically sized as the larger.

This is useful for implementing different methods for aligning / growing a smaller image to occupy a larger space. But it is not specific to images, and can be applied to any bounding-boxes.

Growth never occurs in the z-dimension, and the size in this dimension should be equal for both smaller and larger.

Author:
Owen Feehan
  • Constructor Summary

    Constructors 
    Constructor Description
    BoxAligner()  
  • Method Summary

    Modifier and Type Method Description
    org.anchoranalysis.spatial.box.BoundingBox align​(org.anchoranalysis.spatial.box.BoundingBox smaller, org.anchoranalysis.spatial.box.BoundingBox larger)
    Determines a BoundingBox to use for smaller BoundingBox so that it fits inside larger BoundingBox.
    org.anchoranalysis.spatial.box.BoundingBox align​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.BoundingBox larger)
    Determines a BoundingBox to use for a smaller Extent so that it fits inside larger BoundingBox.
    org.anchoranalysis.spatial.box.BoundingBox align​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.Extent larger)
    Determines a BoundingBox to use for a smaller Extent so that it fits inside larger Extent.
    protected abstract org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck​(org.anchoranalysis.spatial.box.BoundingBox smaller, org.anchoranalysis.spatial.box.BoundingBox larger)
    Determines a BoundingBox to use for smaller BoundingBox so that it fits inside larger BoundingBox.
    protected abstract org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.BoundingBox larger)
    Determines a BoundingBox to use for smaller Extent so that it fits inside larger BoundingBox.
    protected abstract org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.Extent larger)
    Determines a BoundingBox to use for smaller Extent so that it fits inside larger Extent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • align

      public org.anchoranalysis.spatial.box.BoundingBox align​(org.anchoranalysis.spatial.box.BoundingBox smaller, org.anchoranalysis.spatial.box.BoundingBox larger) throws OperationFailedException
      Determines a BoundingBox to use for smaller BoundingBox so that it fits inside larger BoundingBox.

      The position and size of smaller and larger must be identical in the z-dimension.

      Parameters:
      smaller - the smaller bounding-box, relative to the minimum-corner of larger. Often this is (0, 0, 0) if it sits at the minimum corner of larger.
      larger - the larger bounding-box absolute coordinates.
      Returns:
      absolute coordinates for smaller, while remaining inside larger.
      Throws:
      OperationFailedException - if the z-dimensions are not equal, or if an unrecognized parameter or illegal state exists preventing successful alignment.
    • align

      public org.anchoranalysis.spatial.box.BoundingBox align​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.Extent larger) throws OperationFailedException
      Determines a BoundingBox to use for a smaller Extent so that it fits inside larger Extent.

      The position and size of smaller and larger must be identical in the z-dimension.

      Parameters:
      smaller - the smaller bounding-box, relative to the minimum-corner of larger. Often this is (0, 0, 0) if it sits at the minimum corner of larger.
      larger - the larger bounding-box absolute coordinates.
      Returns:
      absolute coordinates for smaller, while remaining inside larger.
      Throws:
      OperationFailedException - if the z-dimensions are not equal, or if an unrecognized parameter or illegal state exists preventing successful alignment.
    • align

      public org.anchoranalysis.spatial.box.BoundingBox align​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.BoundingBox larger) throws OperationFailedException
      Determines a BoundingBox to use for a smaller Extent so that it fits inside larger BoundingBox.

      The position and size of smaller and larger must be identical in the z-dimension.

      Parameters:
      smaller - the smaller bounding-box, relative to the minimum-corner of larger. Often this is (0, 0, 0) if it sits at the minimum corner of larger.
      larger - the larger bounding-box absolute coordinates.
      Returns:
      absolute coordinates for smaller, while remaining inside larger.
      Throws:
      OperationFailedException - if the z-dimensions are not equal, or if an unrecognized parameter or illegal state exists preventing successful alignment.
    • alignAfterCheck

      protected abstract org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck​(org.anchoranalysis.spatial.box.BoundingBox smaller, org.anchoranalysis.spatial.box.BoundingBox larger) throws OperationFailedException
      Determines a BoundingBox to use for smaller BoundingBox so that it fits inside larger BoundingBox.
      Parameters:
      smaller - the smaller bounding-box, relative to the minimum-corner of larger. Often this is (0, 0, 0) if it sits at the minimum corner of larger.
      larger - the larger bounding-box absolute coordinates.
      Returns:
      absolute coordinates for smaller, while remaining inside larger.
      Throws:
      OperationFailedException - if an unrecognized parameter or illegal state exists preventing successful alignment.
    • alignAfterCheck

      protected abstract org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.Extent larger) throws OperationFailedException
      Determines a BoundingBox to use for smaller Extent so that it fits inside larger Extent.
      Parameters:
      smaller - the smaller bounding-box, relative to the minimum-corner of larger. Often this is (0, 0, 0) if it sits at the minimum corner of larger.
      larger - the larger bounding-box absolute coordinates.
      Returns:
      absolute coordinates for smaller, while remaining inside larger.
      Throws:
      OperationFailedException - if an unrecognized parameter or illegal state exists preventing successful alignment.
    • alignAfterCheck

      protected abstract org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck​(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.BoundingBox larger) throws OperationFailedException
      Determines a BoundingBox to use for smaller Extent so that it fits inside larger BoundingBox.
      Parameters:
      smaller - the smaller bounding-box, relative to the minimum-corner of larger. Often this is (0, 0, 0) if it sits at the minimum corner of larger.
      larger - the larger bounding-box absolute coordinates.
      Returns:
      absolute coordinates for smaller, while remaining inside larger.
      Throws:
      OperationFailedException - if an unrecognized parameter or illegal state exists preventing successful alignment.