Package sc.fiji.snt
Class NearPoint
java.lang.Object
sc.fiji.snt.NearPoint
- All Implemented Interfaces:
Comparable<NearPoint>
This class encapsulates the relationship between an arbitrary point
(nearPoint.x,nearPoint.y,nearPoint.z) close to a particular point on a
particular path. The important method here is
distanceToPathNearPoint() which retrieves the distance to the nearest
point on the line segments on either side of the path point, rather than
just the point. Also, it will return null if the point appears to be "off the
end" of the Path.- Author:
- Mark Longair, Tiago Ferreira
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected sc.fiji.snt.NearPoint.IntersectionOnLinefinal intThe index of this point within its associated pathprotected PointInImage -
Constructor Summary
ConstructorsModifierConstructorDescriptionNearPoint(PointInImage nearPoint, Path path, int indexInPath) protectedNearPoint(PointInImage nearPoint, Path path, int indexInPath, boolean unScaledPositions) -
Method Summary
Modifier and TypeMethodDescriptionintstatic sc.fiji.snt.NearPoint.IntersectionOnLinedistanceFromPointToLine(double ax, double ay, double az, double vx, double vy, double vz, double x, double y, double z) protected static sc.fiji.snt.NearPoint.IntersectionOnLinedistanceFromSinglePointPath(double pathX, double pathY, double pathZ, double nearPointX, double nearPointY, double nearPointZ) static sc.fiji.snt.NearPoint.IntersectionOnLinedistanceToLineSegment(double x, double y, double z, double startX, double startY, double startZ, double endX, double endY, double endZ) doubleReturns the distance to the path, If a corresponding point on the path was found .doubledoubleReturns the point on the path's line segments closest to the queried position which, may fall strictly between two nodes.intReturns the index at which a new node would need to beinsertedto materializegetClosestIntersectionPoint()as a real node on the path, or -1 if that point already coincides with an existing node (i.e.getNode()getPath()static intnormalSideOfPlane(double cx, double cy, double cz, double nx, double ny, double nz, double x, double y, double z) toString()
-
Field Details
-
indexInPath
public final int indexInPathThe index of this point within its associated path -
near
-
closestIntersection
protected sc.fiji.snt.NearPoint.IntersectionOnLine closestIntersection
-
-
Constructor Details
-
NearPoint
-
NearPoint
-
-
Method Details
-
getNode
-
getNodeUnscaled
-
getPath
-
getClosestIntersectionPoint
Returns the point on the path's line segments closest to the queried position which, may fall strictly between two nodes. Useful when path nodes are sparser than the pick radius used to find this NearPoint in the first place (e.g. manually-placed tracing waypoints), where the closest existing node can be much farther from the query point than the path itself is. SeegetInsertionIndex()to materialize this position as a real node viaPath.insertNode(int, PointInImage)before using it structurally (e.g. as a fork/branch point)- Returns:
- the interpolated closest point, tagged with
PointInImage.getPath()set to this NearPoint's path; ornullif no valid intersection exists
-
getInsertionIndex
public int getInsertionIndex()Returns the index at which a new node would need to beinsertedto materializegetClosestIntersectionPoint()as a real node on the path, or -1 if that point already coincides with an existing node (i.e.getNode()can be used directly, no insertion needed). Only meaningful afterdistanceToPathNearPoint()has run (directly, or indirectly viagetClosestIntersectionPoint())- Returns:
- the insertion index, or -1 if no insertion is needed
-
compareTo
- Specified by:
compareToin interfaceComparable<NearPoint>
-
toString
-
distanceToPathNearPoint
public double distanceToPathNearPoint()Returns the distance to the path, If a corresponding point on the path was found . Returns -1 if no such point can be found- Returns:
- the distance to the path, If a corresponding point on the path was found . Returns -1 if no such point can be found
-
distanceToLineSegment
public static sc.fiji.snt.NearPoint.IntersectionOnLine distanceToLineSegment(double x, double y, double z, double startX, double startY, double startZ, double endX, double endY, double endZ) -
distanceToPathPoint
public double distanceToPathPoint() -
distanceToPathPointSquared
public double distanceToPathPointSquared() -
normalSideOfPlane
public static int normalSideOfPlane(double cx, double cy, double cz, double nx, double ny, double nz, double x, double y, double z) -
distanceFromPointToLine
public static sc.fiji.snt.NearPoint.IntersectionOnLine distanceFromPointToLine(double ax, double ay, double az, double vx, double vy, double vz, double x, double y, double z) -
distanceFromSinglePointPath
protected static sc.fiji.snt.NearPoint.IntersectionOnLine distanceFromSinglePointPath(double pathX, double pathY, double pathZ, double nearPointX, double nearPointY, double nearPointZ)
-