Class PointInImage

java.lang.Object
sc.fiji.snt.util.PointInImage
All Implemented Interfaces:
Cloneable, SNTPoint
Direct Known Subclasses:
Path.PathNode, PointInCanvas, ShollPoint, SWCPoint

public class PointInImage extends Object implements SNTPoint, Cloneable
Defines a Point in an image, a node of a traced Path. Coordinates are always expressed in real-world coordinates.
Author:
Tiago Ferreira
  • Field Details

    • x

      public double x
      The cartesian coordinate of this node
    • y

      public double y
      The cartesian coordinate of this node
    • z

      public double z
      The cartesian coordinate of this node
    • radius

      public double radius
      The radius of reconstructed structure at this node
    • v

      public double v
      A property associated with this point (e.g., voxel intensity) (optional field)
    • onPath

      public Path onPath
      The Path associated with this node, if any (optional field)
  • Constructor Details

    • PointInImage

      public PointInImage()
    • PointInImage

      public PointInImage(double x, double y, double z)
    • PointInImage

      protected PointInImage(double x, double y, double z, Path onPath)
  • Method Details

    • distanceSquaredTo

      public double distanceSquaredTo(double ox, double oy, double oz)
    • distanceSquaredTo

      public double distanceSquaredTo(PointInImage o)
    • distanceTo

      public double distanceTo(PointInImage o)
    • euclideanDxTo

      public double euclideanDxTo(PointInImage point)
    • chebyshevXYdxTo

      public double chebyshevXYdxTo(PointInImage point)
    • chebyshevZdxTo

      public double chebyshevZdxTo(PointInImage point)
    • chebyshevDxTo

      public double chebyshevDxTo(PointInImage point)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • transform

      public PointInImage transform(PathTransformer transformer)
    • isReal

      public boolean isReal()
    • isSameLocation

      public boolean isSameLocation(PointInImage pim)
    • scale

      public void scale(double xScale, double yScale, double zScale)
      Scales this point coordinates.
      Parameters:
      xScale - the scaling factor for x coordinates
      yScale - the scaling factor for y coordinates
      zScale - the scaling factor for z coordinates
    • getUnscaledPoint

      public PointInCanvas getUnscaledPoint() throws IllegalArgumentException
      Converts the coordinates of this point into pixel units if this point is associated with a Path.
      Returns:
      this point in pixel coordinates
      Throws:
      IllegalArgumentException - if this point is not associated with a Path
    • getUnscaledPoint

      public PointInCanvas getUnscaledPoint(int view)
      Converts the coordinates of this point into pixel units if this point is associated with a Path.
      Parameters:
      view - MultiDThreePanes.XY_PLANE, MultiDThreePanes.ZY_PLANE, etc.
      Returns:
      this point in pixel coordinates
      Throws:
      IllegalArgumentException - if this point is not associated with a Path, or view was not recognized
    • getPath

      public Path getPath()
      Returns the Path associated with this node (if any)
      Returns:
      the path associated with this node or null if setPath(Path) has not been called.
    • setPath

      public void setPath(Path onPath)
      Associates a Path with this node
      Parameters:
      onPath - the Path to be associated with this node
    • clone

      public PointInImage clone()
      Creates a copy of this PointInImage.

      This method creates a copy of the point including all properties such as coordinates, value, annotation, and hemisphere information.

      Overrides:
      clone in class Object
      Returns:
      a new PointInImage that is a copy of this point
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getX

      public double getX()
      Specified by:
      getX in interface SNTPoint
      Returns:
      the X-coordinate of the point
    • getY

      public double getY()
      Specified by:
      getY in interface SNTPoint
      Returns:
      the Y-coordinate of the point
    • getZ

      public double getZ()
      Specified by:
      getZ in interface SNTPoint
      Returns:
      the Z-coordinate of the point
    • getCoordinateOnAxis

      public double getCoordinateOnAxis(int axis)
      Gets the coordinate along the specified axis.
      Specified by:
      getCoordinateOnAxis in interface SNTPoint
      Parameters:
      axis - the axis. Either Tree.X_AXIS, Tree.Y_AXIS, or Tree.Z_AXIS
      Returns:
      the coordinate on the specified axis
    • setAnnotation

      public void setAnnotation(BrainAnnotation annotation)
      Description copied from interface: SNTPoint
      Assigns a neuropil annotation (e.g., atlas compartment) to this point.
      Specified by:
      setAnnotation in interface SNTPoint
      Parameters:
      annotation - the annotation to be assigned to this point
    • getAnnotation

      public BrainAnnotation getAnnotation()
      Specified by:
      getAnnotation in interface SNTPoint
      Returns:
      the neuropil annotation assigned to this point
    • setHemisphere

      public void setHemisphere(char lr)
      Specified by:
      setHemisphere in interface SNTPoint
    • getHemisphere

      public char getHemisphere()
      Specified by:
      getHemisphere in interface SNTPoint