Class Ellipsoid

java.lang.Object
inra.ijpb.geometry.Ellipsoid

public class Ellipsoid
extends java.lang.Object
An ellipsoid in the 3D space, defined by a center, three radius, and three orientation angles.
Author:
dlegland
  • Constructor Summary

    Constructors
    Constructor Description
    Ellipsoid​(double xc, double yc, double zc, double r1, double r2, double r3, double phi, double theta, double psi)
    Creates a new 3D Ellipsoid
    Ellipsoid​(Point3D center, double r1, double r2, double r3)
    Creates a new 3D Ellipsoid parallel to the three main axes.
    Ellipsoid​(Point3D center, double r1, double r2, double r3, double phi, double theta, double psi)
    Creates a new 3D Ellipsoid
  • Method Summary

    Modifier and Type Method Description
    Point3D center()  
    static Point3D[] centers​(Ellipsoid[] ellipsoids)
    Initializes center array from ellipsoid array.
    static double[][] elongations​(Ellipsoid[] ellipsoids)
    Computes the three elongation factors for an array of ellipsoids.
    double phi()  
    double psi()  
    double radius1()  
    double radius2()  
    double radius3()  
    double theta()  

    Methods inherited from class java.lang.Object

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

    • Ellipsoid

      public Ellipsoid​(Point3D center, double r1, double r2, double r3)
      Creates a new 3D Ellipsoid parallel to the three main axes.
      Parameters:
      center - the center of the ellipsoid
      r1 - the length of the largest semi-axis
      r2 - the length of the second largest semi-axis
      r3 - the length of the smallest semi-axis
    • Ellipsoid

      public Ellipsoid​(Point3D center, double r1, double r2, double r3, double phi, double theta, double psi)
      Creates a new 3D Ellipsoid
      Parameters:
      center - the center of the ellipsoid
      r1 - the length of the largest semi-axis
      r2 - the length of the second largest semi-axis
      r3 - the length of the smallest semi-axis
      phi - the azimut of the main axis, in degrees
      theta - the elevation of the main axis, in degrees
      psi - the roll of the ellipsoid around the main axis, in degrees.
    • Ellipsoid

      public Ellipsoid​(double xc, double yc, double zc, double r1, double r2, double r3, double phi, double theta, double psi)
      Creates a new 3D Ellipsoid
      Parameters:
      xc - the x-coordinate of ellipsoid center
      yc - the y-coordinate of ellipsoid center
      zc - the z-coordinate of ellipsoid center
      r1 - the length of the largest semi-axis
      r2 - the length of the second largest semi-axis
      r3 - the length of the smallest semi-axis
      phi - the azimut of the main axis, in degrees
      theta - the elevation of the main axis, in degrees
      psi - the roll of the ellipsoid around the main axis, in degrees.
  • Method Details

    • centers

      public static final Point3D[] centers​(Ellipsoid[] ellipsoids)
      Initializes center array from ellipsoid array.
      Parameters:
      ellipsoids - an array of ellipsoids
      Returns:
      the array of points corresponding to the centers of the ellipsoids.
    • elongations

      public static final double[][] elongations​(Ellipsoid[] ellipsoids)
      Computes the three elongation factors for an array of ellipsoids.
      
       ImageStack labelImage = ...
       int[] labels = LabelImages.findAllLabels(image);
       Calibation calib = new Calibration();
       Ellipsoid[] ellipsoids = new EquivalentEllipsoid().analyzeRegions(labelImage, labels, calib);
       double[][] elongations = Ellipsoid.elongations(ellipsoids);
       
      Parameters:
      ellipsoids - an array of ellipsoids
      Returns:
      an array of elongation factors. When radii are ordered such that R1 > R2 > R3, the three elongation factors are defined by ratio of R1 by R2, ratio of R1 by R3, and ratio of R2 by R3.
    • center

      public Point3D center()
      Returns:
      the center of the ellipsoid
    • radius1

      public double radius1()
      Returns:
      the length of the largest semi-axis
    • radius2

      public double radius2()
      Returns:
      the length of the second largest semi-axis
    • radius3

      public double radius3()
      Returns:
      the length of the smallest semi-axis
    • phi

      public double phi()
      Returns:
      the azimut of the main axis, in degrees
    • theta

      public double theta()
      Returns:
      the elevation of the main axis, in degrees
    • psi

      public double psi()
      Returns:
      the roll of the ellipsoid around the main axis, in degrees.