Class 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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract double
resolve
(Optional<UnitConverter> unitConverter, DirectionVector direction) Resolves the distance using aDirectionVector
.double
resolve
(Optional<UnitConverter> unitConverter, Point3d point1, Point3d point2) Resolves the distance using the direction between two points of typePoint3d
.double
resolve
(Optional<UnitConverter> unitConverter, Point3i point1, Point3i point2) Resolves the distance using the direction between two points of typePoint3i
.double
resolveForAxis
(Optional<UnitConverter> unitConverter, 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, Point3d point1, Point3d point2) throws OperationFailedException Resolves 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 aPoint3i
equivalent.- 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, Point3i point1, Point3i point2) throws OperationFailedException Resolves 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 aPoint3d
equivalent.- 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, DirectionVector direction) throws OperationFailedException Resolves 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, Axis axis) throws OperationFailedException Resolves 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.
-