Class Ellipsoid

All Implemented Interfaces:
Serializable

public class Ellipsoid
extends ConicBase
implements Serializable
Represents a 3D ellipsoid mark with multiple sub-regions.

The ellipsoid has the following sub-marks:

  • Sub-Mark 0: Center Ellipsoid (inner core)
  • Sub-Mark 1: Ellipsoid with shell
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    Ellipsoid()
    Creates a new Ellipsoid with default values.
    Ellipsoid​(Ellipsoid src)
    Creates a new Ellipsoid by copying an existing one.
  • Method Summary

    Modifier and Type Method Description
    org.anchoranalysis.spatial.box.BoundingBox box​(Dimensions dimensions, int regionID)
    Calculates the bounding box for a specific region of the mark.
    org.anchoranalysis.spatial.box.BoundingBox boxAllRegions​(Dimensions dimensions)
    Calculates the bounding box for all regions of the mark.
    double[] createRadiiArray()
    Creates an array of radii in their original units.
    double[] createRadiiArrayResolved​(Optional<Resolution> resolution)
    Creates an array of radii resolved to the given resolution.
    Mark duplicate()
    Creates a duplicate of this mark.
    boolean equalsDeep​(Mark m)
    Checks if this mark is equal to another mark by comparing all attributes.
    org.anchoranalysis.mpp.mark.conic.EllipsoidMatrixCalculator getEllipsoidCalculator()
    Calculator for ellipsoid-related matrices.
    static double getEllipsoidSum​(double x, double y, double z, cern.colt.matrix.DoubleMatrix2D mat)
    Calculates the sum of squared coordinates relative to the ellipsoid's matrix.
    double getInnerCoreDistance()
    The distance to the inner core, expressed as a ratio of the radii.
    String getName()
    Returns the name of this mark type.
    org.anchoranalysis.spatial.orientation.Orientation getOrientation()
    The orientation of the ellipsoid.
    org.anchoranalysis.spatial.point.Point3d getRadii()
    The radii of the ellipsoid in 3D.
    double getShell()
    The size of the shell, expressed as a ratio of the radii.
    byte isPointInside​(org.anchoranalysis.spatial.point.Point3i point)
    Determines if a point is inside the mark.
    int numberDimensions()
    Returns the number of dimensions of this mark.
    int numberRegions()
    Returns the number of regions in this mark.
    Optional<QuickOverlapCalculation> quickOverlap()
    Provides an optional quick overlap calculation method.
    void scale​(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor)
    Scales the mark in X and Y dimensions.
    void setInnerCoreDistance​(double innerCoreDistance)
    The distance to the inner core, expressed as a ratio of the radii.
    void setMarksExplicit​(org.anchoranalysis.spatial.point.Point3d position)
    Sets the mark's position explicitly.
    void setMarksExplicit​(org.anchoranalysis.spatial.point.Point3d position, org.anchoranalysis.spatial.orientation.Orientation orientation)
    Sets the mark's position and orientation explicitly.
    void setMarksExplicit​(org.anchoranalysis.spatial.point.Point3d pos, org.anchoranalysis.spatial.orientation.Orientation orientation, org.anchoranalysis.spatial.point.Point3d radii)
    Sets the mark's properties explicitly.
    void setShell​(double shell)
    The size of the shell, expressed as a ratio of the radii.
    String toString()  
    void updateAfterMarkChange()
    Updates internal calculations after a change in the mark's properties.
    double volume​(int regionID)
    Calculates the volume of a specific region of the mark.

    Methods inherited from class org.anchoranalysis.mpp.mark.conic.ConicBase

    radiiOrdered, radiiOrderedResolved

    Methods inherited from class org.anchoranalysis.mpp.mark.MarkWithPosition

    centerPoint, getPosition, positionString, setPosition

    Methods inherited from class org.anchoranalysis.mpp.mark.Mark

    deriveObject, equalsID, getIdentifier, identifier, setId

    Methods inherited from class java.lang.Object

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

    • Ellipsoid

      public Ellipsoid()
      Creates a new Ellipsoid with default values.
    • Ellipsoid

      public Ellipsoid​(Ellipsoid src)
      Creates a new Ellipsoid by copying an existing one.
      Parameters:
      src - the Ellipsoid to copy from
  • Method Details

    • getName

      public String getName()
      Description copied from class: Mark
      Returns the name of this mark type.
      Specified by:
      getName in class Mark
      Returns:
      the name of the mark
    • getEllipsoidSum

      public static double getEllipsoidSum​(double x, double y, double z, cern.colt.matrix.DoubleMatrix2D mat)
      Calculates the sum of squared coordinates relative to the ellipsoid's matrix.
      Parameters:
      x - x-coordinate
      y - y-coordinate
      z - z-coordinate
      mat - the ellipsoid matrix
      Returns:
      the sum of squared coordinates
    • isPointInside

      public final byte isPointInside​(org.anchoranalysis.spatial.point.Point3i point)
      Description copied from class: Mark
      Determines if a point is inside the mark.
      Specified by:
      isPointInside in class Mark
      Parameters:
      point - the point to check
      Returns:
      a byte representing the region membership of the point
    • duplicate

      public Mark duplicate()
      Description copied from class: Mark
      Creates a duplicate of this mark.
      Specified by:
      duplicate in class Mark
      Returns:
      a new Mark instance that is a copy of this one
    • toString

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

      public double volume​(int regionID)
      Description copied from class: Mark
      Calculates the volume of a specific region of the mark.
      Specified by:
      volume in class Mark
      Parameters:
      regionID - the ID of the region
      Returns:
      the volume of the region
    • updateAfterMarkChange

      public void updateAfterMarkChange()
      Updates internal calculations after a change in the mark's properties.
    • box

      public org.anchoranalysis.spatial.box.BoundingBox box​(Dimensions dimensions, int regionID)
      Description copied from class: Mark
      Calculates the bounding box for a specific region of the mark.
      Specified by:
      box in class Mark
      Parameters:
      dimensions - the dimensions of the space
      regionID - the ID of the region
      Returns:
      the bounding box
    • quickOverlap

      public Optional<QuickOverlapCalculation> quickOverlap()
      Description copied from class: Mark
      Provides an optional quick overlap calculation method.
      Overrides:
      quickOverlap in class Mark
      Returns:
      an Optional containing a QuickOverlapCalculation, or empty if not available
    • setMarksExplicit

      public void setMarksExplicit​(org.anchoranalysis.spatial.point.Point3d pos, org.anchoranalysis.spatial.orientation.Orientation orientation, org.anchoranalysis.spatial.point.Point3d radii)
      Description copied from class: ConicBase
      Sets the mark's properties explicitly.
      Specified by:
      setMarksExplicit in class ConicBase
      Parameters:
      pos - the position of the mark
      orientation - the orientation of the mark
      radii - the radii of the mark
    • setMarksExplicit

      public void setMarksExplicit​(org.anchoranalysis.spatial.point.Point3d position)
      Description copied from class: ConicBase
      Sets the mark's position explicitly.
      Specified by:
      setMarksExplicit in class ConicBase
      Parameters:
      position - the position of the mark
    • createRadiiArray

      public double[] createRadiiArray()
      Description copied from class: ConicBase
      Creates an array of radii in their original units.
      Specified by:
      createRadiiArray in class ConicBase
      Returns:
      an array of radii
    • createRadiiArrayResolved

      public double[] createRadiiArrayResolved​(Optional<Resolution> resolution)
      Description copied from class: ConicBase
      Creates an array of radii resolved to the given resolution.
      Specified by:
      createRadiiArrayResolved in class ConicBase
      Parameters:
      resolution - an optional resolution to consider
      Returns:
      an array of resolved radii
    • scale

      public void scale​(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor) throws CheckedUnsupportedOperationException
      Description copied from class: Mark
      Scales the mark in X and Y dimensions.
      Overrides:
      scale in class MarkWithPosition
      Parameters:
      scaleFactor - how much to scale by
      Throws:
      CheckedUnsupportedOperationException - if scaling is not supported for this mark type
    • equalsDeep

      public boolean equalsDeep​(Mark m)
      Description copied from class: MarkWithPosition
      Checks if this mark is equal to another mark by comparing all attributes.
      Overrides:
      equalsDeep in class MarkWithPosition
      Parameters:
      m - the mark to compare with
      Returns:
      true if the marks are equal, false otherwise
    • numberDimensions

      public int numberDimensions()
      Description copied from class: Mark
      Returns the number of dimensions of this mark.
      Specified by:
      numberDimensions in class Mark
      Returns:
      the number of dimensions
    • setMarksExplicit

      public void setMarksExplicit​(org.anchoranalysis.spatial.point.Point3d position, org.anchoranalysis.spatial.orientation.Orientation orientation)
      Description copied from class: ConicBase
      Sets the mark's position and orientation explicitly.
      Specified by:
      setMarksExplicit in class ConicBase
      Parameters:
      position - the position of the mark
      orientation - the orientation of the mark
    • numberRegions

      public int numberRegions()
      Description copied from class: Mark
      Returns the number of regions in this mark.
      Specified by:
      numberRegions in class Mark
      Returns:
      the number of regions
    • boxAllRegions

      public org.anchoranalysis.spatial.box.BoundingBox boxAllRegions​(Dimensions dimensions)
      Description copied from class: Mark
      Calculates the bounding box for all regions of the mark.
      Specified by:
      boxAllRegions in class Mark
      Parameters:
      dimensions - the dimensions of the space
      Returns:
      the bounding box
    • getShell

      public double getShell()
      The size of the shell, expressed as a ratio of the radii.
    • setShell

      public void setShell​(double shell)
      The size of the shell, expressed as a ratio of the radii.
    • getInnerCoreDistance

      public double getInnerCoreDistance()
      The distance to the inner core, expressed as a ratio of the radii.
    • setInnerCoreDistance

      public void setInnerCoreDistance​(double innerCoreDistance)
      The distance to the inner core, expressed as a ratio of the radii.
    • getRadii

      public org.anchoranalysis.spatial.point.Point3d getRadii()
      The radii of the ellipsoid in 3D.
    • getOrientation

      public org.anchoranalysis.spatial.orientation.Orientation getOrientation()
      The orientation of the ellipsoid.
    • getEllipsoidCalculator

      public org.anchoranalysis.mpp.mark.conic.EllipsoidMatrixCalculator getEllipsoidCalculator()
      Calculator for ellipsoid-related matrices.