Package sc.fiji.snt.analysis.sholl.math
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface sc.fiji.snt.analysis.sholl.math.ShollStats
ShollStats.DataMode -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double[]protected final double[]protected final double[]protected Loggerprotected intprotected ShollPlotprotected final Profileprotected static final doubleFields 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
ConstructorsConstructorDescriptionNormalizedProfileStats(Profile profile, int normalizationFlag) NormalizedProfileStats(Profile profile, int normalizationFlag, int methodFlag) NormalizedProfileStats(Profile profile, ShollStats.DataMode dataMode, int normalizationFlag) NormalizedProfileStats(Profile profile, ShollStats.DataMode dataMode, int normalizationFlag, int methodFlag) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected doublegetAdjustedRSquaredOfFit(int p) doubledouble[]double[]getFitYValues(boolean asCumulativeFrequencies) protected intgetIndex(double[] array, double value) doubleReturns the intercept of the estimated regression line,doubleReturns the two-sample Kolmogorov-Smirnov (K-S) test between the polynomial fit and sampled intersections as a measurement of goodness of fit.intstatic intgetMethodFlag(String string) intgetN()intstatic intgetNormalizerFlag(String string) getPlot(boolean cumulativeFrequencies) doublegetR()Returns Pearson's product moment correlation coefficient, usually denoted r.org.apache.commons.math3.stat.regression.SimpleRegressiondoubledoubledoublegetSlope()double[]Returns the abscissae of the Semi-log /Log-log plot for sampled data.double[]Returns the ordinates of the Semi-log/Log-log plot for sampled data.double[]getYValues(boolean asCumulativeFrequencies) booleanbooleanvoidvoidrestrictRegToPercentile(double p1, double p2) voidrestrictRegToRange(double x1, double x2) voidrun()voidsetContext(org.scijava.Context context) voidvoidsetDebug(boolean debug) voidvoidprotected voidbooleanvalidFit()Checks if valid fitted data exists.Methods inherited from class org.scijava.command.ContextCommand
cancel, getCancelReason, isCanceledMethods inherited from class org.scijava.AbstractContextual
context, getContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface sc.fiji.snt.analysis.sholl.math.ShollStats
getDataMode, getFitYValues, getN, getProfile, getYValues, setDataMode
-
Field Details
-
UNASSIGNED_VALUE
protected static final double UNASSIGNED_VALUE- See Also:
-
inputRadii
protected final double[] inputRadii -
inputCounts
protected final double[] inputCounts -
profile
-
nPoints
protected int nPoints -
fCounts
protected double[] fCounts -
plot
-
logger
-
-
Constructor Details
-
NormalizedProfileStats
-
NormalizedProfileStats
-
NormalizedProfileStats
-
NormalizedProfileStats
public NormalizedProfileStats(Profile profile, ShollStats.DataMode dataMode, int normalizationFlag, int methodFlag)
-
-
Method Details
-
getNormalizer
public int getNormalizer() -
getNormalizerDescription
-
getMethod
public int getMethod() -
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 product moment correlation coefficient, usually denoted r.- 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:
getYValuesin interfaceShollStats- Returns:
- normalized counts, ie, log(sampled intersections / normalizer)
-
validFit
public boolean validFit()Checks if valid fitted data exists.- Specified by:
validFitin interfaceShollStats- Returns:
trueif 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:
getXValuesin interfaceShollStats- 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:
getFitYValuesin interfaceShollStats
-
getNormalizerFlag
-
getMethodFlag
-
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 performedorg.apache.commons.math3.exception.InsufficientDataException- if sampled data contains fewer than two data points
-
getPlot
-
getAdjustedRSquaredOfFit
protected double getAdjustedRSquaredOfFit(int p) -
getIndex
protected int getIndex(double[] array, double value) -
validateFit
protected void validateFit() -
debug
-
setLogger
-
setLogger
-
setDebug
public void setDebug(boolean debug) -
setContext
public void setContext(org.scijava.Context context) - Specified by:
setContextin interfaceorg.scijava.Contextual
-
getYValues
public double[] getYValues(boolean asCumulativeFrequencies) - Specified by:
getYValuesin interfaceShollStats
-
getN
public int getN()- Specified by:
getNin interfaceShollStats
-
getFitYValues
public double[] getFitYValues(boolean asCumulativeFrequencies) - Specified by:
getFitYValuesin interfaceShollStats
-
getProfile
- Specified by:
getProfilein interfaceShollStats
-
getDataMode
- Specified by:
getDataModein interfaceShollStats
-
setDataMode
- Specified by:
setDataModein interfaceShollStats
-
run
public void run()
-