Package sc.fiji.snt.seed
Class SeedPoint
java.lang.Object
sc.fiji.snt.seed.SeedPoint
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionfinal int1-based channel index, orCT_UNSET.final doubleDetector confidence in[0, 1].static final intSentinel for missing/unspecified channel or frame.final int1-based frame index, orCT_UNSET.final doubleEstimated radius in physical units.final StringProvenance label (e.g.static final Stringfinal StringFree-form semantic label (e.g.final doublePhysical X coordinate (calibrated).final doublePhysical Y coordinate (calibrated).final doublePhysical Z coordinate (calibrated). 0 for 2D images. -
Constructor Summary
ConstructorsConstructorDescriptionSeedPoint(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 TypeMethodDescriptiondouble[]asArray()Returns this seed as adouble[]{x, y, z}array.doubledistanceSqTo(double px, double py, double pz) Squared 3D Euclidean distance to a raw point (physical units).doubledistanceSqTo(SeedPoint other) Squared 3D Euclidean distance to another seed (physical units).doublegetCoordinateOnAxis(int axis) chardoublegetX()doublegetY()doublegetZ()voidsetAnnotation(BrainAnnotation annotation) Assigns a neuropil annotation (e.g., atlas compartment) to this point.voidsetHemisphere(char lr) Returns aPointInImagecarrying this seed's coordinates and radius, useful when handing the seed to APIs that expect the concrete point class rather than theSNTPointinterface.toString()
-
Field Details
-
CT_UNSET
public static final int CT_UNSETSentinel for missing/unspecified channel or frame.- See Also:
-
TAG_UNSET
- See Also:
-
x
public final double xPhysical X coordinate (calibrated). -
y
public final double yPhysical Y coordinate (calibrated). -
z
public final double zPhysical Z coordinate (calibrated). 0 for 2D images. -
confidence
public final double confidenceDetector confidence in[0, 1]. -
radius
public final double radiusEstimated radius in physical units.0if unknown. -
channel
public final int channel1-based channel index, orCT_UNSET. -
frame
public final int frame1-based frame index, orCT_UNSET. -
type
Free-form semantic label (e.g."soma","tip","branchpoint","waypoint"). Set at import time by the upstream detector. Nevernull;TAG_UNSETwhen absent. -
source
Provenance label (e.g."dl-detected","user-added","path-derived"). Records where the seed came from. Nevernull;TAG_UNSETwhen 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 Xy- physical Yz- 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. -
SeedPoint
public SeedPoint(double x, double y, double z, double confidence, double radius, int channel, int frame, String type, String source) - Parameters:
x- physical Xy- physical Yz- physical Z (0 for 2D)confidence- detector confidence in[0, 1]radius- physical radius (>= 0)channel- 1-based channel index, orCT_UNSETframe- 1-based frame index, orCT_UNSETtype- semantic label, orTAG_UNSETsource- provenance label, orTAG_UNSET
-
-
Method Details
-
distanceSqTo
Squared 3D Euclidean distance to another seed (physical units). Use the squared form for nearest-neighbor comparisons to avoid thesqrt; pass the result toMath.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 adouble[]{x, y, z}array. -
toPointInImage
Returns aPointInImagecarrying this seed's coordinates and radius, useful when handing the seed to APIs that expect the concrete point class rather than theSNTPointinterface. -
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
getCoordinateOnAxis
public double getCoordinateOnAxis(int axis) - Specified by:
getCoordinateOnAxisin interfaceSNTPoint- Returns:
- the coordinate on the specified axis
-
setAnnotation
Description copied from interface:SNTPointAssigns a neuropil annotation (e.g., atlas compartment) to this point.- Specified by:
setAnnotationin interfaceSNTPoint- Parameters:
annotation- the annotation to be assigned to this point
-
getAnnotation
- Specified by:
getAnnotationin interfaceSNTPoint- Returns:
- the neuropil annotation assigned to this point
-
setHemisphere
public void setHemisphere(char lr) - Specified by:
setHemispherein interfaceSNTPoint
-
getHemisphere
public char getHemisphere()- Specified by:
getHemispherein interfaceSNTPoint
-
toString
-