Class Mark

Object
org.anchoranalysis.mpp.mark.Mark
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LineSegment, MarkWithPosition, PointListBase

public abstract class Mark
extends Object
implements Serializable
Abstract base class representing a mark in 3D space.

A mark is a geometric shape with various properties and operations.

See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
      Mark()  
    protected Mark​(Mark source)
    Copy constructor.
  • Method Summary

    Modifier and Type Method Description
    abstract org.anchoranalysis.spatial.box.BoundingBox box​(Dimensions dimensions, int regionID)
    Calculates the bounding box for a specific region of the mark.
    abstract org.anchoranalysis.spatial.box.BoundingBox boxAllRegions​(Dimensions dimensions)
    Calculates the bounding box for all regions of the mark.
    abstract org.anchoranalysis.spatial.point.Point3d centerPoint()
    Returns the center point of the mark.
    org.anchoranalysis.image.voxel.object.ObjectMask deriveObject​(Dimensions dimensions, RegionMembershipWithFlags region, org.anchoranalysis.image.voxel.binary.values.BinaryValuesByte binaryValues)
    Creates an ObjectMask representation of the mark.
    abstract Mark duplicate()
    Creates a duplicate of this mark.
    boolean equalsDeep​(Mark mark)
    Checks if this mark is deeply equal to another mark.
    boolean equalsID​(Object obj)
    Checks if this mark has the same ID as another object.
    int getIdentifier()
    Gets the identifier of the mark.
    abstract String getName()
    Returns the name of this mark type.
    String identifier()
    Returns a string identifier for the mark.
    abstract byte isPointInside​(org.anchoranalysis.spatial.point.Point3i point)
    Determines if a point is inside the mark.
    abstract int numberDimensions()
    Returns the number of dimensions of this mark.
    abstract int numberRegions()
    Returns the number of regions in this mark.
    Optional<QuickOverlapCalculation> quickOverlap()
    Provides an optional quick overlap calculation method.
    abstract void scale​(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor)
    Scales the mark in X and Y dimensions.
    void setId​(int id)
    Sets the identifier of the mark.
    abstract double volume​(int regionID)
    Calculates the volume of a specific region of the mark.

    Methods inherited from class java.lang.Object

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

    • Mark

      protected Mark​(Mark source)
      Copy constructor.
      Parameters:
      source - source mark to copy from
    • Mark

      public Mark()
  • Method Details

    • isPointInside

      public abstract byte isPointInside​(org.anchoranalysis.spatial.point.Point3i point)
      Determines if a point is inside the mark.
      Parameters:
      point - the point to check
      Returns:
      a byte representing the region membership of the point
    • duplicate

      public abstract Mark duplicate()
      Creates a duplicate of this mark.
      Returns:
      a new Mark instance that is a copy of this one
    • numberRegions

      public abstract int numberRegions()
      Returns the number of regions in this mark.
      Returns:
      the number of regions
    • getName

      public abstract String getName()
      Returns the name of this mark type.
      Returns:
      the name of the mark
    • quickOverlap

      public Optional<QuickOverlapCalculation> quickOverlap()
      Provides an optional quick overlap calculation method.
      Returns:
      an Optional containing a QuickOverlapCalculation, or empty if not available
    • volume

      public abstract double volume​(int regionID)
      Calculates the volume of a specific region of the mark.
      Parameters:
      regionID - the ID of the region
      Returns:
      the volume of the region
    • scale

      public abstract void scale​(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor) throws CheckedUnsupportedOperationException
      Scales the mark in X and Y dimensions.
      Parameters:
      scaleFactor - how much to scale by
      Throws:
      CheckedUnsupportedOperationException - if scaling is not supported for this mark type
    • numberDimensions

      public abstract int numberDimensions()
      Returns the number of dimensions of this mark.
      Returns:
      the number of dimensions
    • centerPoint

      public abstract org.anchoranalysis.spatial.point.Point3d centerPoint()
      Returns the center point of the mark.
      Returns:
      the center point as a Point3d
    • box

      public abstract org.anchoranalysis.spatial.box.BoundingBox box​(Dimensions dimensions, int regionID)
      Calculates the bounding box for a specific region of the mark.
      Parameters:
      dimensions - the dimensions of the space
      regionID - the ID of the region
      Returns:
      the bounding box
    • boxAllRegions

      public abstract org.anchoranalysis.spatial.box.BoundingBox boxAllRegions​(Dimensions dimensions)
      Calculates the bounding box for all regions of the mark.
      Parameters:
      dimensions - the dimensions of the space
      Returns:
      the bounding box
    • equalsID

      public boolean equalsID​(Object obj)
      Checks if this mark has the same ID as another object.
      Parameters:
      obj - the object to compare with
      Returns:
      true if the IDs are the same, false otherwise
    • equalsDeep

      public boolean equalsDeep​(Mark mark)
      Checks if this mark is deeply equal to another mark.
      Parameters:
      mark - the mark to compare with
      Returns:
      true if the marks are deeply equal, false otherwise
    • deriveObject

      public org.anchoranalysis.image.voxel.object.ObjectMask deriveObject​(Dimensions dimensions, RegionMembershipWithFlags region, org.anchoranalysis.image.voxel.binary.values.BinaryValuesByte binaryValues)
      Creates an ObjectMask representation of the mark.
      Parameters:
      dimensions - the dimensions of the space
      region - the region membership to consider
      binaryValues - the binary values to use for encoding
      Returns:
      an ObjectMask representing the mark
    • identifier

      public String identifier()
      Returns a string identifier for the mark.
      Returns:
      a string representation of the mark's ID
    • getIdentifier

      public int getIdentifier()
      Gets the identifier of the mark.
      Returns:
      the mark's ID
    • setId

      public void setId​(int id)
      Sets the identifier of the mark.
      Parameters:
      id - the ID to set