Package sc.fiji.snt.analysis
Class PeripathDetector
java.lang.Object
sc.fiji.snt.analysis.PeripathDetector
Detects intensity maxima (varicosities, spines, synaptic puncta) in annular
cross-sections around traced paths. At each path node, a perpendicular
cross-section is sampled from the image (see
PathFitter),
masked to an annulus defined by the node's radius (inner) and a configurable
outer radius, and then analyzed for local maxima with prominence filtering
via MaximumFinder. Detections from adjacent
cross-sections are deduplicated via greedy non-maximum suppression.
Usage:
PeripathDetector.Config cfg = new PeripathDetector.Config()
.innerRadiusMultiplier(0.5) // start at 0.5× node radius (closer to skeleton)
.outerRadiusMultiplier(2.0) // search up to 2× node radius
.prominence(50) // MaximumFinder noise tolerance
.mergingDistance(1.5); // NMS radius in calibrated units
List<PeripathDetector.Detection> hits =
PeripathDetector.detect(paths, image, cfg);
- Author:
- Tiago Ferreira
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classImmutable configuration with builder-like setters.static final classOne detected maximum (varicosity, spine, punctum, etc.). -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateTorusMask(Collection<Path> paths, ij.ImagePlus output, PeripathDetector.Config cfg, double fillValue) Creates a binary torus mask around the given paths, writing into anImagePlus.static <T extends net.imglib2.type.numeric.RealType<T>>
voidcreateTorusMask(Collection<Path> paths, net.imglib2.RandomAccessibleInterval<T> output, PeripathDetector.Config cfg, double fillValue) Creates a binary torus mask around the given paths.static <T extends net.imglib2.type.numeric.RealType<T>>
List<PeripathDetector.Detection> detect(Collection<Path> paths, net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> img, PeripathDetector.Config cfg) Detects intensity maxima along the given paths.
-
Method Details
-
detect
public static <T extends net.imglib2.type.numeric.RealType<T>> List<PeripathDetector.Detection> detect(Collection<Path> paths, net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.numeric.RealType<?>> img, PeripathDetector.Config cfg) Detects intensity maxima along the given paths.- Parameters:
paths- the paths to analyze (must have calibrated spacing)img- the detection image (single channel). Coordinates are in the same space as the paths.cfg- detection parameters- Returns:
- list of detections, deduplicated and optionally assigned to nearest path
- Throws:
IllegalArgumentException- if paths or image is null/empty
-
createTorusMask
public static <T extends net.imglib2.type.numeric.RealType<T>> void createTorusMask(Collection<Path> paths, net.imglib2.RandomAccessibleInterval<T> output, PeripathDetector.Config cfg, double fillValue) Creates a binary torus mask around the given paths. At each node, the annular search region (as defined by thePeripathDetector.Config) is back-projected into the output image, painting voxels inside the torus with the specified fill value.Usage:
// Create an empty mask matching the source image dimensions Img<UnsignedByteType> mask = ArrayImgs.unsignedBytes(width, height, depth); PeripathDetector.Config cfg = new PeripathDetector.Config() .innerRadiusMultiplier(0.8) .outerRadiusMultiplier(2.0); PeripathDetector.createTorusMask(paths, mask, cfg, 255);- Type Parameters:
T- pixel type of the output image- Parameters:
paths- the paths to generate the torus foroutput- the output image to paint into (must be pre-allocated with dimensions matching the source image in pixel space); existing non-zero voxels are preservedcfg- detection/annulus parameters (inner/outer radius settings)fillValue- the value to write into torus voxels- Throws:
IllegalArgumentException- if paths or output is null/empty
-
createTorusMask
public static void createTorusMask(Collection<Path> paths, ij.ImagePlus output, PeripathDetector.Config cfg, double fillValue) Creates a binary torus mask around the given paths, writing into anImagePlus. This is a convenience overload ofcreateTorusMask(Collection, RandomAccessibleInterval, Config, double)that accepts an IJ1 image directly.- Parameters:
paths- the paths to generate the torus foroutput- the output image to paint into (must be pre-allocated with dimensions matching the source image in pixel space)cfg- detection/annulus parameters (inner/outer radius settings)fillValue- the value to write into torus voxels- Throws:
IllegalArgumentException- if paths or output is null/empty- See Also:
-