Package sc.fiji.snt

Class NearPoint

java.lang.Object
sc.fiji.snt.NearPoint
All Implemented Interfaces:
Comparable<NearPoint>

public class NearPoint extends Object implements 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 Details

    • indexInPath

      public final int indexInPath
      The index of this point within its associated path
    • near

      protected PointInImage near
    • closestIntersection

      protected sc.fiji.snt.NearPoint.IntersectionOnLine closestIntersection
  • Constructor Details

    • NearPoint

      public NearPoint(PointInImage nearPoint, Path path, int indexInPath)
    • NearPoint

      protected NearPoint(PointInImage nearPoint, Path path, int indexInPath, boolean unScaledPositions)
  • Method Details

    • getNode

      public PointInImage getNode()
    • getNodeUnscaled

      public PointInCanvas getNodeUnscaled()
    • getPath

      public Path getPath()
    • compareTo

      public int compareTo(NearPoint other)
      Specified by:
      compareTo in interface Comparable<NearPoint>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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)