Class Grow
Object
org.anchoranalysis.bean.AnchorBean<BoxAligner>
org.anchoranalysis.image.bean.spatial.arrange.align.BoxAligner
org.anchoranalysis.image.bean.spatial.arrange.align.Grow
public class Grow extends BoxAligner
Grow the bounding-box to fill
larger as much as possible.
Depending on preserveAspectRatio, the aspect-ratio of smaller is preserved or
not.
When preserveAspectRatio==false, the smaller bounding-box is guaranteed to become
identical to the larger.
Growth never occurs in the z-dimension, and the size in this dimension should be equal for
both smaller and larger.
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description protected org.anchoranalysis.spatial.box.BoundingBoxalignAfterCheck(org.anchoranalysis.spatial.box.BoundingBox smaller, org.anchoranalysis.spatial.box.BoundingBox larger)Determines aBoundingBoxto use forsmallerBoundingBoxso that it fits insidelargerBoundingBox.protected org.anchoranalysis.spatial.box.BoundingBoxalignAfterCheck(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.BoundingBox larger)Determines aBoundingBoxto use forsmallerExtentso that it fits insidelargerBoundingBox.protected org.anchoranalysis.spatial.box.BoundingBoxalignAfterCheck(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.Extent larger)Determines aBoundingBoxto use forsmallerExtentso that it fits insidelargerExtent.AligngetAlign()How to align the box after it is grown, as much as possible.booleanisPreserveAspectRatio()Whether to preserve the aspect-ratio of the smaller image when growing.voidsetAlign(Align align)How to align the box after it is grown, as much as possible.voidsetPreserveAspectRatio(boolean preserveAspectRatio)Whether to preserve the aspect-ratio of the smaller image when growing.Methods inherited from class org.anchoranalysis.image.bean.spatial.arrange.align.BoxAligner
align, align, alignMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
Method Details
-
alignAfterCheck
protected org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck(org.anchoranalysis.spatial.box.BoundingBox smaller, org.anchoranalysis.spatial.box.BoundingBox larger) throws OperationFailedExceptionDescription copied from class:BoxAlignerDetermines aBoundingBoxto use forsmallerBoundingBoxso that it fits insidelargerBoundingBox.- Specified by:
alignAfterCheckin classBoxAligner- Parameters:
smaller- the smaller bounding-box, relative to the minimum-corner oflarger. Often this is(0, 0, 0)if it sits at the minimum corner oflarger.larger- the larger bounding-box absolute coordinates.- Returns:
- absolute coordinates for
smaller, while remaining insidelarger. - Throws:
OperationFailedException- if an unrecognized parameter or illegal state exists preventing successful alignment.
-
alignAfterCheck
protected org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.Extent larger) throws OperationFailedExceptionDescription copied from class:BoxAlignerDetermines aBoundingBoxto use forsmallerExtentso that it fits insidelargerExtent.- Specified by:
alignAfterCheckin classBoxAligner- Parameters:
smaller- the smaller bounding-box, relative to the minimum-corner oflarger. Often this is(0, 0, 0)if it sits at the minimum corner oflarger.larger- the larger bounding-box absolute coordinates.- Returns:
- absolute coordinates for
smaller, while remaining insidelarger. - Throws:
OperationFailedException- if an unrecognized parameter or illegal state exists preventing successful alignment.
-
alignAfterCheck
protected org.anchoranalysis.spatial.box.BoundingBox alignAfterCheck(org.anchoranalysis.spatial.box.Extent smaller, org.anchoranalysis.spatial.box.BoundingBox larger) throws OperationFailedExceptionDescription copied from class:BoxAlignerDetermines aBoundingBoxto use forsmallerExtentso that it fits insidelargerBoundingBox.- Specified by:
alignAfterCheckin classBoxAligner- Parameters:
smaller- the smaller bounding-box, relative to the minimum-corner oflarger. Often this is(0, 0, 0)if it sits at the minimum corner oflarger.larger- the larger bounding-box absolute coordinates.- Returns:
- absolute coordinates for
smaller, while remaining insidelarger. - Throws:
OperationFailedException- if an unrecognized parameter or illegal state exists preventing successful alignment.
-
isPreserveAspectRatio
public boolean isPreserveAspectRatio()Whether to preserve the aspect-ratio of the smaller image when growing. -
setPreserveAspectRatio
public void setPreserveAspectRatio(boolean preserveAspectRatio)Whether to preserve the aspect-ratio of the smaller image when growing. -
getAlign
How to align the box after it is grown, as much as possible. -
setAlign
How to align the box after it is grown, as much as possible.
-