Class UnitValueDistance
Object
org.anchoranalysis.bean.AnchorBean<UnitValueDistance>
org.anchoranalysis.image.bean.unitvalue.distance.UnitValueDistance
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
DistancePhysical,DistanceVoxels
public abstract class UnitValueDistance extends AnchorBean<UnitValueDistance> implements Serializable
Base class for methods to specify a distance along a vector in an image.
- Author:
- Owen Feehan
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description UnitValueDistance() -
Method Summary
Modifier and Type Method Description abstract doubleresolve(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.orientation.DirectionVector direction)Resolves the distance using aDirectionVector.doubleresolve(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.point.Point3d point1, org.anchoranalysis.spatial.point.Point3d point2)Resolves the distance using the direction between two points of typePoint3d.doubleresolve(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.point.Point3i point1, org.anchoranalysis.spatial.point.Point3i point2)Resolves the distance using the direction between two points of typePoint3i.doubleresolveForAxis(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.axis.Axis axis)Resolves the distance in a direction aligned to a particular axis.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
UnitValueDistance
public UnitValueDistance()
-
-
Method Details
-
resolve
public double resolve(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.point.Point3d point1, org.anchoranalysis.spatial.point.Point3d point2) throws OperationFailedExceptionResolves the distance using the direction between two points of typePoint3d.The magnitude of the distance between the two points is ignored, only the direction.
See
resolve(Optional, Point3i, Point3i)for aPoint3iequivalent.- Parameters:
unitConverter- converts to/from voxels to physical units.point1- the first point for the direction.point2- the second point for the direction.- Returns:
- the distance in units of voxels.
- Throws:
OperationFailedException- if the resolution cannot successfully complete.
-
resolve
public double resolve(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.point.Point3i point1, org.anchoranalysis.spatial.point.Point3i point2) throws OperationFailedExceptionResolves the distance using the direction between two points of typePoint3i.The magnitude of the distance between the two points is ignored, only the direction.
See
resolve(Optional, Point3d, Point3d)for aPoint3dequivalent.- Parameters:
unitConverter- converts to/from voxels to physical units.point1- the first point for the direction.point2- the second point for the direction.- Returns:
- the distance in units of voxels.
- Throws:
OperationFailedException- if the resolution cannot successfully complete.
-
resolve
public abstract double resolve(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.orientation.DirectionVector direction) throws OperationFailedExceptionResolves the distance using aDirectionVector.The magnitude of the vector is ignored, using only the direction.
- Parameters:
unitConverter- converts to/from voxels to physical units.direction- the direction-vector.- Returns:
- the distance in units of voxels.
- Throws:
OperationFailedException- if the resolution cannot successfully complete.
-
resolveForAxis
public double resolveForAxis(Optional<UnitConverter> unitConverter, org.anchoranalysis.spatial.axis.Axis axis) throws OperationFailedExceptionResolves the distance in a direction aligned to a particular axis.- Parameters:
unitConverter- converts to/from voxels to physical units.axis- axis to indicate direction.- Returns:
- the distance in the direction of the axis in units of voxels.
- Throws:
OperationFailedException- if the resolution cannot successfully complete.
-