Package inra.ijpb.geometry
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 EllipsoidEllipsoid(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
Creates a new 3D Ellipsoid parallel to the three main axes.- Parameters:
center
- the center of the ellipsoidr1
- the length of the largest semi-axisr2
- the length of the second largest semi-axisr3
- 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 ellipsoidr1
- the length of the largest semi-axisr2
- the length of the second largest semi-axisr3
- the length of the smallest semi-axisphi
- the azimut of the main axis, in degreestheta
- the elevation of the main axis, in degreespsi
- 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 centeryc
- the y-coordinate of ellipsoid centerzc
- the z-coordinate of ellipsoid centerr1
- the length of the largest semi-axisr2
- the length of the second largest semi-axisr3
- the length of the smallest semi-axisphi
- the azimut of the main axis, in degreestheta
- the elevation of the main axis, in degreespsi
- the roll of the ellipsoid around the main axis, in degrees.
-
-
Method Details
-
centers
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
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
- 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.
-