Class PolarProfileStats
- All Implemented Interfaces:
ShollStats
This class analyzes the directional distribution of Sholl intersections/cable length by dividing the 360° space around a center point into angular sectors. The angular resolution is specified using step size in degrees (e.g., 10° for 36 bins).
- Author:
- Tiago Ferreira
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordSimple container for angular peaks.static final recordImmutable summary of the global polar distribution.Nested classes/interfaces inherited from interface sc.fiji.snt.analysis.sholl.math.ShollStats
ShollStats.DataMode -
Field Summary
Fields inherited from interface sc.fiji.snt.analysis.sholl.math.ShollStats
ANNULUS, AREA, GUESS_SLOG, LOG_LOG, PERIMETER, S_SHELL, SEMI_LOG, SURFACE, VOLUME -
Constructor Summary
ConstructorsConstructorDescriptionPolarProfileStats(LinearProfileStats linerStats, double angleStepSize) Instantiates a new PolarProfileStats from a Profile with custom angular resolution.PolarProfileStats(Profile profile) Instantiates a new PolarProfileStats from an existing Sholl Profile, with the default angular resolution (10°).PolarProfileStats(Profile profile, ShollStats.DataMode dataMode, double angleStepSize) Instantiates a new PolarProfileStats from a Profile with custom angular resolution. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendSummaryReport(SNTTable table) Appends summary data ofPolarProfileStats.Reportto the last row of the specified table Columns written: Angular Distribution Coherence [0,1] Orientation Distribution Coherence [0,1] Preferred Direction in degrees [0,360[ Preferred Orientation in degrees [0,180[ Number of directional peaks Angle, Value of first two directional peaks Number of orientation peaks Angle, Value of first two orientation peaksvoiddetailReport(SNTTable table) WritesPolarProfileStats.Reportdetails to a table.findDirectionPeaks(double rMin, double rMax) Automatically finds directional peaks (0–360°) over a Sholl radial band by deriving a data-driven prominence threshold (median + 1.5×MAD (Median Absolute Deviation), of local prominences after light smoothing) and applying a minimum separation of two angular bins.findDirectionPeaks(double rMin, double rMax, int maxPeaks, double minProminence) Finds up tomaxPeakslocal maxima in the direction (0–360°) distribution within a Sholl band.findOrientationPeaks(double rMin, double rMax) Automatically finds orientation (0–180°) peaks over a radial band using the same settings used byfindDirectionPeaks(double, double).findOrientationPeaks(double rMin, double rMax, int maxPeaks, double minProminence) Finds up tomaxPeakslocal maxima in the orientation (0–180°) distribution within a Sholl band.doubleGets the angular step size in degrees.double[]Returns the angular distribution obtained by summing the intersections matrix or the length matrix across all radial bins.double[]getAngularDistribution(double rMin, double rMax) Returns the angular distribution obtained by summing only those radial bins whose ring centers fall within the half-open interval[rMin, rMax[.doubleConvenience getter forPolarProfileStats.Report.adc()double[]double[]getFitYValues(boolean asCumulativeFrequencies) double[][]Returns the length matrix with shape[nRadialBins][nAngleBins].intgetN()doubleConvenience getter forPolarProfileStats.Report.odc()getPlot()Returns the polar plot using the specified colormap.getPlot(net.imglib2.display.ColorTable colorTable) Returns the polar plot using the specified colormap.doubleConvenience getter forPolarProfileStats.Report.pd()doublegetPreferredDirection(double rMin, double rMax) Convenience: preferred direction computed from a radial band[rMin,rMax).doubleConvenience getter forPolarProfileStats.Report.po()doublegetPreferredOrientation(double rMin, double rMax) Convenience: preferred orientation computed from a radial band[rMin,rMax).Returns a cached summary report of the analysis.double[]double[]double[]getYValues(boolean asCumulativeFrequencies) voidsetAngleStepSize(double angleStepSize) Sets the angular step size in degrees.voidbooleanvalidFit()
-
Constructor Details
-
PolarProfileStats
Instantiates a new PolarProfileStats from an existing Sholl Profile, with the default angular resolution (10°).- Parameters:
profile- the Sholl Profile containing radii and intersection counts.
-
PolarProfileStats
Instantiates a new PolarProfileStats from a Profile with custom angular resolution.- Parameters:
profile- the Sholl ProfileangleStepSize- the angular step size in degrees (e.g., 10.0 for 10° bins)
-
PolarProfileStats
Instantiates a new PolarProfileStats from a Profile with custom angular resolution.- Parameters:
linerStats- the LinearProfileStats instance from which profile is extracted. If a polynomial fit has been applied the fitted profile is used. The data mode used is that of LinearProfileStats and cannot be changed.angleStepSize- the angular step size in degrees (e.g., 10.0 for 10° bins)
-
-
Method Details
-
getAngleStepSize
public double getAngleStepSize()Gets the angular step size in degrees.- Returns:
- the angular step size in degrees
-
setAngleStepSize
public void setAngleStepSize(double angleStepSize) Sets the angular step size in degrees.- Parameters:
angleStepSize- the angular step size in degrees (e.g., a step size of 10° splits the data into 36 bins)- Throws:
IllegalArgumentException- if angleStepSize is not a positive divisor of 360
-
getDataMode
- Specified by:
getDataModein interfaceShollStats
-
setDataMode
- Specified by:
setDataModein interfaceShollStats
-
getMatrix
public double[][] getMatrix()Returns the length matrix with shape[nRadialBins][nAngleBins]. When data mode is intersections: Each entry stores the number of intersected components assigned to the ring-sector bin at the given radial and angular index. When data mode is length: Each entry stores the total cable length (in calibrated physical units) assigned to the ring-sector bin at the given radial and angular index.Indexing: row = radial bin (inner to outer), column = angular bin (0..nAngleBins-1). Angular bins partition [0°, 360°[ using an equal step size given by
getAngleStepSize()and are referenced by their bin center angle when aggregating directions.- Returns:
- a non-null 2D array where
C[r][a]is the count in bin (r,a), orL[r][a]is the length in bin (r,a),
-
getAngularDistribution
public double[] getAngularDistribution()Returns the angular distribution obtained by summing the intersections matrix or the length matrix across all radial bins.Units: For intersections: counts per angular bin (dimensionless). For length: calibrated length per angular bin (e.g., micrometers).
Length:
nAngleBins. Entrykcorresponds to the angular bin centered at(k + 0.5) * getAngleStepSize().- Returns:
- a non-null array
wof sizenAngleBins, wherew[k]is the total number of components in angular bink.
-
getAngularDistribution
public double[] getAngularDistribution(double rMin, double rMax) Returns the angular distribution obtained by summing only those radial bins whose ring centers fall within the half-open interval[rMin, rMax[.Units match
getAngularDistribution()(counts or calibrated length). The selection uses the center of each ring atstartRadius + (r+0.5)*step. This keeps binning stable and avoids partial-ring weighting. -
getPreferredDirection
public double getPreferredDirection(double rMin, double rMax) Convenience: preferred direction computed from a radial band[rMin,rMax). -
getPreferredOrientation
public double getPreferredOrientation(double rMin, double rMax) Convenience: preferred orientation computed from a radial band[rMin,rMax). -
findDirectionPeaks
public List<PolarProfileStats.PolarPeak> findDirectionPeaks(double rMin, double rMax, int maxPeaks, double minProminence) Finds up tomaxPeakslocal maxima in the direction (0–360°) distribution within a Sholl band. Peaks are detected after a small circular moving-average smoothing (window=3). Candidates must exceedminProminenceabove the mean of their two neighbors and are greedily selected with a minimum separation of2× angleStepSize.- Parameters:
rMin- the smallest Sholl radius to be consideredrMax- the largest Sholl radius to be consideredmaxPeaks- the number of peaks to be retrievedminProminence- Minimum required local prominence measured on the smoothed angular distribution s[k] (3-point circular moving average). Prominence is defined as s[k] - 0.5*(s[k-1] + s[k+1]) and has the same units as the underlying distribution: Intersections mode: counts per angular bin (dimensionless count); Length mode: calibrated length per angular bin (e.g., µm)- See Also:
-
findOrientationPeaks
public List<PolarProfileStats.PolarPeak> findOrientationPeaks(double rMin, double rMax, int maxPeaks, double minProminence) Finds up tomaxPeakslocal maxima in the orientation (0–180°) distribution within a Sholl band. Peaks are detected after a small circular moving-average smoothing (window=3). Candidates must exceedminProminenceabove the mean of their two neighbors and are greedily selected with a minimum separation of2× angleStepSize.- Parameters:
rMin- the smallest Sholl radius to be consideredrMax- the largest Sholl radius to be consideredmaxPeaks- the number of peaks to be retrievedminProminence- Minimum required local prominence measured on the smoothed angular distribution s[k] (3-point circular moving average). Prominence is defined as s[k] - 0.5*(s[k-1] + s[k+1]) and has the same units as the underlying distribution: Intersections mode: counts per angular bin (dimensionless count); Length mode: calibrated length per angular bin (e.g., µm)- See Also:
-
findDirectionPeaks
Automatically finds directional peaks (0–360°) over a Sholl radial band by deriving a data-driven prominence threshold (median + 1.5×MAD (Median Absolute Deviation), of local prominences after light smoothing) and applying a minimum separation of two angular bins. The number of returned peaks is the predicted number of meaningful directions in the band.- Parameters:
rMin- the smallest Sholl radius to be consideredrMax- the largest Sholl radius to be considered
-
findOrientationPeaks
Automatically finds orientation (0–180°) peaks over a radial band using the same settings used byfindDirectionPeaks(double, double).- Parameters:
rMin- the smallest Sholl radius to be consideredrMax- the largest Sholl radius to be considered
-
getReport
Returns a cached summary report of the analysis. Recomputed lazily whenever the underlying matrices change (on changing angle step, data mode, etc.). -
detailReport
WritesPolarProfileStats.Reportdetails to a table.- Parameters:
table- destination table (non-null)
-
appendSummaryReport
Appends summary data ofPolarProfileStats.Reportto the last row of the specified table Columns written:- Angular Distribution Coherence [0,1]
- Orientation Distribution Coherence [0,1]
- Preferred Direction in degrees [0,360[
- Preferred Orientation in degrees [0,180[
- Number of directional peaks
- Angle, Value of first two directional peaks
- Number of orientation peaks
- Angle, Value of first two orientation peaks
- Parameters:
table- the SNTTable to append to (must be non-null)
-
getAngularDistributionCoherence
public double getAngularDistributionCoherence()Convenience getter forPolarProfileStats.Report.adc()- Returns:
- direction distribution coherence ([0-1], unitless)
-
getOrientationDistributionCoherence
public double getOrientationDistributionCoherence()Convenience getter forPolarProfileStats.Report.odc()- Returns:
- orientation distribution coherence ([0-1], unitless)
-
getPreferredDirection
public double getPreferredDirection()Convenience getter forPolarProfileStats.Report.pd()- Returns:
- preferred direction in degrees, normalized to [0, 360[ degrees
-
getPreferredOrientation
public double getPreferredOrientation()Convenience getter forPolarProfileStats.Report.po()- Returns:
- preferred orientation in degrees, normalized to [0, 180[ degrees
-
getPlot
- Returns:
- The polar plot using default settings
-
getPlot
Returns the polar plot using the specified colormap.- Parameters:
colormap- the color name (e.g., "fire", "viridis", etc.)- Returns:
- The polar plot using default settings
- See Also:
-
getPlot
Returns the polar plot using the specified colormap.- Parameters:
colorTable- the colorTable. Ignored if null- Returns:
- The polar plot
- See Also:
-
getXValues
public double[] getXValues()- Specified by:
getXValuesin interfaceShollStats
-
getYValues
public double[] getYValues()- Specified by:
getYValuesin interfaceShollStats
-
getYValues
public double[] getYValues(boolean asCumulativeFrequencies) - Specified by:
getYValuesin interfaceShollStats
-
getFitYValues
public double[] getFitYValues()- Specified by:
getFitYValuesin interfaceShollStats
-
getFitYValues
public double[] getFitYValues(boolean asCumulativeFrequencies) - Specified by:
getFitYValuesin interfaceShollStats
-
validFit
public boolean validFit()- Specified by:
validFitin interfaceShollStats
-
getN
public int getN()- Specified by:
getNin interfaceShollStats
-
getProfile
- Specified by:
getProfilein interfaceShollStats
-