Class NormalizedProfileStats

java.lang.Object
org.scijava.AbstractContextual
org.scijava.command.ContextCommand
sc.fiji.snt.analysis.sholl.math.NormalizedProfileStats
All Implemented Interfaces:
Runnable, org.scijava.Cancelable, org.scijava.command.Command, org.scijava.Contextual, org.scijava.plugin.SciJavaPlugin, ShollStats

public class NormalizedProfileStats extends org.scijava.command.ContextCommand implements ShollStats
Calculates Sholl Metrics from normalized profiles, including Sholl decay and methods for determination of 'optimal' normalization. Relies heavily on the org.apache.commons.math3 package.
Author:
Tiago Ferreira
  • Field Details

    • UNASSIGNED_VALUE

      protected static final double UNASSIGNED_VALUE
      See Also:
    • inputRadii

      protected final double[] inputRadii
    • inputCounts

      protected final double[] inputCounts
    • profile

      protected final Profile profile
    • nPoints

      protected int nPoints
    • fCounts

      protected double[] fCounts
    • plot

      protected ShollPlot plot
    • logger

      protected Logger logger
  • Constructor Details

    • NormalizedProfileStats

      public NormalizedProfileStats(Profile profile, int normalizationFlag)
    • NormalizedProfileStats

      public NormalizedProfileStats(Profile profile, int normalizationFlag, int methodFlag)
    • NormalizedProfileStats

      public NormalizedProfileStats(Profile profile, ShollStats.DataMode dataMode, int normalizationFlag)
    • NormalizedProfileStats

      public NormalizedProfileStats(Profile profile, ShollStats.DataMode dataMode, int normalizationFlag, int methodFlag)
  • Method Details

    • getNormalizer

      public int getNormalizer()
    • getNormalizerDescription

      public String getNormalizerDescription()
    • getMethod

      public int getMethod()
    • getMethodDescription

      public String getMethodDescription()
    • resetRegression

      public void resetRegression()
    • getRegression

      public org.apache.commons.math3.stat.regression.SimpleRegression getRegression()
    • restrictRegToPercentile

      public void restrictRegToPercentile(double p1, double p2)
    • restrictRegToRange

      public void restrictRegToRange(double x1, double x2)
    • getRSquaredOfFit

      public double getRSquaredOfFit()
    • getR

      public double getR()
      Returns:
      Pearson's r
    • getIntercept

      public double getIntercept()
      Returns the intercept of the estimated regression line,
      Returns:
      the intercept of the regression line
    • getSlope

      public double getSlope()
    • getShollDecay

      public double getShollDecay()
    • getDeterminationRatio

      public double getDeterminationRatio()
    • is2Dnormalization

      public boolean is2Dnormalization()
    • is3Dnormalization

      public boolean is3Dnormalization()
    • getYValues

      public double[] getYValues()
      Returns the ordinates of the Semi-log/Log-log plot for sampled data.
      Specified by:
      getYValues in interface ShollStats
      Returns:
      normalized counts, ie, log(sampled intersections / normalizer)
    • validFit

      public boolean validFit()
      Checks if valid fitted data exists.
      Specified by:
      validFit in interface ShollStats
      Returns:
      true if polynomial fitted data exists
    • getXValues

      public double[] getXValues()
      Returns the abscissae of the Semi-log /Log-log plot for sampled data. Note that distances associated with zero intersections are removed from the input profile since log(0) is undefined.
      Specified by:
      getXValues in interface ShollStats
      Returns:
      sampled distances in the case of Semi-log analysis or their log transform in the case of Log-log analysis
    • getFitYValues

      public double[] getFitYValues()
      Specified by:
      getFitYValues in interface ShollStats
    • getNormalizerFlag

      public static int getNormalizerFlag(String string)
    • getMethodFlag

      public static int getMethodFlag(String string)
    • getKStestOfFit

      public double getKStestOfFit()
      Returns the two-sample Kolmogorov-Smirnov (K-S) test between the polynomial fit and sampled intersections as a measurement of goodness of fit.
      Returns:
      the test statistic (p-value) used to evaluate the null hypothesis that sampled data and polynomial fit represent samples drawn from the same probability distribution
      Throws:
      NullPointerException - if curve fitting has not been performed
      org.apache.commons.math3.exception.InsufficientDataException - if sampled data contains fewer than two data points
    • getPlot

      public ShollPlot getPlot(boolean cumulativeFrequencies)
    • getAdjustedRSquaredOfFit

      protected double getAdjustedRSquaredOfFit(int p)
    • getIndex

      protected int getIndex(double[] array, double value)
    • validateFit

      protected void validateFit()
    • debug

      protected void debug(Object msg)
    • setLogger

      public void setLogger(Logger logger)
    • setLogger

      public void setLogger(Logger logger, boolean debug)
    • setDebug

      public void setDebug(boolean debug)
    • setContext

      public void setContext(org.scijava.Context context)
      Specified by:
      setContext in interface org.scijava.Contextual
    • getYValues

      public double[] getYValues(boolean asCumulativeFrequencies)
      Specified by:
      getYValues in interface ShollStats
    • getN

      public int getN()
      Specified by:
      getN in interface ShollStats
    • getFitYValues

      public double[] getFitYValues(boolean asCumulativeFrequencies)
      Specified by:
      getFitYValues in interface ShollStats
    • getProfile

      public Profile getProfile()
      Specified by:
      getProfile in interface ShollStats
    • getDataMode

      public ShollStats.DataMode getDataMode()
      Specified by:
      getDataMode in interface ShollStats
    • setDataMode

      public void setDataMode(ShollStats.DataMode mode)
      Specified by:
      setDataMode in interface ShollStats
    • run

      public void run()
      Specified by:
      run in interface Runnable