Class SeedPoint

java.lang.Object
sc.fiji.snt.seed.SeedPoint
All Implemented Interfaces:
SNTPoint

public final class SeedPoint extends Object implements SNTPoint
Immutable candidate seed point used to bootstrap auto-tracing or as a visualization aid for the output of upstream point detectors (e.g., deep-learning probability maps + local-max suppression).

Coordinates are stored in physical units (same convention as PointInImage). Importers that receive voxel-indexed input are expected to convert at parse time using the active image's spacing.

Implements SNTPoint so seeds work polymorphically with the rest of SNT's spatial / analysis APIs. The core seed payload (x, y, z, confidence, radius, channel, frame, type, source) is immutable; only the BrainAnnotation and hemisphere fields are mutable, since they are typically populated after construction by atlas-lookup code.

Instances are cheap to copy; collections of millions of seeds are intended use cases.

Author:
Tiago Ferreira
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    1-based channel index, or CT_UNSET.
    final double
    Detector confidence in [0, 1].
    static final int
    Sentinel for missing/unspecified channel or frame.
    final int
    1-based frame index, or CT_UNSET.
    final double
    Estimated radius in physical units.
    final String
    Provenance label (e.g.
    static final String
    Empty-string sentinel for unset type / source.
    final String
    Free-form semantic label (e.g.
    final double
    Physical X coordinate (calibrated).
    final double
    Physical Y coordinate (calibrated).
    final double
    Physical Z coordinate (calibrated). 0 for 2D images.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SeedPoint(double x, double y, double z, double confidence, double radius)
    Creates a seed without channel/frame assignment and no type/source.
    SeedPoint(double x, double y, double z, double confidence, double radius, int channel, int frame)
    Creates a seed with channel/frame assignment but no type/source.
    SeedPoint(double x, double y, double z, double confidence, double radius, int channel, int frame, String type, String source)
    Full constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    Returns this seed as a double[]{x, y, z} array.
    double
    distanceSqTo(double px, double py, double pz)
    Squared 3D Euclidean distance to a raw point (physical units).
    double
    Squared 3D Euclidean distance to another seed (physical units).
     
    double
     
    char
     
    double
     
    double
     
    double
     
    void
    Assigns a neuropil annotation (e.g., atlas compartment) to this point.
    void
    setHemisphere(char lr)
     
    Returns a PointInImage carrying this seed's coordinates and radius, useful when handing the seed to APIs that expect the concrete point class rather than the SNTPoint interface.
     

    Methods inherited from class java.lang.Object

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

    • CT_UNSET

      public static final int CT_UNSET
      Sentinel for missing/unspecified channel or frame.
      See Also:
    • TAG_UNSET

      public static final String TAG_UNSET
      Empty-string sentinel for unset type / source.
      See Also:
    • x

      public final double x
      Physical X coordinate (calibrated).
    • y

      public final double y
      Physical Y coordinate (calibrated).
    • z

      public final double z
      Physical Z coordinate (calibrated). 0 for 2D images.
    • confidence

      public final double confidence
      Detector confidence in [0, 1].
    • radius

      public final double radius
      Estimated radius in physical units. 0 if unknown.
    • channel

      public final int channel
      1-based channel index, or CT_UNSET.
    • frame

      public final int frame
      1-based frame index, or CT_UNSET.
    • type

      public final String type
      Free-form semantic label (e.g. "soma", "tip", "branchpoint", "waypoint"). Set at import time by the upstream detector. Never null; TAG_UNSET when absent.
    • source

      public final String source
      Provenance label (e.g. "dl-detected", "user-added", "path-derived"). Records where the seed came from. Never null; TAG_UNSET when absent.
  • Constructor Details

    • SeedPoint

      public SeedPoint(double x, double y, double z, double confidence, double radius)
      Creates a seed without channel/frame assignment and no type/source.
      Parameters:
      x - physical X
      y - physical Y
      z - physical Z (0 for 2D)
      confidence - detector confidence in [0, 1]
      radius - physical radius (>= 0)
    • SeedPoint

      public SeedPoint(double x, double y, double z, double confidence, double radius, int channel, int frame)
      Creates a seed with channel/frame assignment but no type/source.
      Parameters:
      x - physical X
      y - physical Y
      z - physical Z (0 for 2D)
      confidence - detector confidence in [0, 1]
      radius - physical radius (>= 0)
      channel - 1-based channel index, or CT_UNSET
      frame - 1-based frame index, or CT_UNSET
    • SeedPoint

      public SeedPoint(double x, double y, double z, double confidence, double radius, int channel, int frame, String type, String source)
      Full constructor. null values for type or source are normalised to TAG_UNSET.
      Parameters:
      x - physical X
      y - physical Y
      z - physical Z (0 for 2D)
      confidence - detector confidence in [0, 1]
      radius - physical radius (>= 0)
      channel - 1-based channel index, or CT_UNSET
      frame - 1-based frame index, or CT_UNSET
      type - semantic label, or TAG_UNSET
      source - provenance label, or TAG_UNSET
  • Method Details

    • distanceSqTo

      public double distanceSqTo(SeedPoint other)
      Squared 3D Euclidean distance to another seed (physical units). Use the squared form for nearest-neighbor comparisons to avoid the sqrt; pass the result to Math.sqrt(double) when an actual distance is needed.
    • distanceSqTo

      public double distanceSqTo(double px, double py, double pz)
      Squared 3D Euclidean distance to a raw point (physical units).
    • asArray

      public double[] asArray()
      Returns this seed as a double[]{x, y, z} array.
    • toPointInImage

      public PointInImage toPointInImage()
      Returns a PointInImage carrying this seed's coordinates and radius, useful when handing the seed to APIs that expect the concrete point class rather than the SNTPoint interface.
    • getX

      public double getX()
      Specified by:
      getX in interface SNTPoint
      Returns:
      the X-coordinate of the point
    • getY

      public double getY()
      Specified by:
      getY in interface SNTPoint
      Returns:
      the Y-coordinate of the point
    • getZ

      public double getZ()
      Specified by:
      getZ in interface SNTPoint
      Returns:
      the Z-coordinate of the point
    • getCoordinateOnAxis

      public double getCoordinateOnAxis(int axis)
      Specified by:
      getCoordinateOnAxis in interface SNTPoint
      Returns:
      the coordinate on the specified axis
    • setAnnotation

      public void setAnnotation(BrainAnnotation annotation)
      Description copied from interface: SNTPoint
      Assigns a neuropil annotation (e.g., atlas compartment) to this point.
      Specified by:
      setAnnotation in interface SNTPoint
      Parameters:
      annotation - the annotation to be assigned to this point
    • getAnnotation

      public BrainAnnotation getAnnotation()
      Specified by:
      getAnnotation in interface SNTPoint
      Returns:
      the neuropil annotation assigned to this point
    • setHemisphere

      public void setHemisphere(char lr)
      Specified by:
      setHemisphere in interface SNTPoint
    • getHemisphere

      public char getHemisphere()
      Specified by:
      getHemisphere in interface SNTPoint
    • toString

      public String toString()
      Overrides:
      toString in class Object