Class CircleUtil

java.lang.Object
gov.nih.mipav.util.CircleUtil

public class CircleUtil extends Object
Public utility class for generating approximations to circles and spheres.
Author:
senseneyj
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static int
    computeEpsilon(int x, int y, int r)
     
    private static int
    computeEpsilonX(int epsilon, int x, int dx)
     
    private static int
    computeEpsilonXY(int epsilon, int x, int dx, int y, int dy)
     
    private static int
    computeEpsilonY(int epsilon, int y, int dy)
     
    static int[]
    get1DPointsInCircle(int xCenter, int yCenter, int zCenter, int radius, int dimX, int dimY)
    Calculates the points of an approximate sphere whose center is at (xCenter, yCenter) with a given radius.
    static int[]
    get1DPointsInSphere(int value, int radius, int xDim, int yDim)
    Calculates the points of an approximate sphere whose center is at value with a given radius.
    static int[]
    get1DPointsInSphere(int xCenter, int yCenter, int zCenter, int radius, int xDim, int yDim)
    Calculates the points of an approximate sphere whose center is at (xCenter, yCenter, zCenter) with a given radius.
    static int[][]
    get2DPointsInCircle(int xCenter, int yCenter, int r)
    Calculates the points of an approximate circle whose center is at (xCenter, yCenter) with a given radius.
    static int[][]
    get3DPointsInSphere(int xCenter, int yCenter, int zCenter, double xRes, double yRes, double zRes, double radius)
     
    static int[][]
    get3DPointsInSphere(int xCenter, int yCenter, int zCenter, int radius)
    Calculates the points of an approximate sphere whose center is at (xCenter, yCenter, zCenter) witha given radius.
    static int[][]
    getQuadrantBoundaryPoints(int radius, int quadrant)
    Generates 2D data points in a given quadrant for a specified radius

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CircleUtil

      public CircleUtil()
  • Method Details

    • get3DPointsInSphere

      public static int[][] get3DPointsInSphere(int xCenter, int yCenter, int zCenter, double xRes, double yRes, double zRes, double radius)
    • get3DPointsInSphere

      public static int[][] get3DPointsInSphere(int xCenter, int yCenter, int zCenter, int radius)
      Calculates the points of an approximate sphere whose center is at (xCenter, yCenter, zCenter) witha given radius.
      Returns:
      Array of (x,y,z) coordinates of an approximate sphere.
    • get2DPointsInCircle

      public static int[][] get2DPointsInCircle(int xCenter, int yCenter, int r)
      Calculates the points of an approximate circle whose center is at (xCenter, yCenter) with a given radius.
      Returns:
      Array of (x,y) coordinates of an approximate circle.
    • get1DPointsInSphere

      public static int[] get1DPointsInSphere(int xCenter, int yCenter, int zCenter, int radius, int xDim, int yDim)
      Calculates the points of an approximate sphere whose center is at (xCenter, yCenter, zCenter) with a given radius.
      Returns:
      Array of points of an approximate sphere.
    • get1DPointsInSphere

      public static int[] get1DPointsInSphere(int value, int radius, int xDim, int yDim)
      Calculates the points of an approximate sphere whose center is at value with a given radius.
      Returns:
      Array of points of an approximate sphere.
    • get1DPointsInCircle

      public static int[] get1DPointsInCircle(int xCenter, int yCenter, int zCenter, int radius, int dimX, int dimY)
      Calculates the points of an approximate sphere whose center is at (xCenter, yCenter) with a given radius.
      Returns:
      Array of points of an approximate sphere.
    • getQuadrantBoundaryPoints

      public static int[][] getQuadrantBoundaryPoints(int radius, int quadrant)
      Generates 2D data points in a given quadrant for a specified radius
      Parameters:
      radius - Radius from origin for circle.
      quadrant - Allow 1 - 4 where 1: x>=0, y>0 2: xinvalid input: '<'0, y>=0 3: xinvalid input: '<'=0, yinvalid input: '<'0 4: x>0, yinvalid input: '<'=0
    • computeEpsilon

      private static int computeEpsilon(int x, int y, int r)
    • computeEpsilonX

      private static int computeEpsilonX(int epsilon, int x, int dx)
    • computeEpsilonY

      private static int computeEpsilonY(int epsilon, int y, int dy)
    • computeEpsilonXY

      private static int computeEpsilonXY(int epsilon, int x, int dx, int y, int dy)