Class RidgeDetectionUtils


  • public final class RidgeDetectionUtils
    extends Object
    • Method Detail

      • getAngle

        protected static double getAngle​(double x,
                                         double y)
        Returns the angle between the x-axis and a given vector (in components). Always positive.
        Parameters:
        y - - double denoting the y component of the vector.
        x - - double denoting the x component of the vector.
        Returns:
        double denoting the angle between the vector and the x-axis.
      • getOctant

        protected static int getOctant​(double x,
                                       double y)
        This method determines the octant (neighboring pixel) a vector points towards in pixel space. Explanation: Given a pixel denoted as '0', the neighboring pixels are numbered counterclockwise around pixel 0, beginning with pixel 1 to the right of pixel 0, and ending with pixel 8 one down and one right from pixel 0. The method matches this number to a range of degrees, e.g. a vector in octant 2 would have an angle between 22.5 degrees and 67.5 degrees. This is helpful to determine which neighboring pixels to look at in line detection.
        Parameters:
        y - - double denoting the y component of the vector.
        x - - double denoting the x component of the vector.
        Returns:
        int denoting the octant in which a vector is in.
      • getOctantCoords

        protected static int[] getOctantCoords​(int octant)
        Creates the modifier array for the octants.
        Parameters:
        octant - - describes the octant modifier needed.
        Returns:
        double[] of length 2, with the first number denoting the modifier to the x-coordinate and the second denoting the modifier to the y-coordinate.
      • get2DPoint

        protected static Point get2DPoint​(RandomAccess<DoubleType> RA)
        Helper method to take a point in a n-d image and reduce it down to a 2 dimensional point (e.g. in 3D cartesian space removing the z-coordinate from the point).
        Parameters:
        RA - - the random access of the n>2 dimensional image.
        Returns:
        Point in 2D space.
      • get2DRealPoint

        protected static RealPoint get2DRealPoint​(RandomAccess<DoubleType> RA)
        Helper method to take a point in a n-d image and reduce it down to a 2 dimensional Realpoint (e.g. in 3D cartesian space removing the z-coordinate from the point).
        Parameters:
        RA - - the random access of the n>2 dimensional image.
        Returns:
        Point in 2D space.
      • get2DRealPoint

        protected static RealPoint get2DRealPoint​(double x,
                                                  double y)
        Returns a RealPoint with the coordinates (x, y).
        Parameters:
        x - - the x-coordinate
        y - - the y-coordinate
        Returns:
        a RealPoint with coordinates (x,y)