CESE 1.4.7

com.simulogic.dataview.analysis
Class ChannelStatsProxy

java.lang.Object
  extended by com.simulogic.dataview.analysis.ChannelStatsProxy

public class ChannelStatsProxy
extends java.lang.Object

This helper class improves performance of the batch statistics operations.

The performance of the statistics operations can be improved by caching some frequently used values instead of recalculating them from scratch every time. This class does exactly this transparently to user, it delegates (in most cases) the actual calculations to ChannelStats.

Note, that usage of this class is advantageous only when you are performing several consequitive statistics routines on the channel, if you need only one or two statistics parameters, you're probably better off with a direct call to ChannelStats.

This class is created with reuse in mind: you can reset its state by calling clear() instead of instantiating the object every time.


Constructor Summary
ChannelStatsProxy()
          Creates new ChannelStatsProxy
 
Method Summary
 void clear()
          Resets class state to the initial conditions
 double get10_90RiseTime(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the time for curve rise from 10 to 90%
 double get90_10DecayTime(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the time for curve decay from 90 to 10%
 double getAbsolutePeak(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the absolute peak value of a data sequence
 double getAbsolutePeakTime(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the absolute peak time of a data sequence
 double getAbsoluteSlope(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the maximum slope abs(delta(data)/delta(time)) index
 double getCurveArea(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the area under the curve of a data sequence.
 double getHalfWidthTime(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the half-width of curve in time units
 double getMaxSlope(double xMin, double xMax, int direction, DataChannel xChannel, DataChannel yChannel)
          Returns the maximum slope abs(delta(data)/delta(time)) value
 double getMaxSlopeTime(double xMin, double xMax, int direction, DataChannel xChannel, DataChannel yChannel)
          Returns the maximum slope abs(delta(data)/delta(time)) time
 double getMean(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the mean of a data sequence.
 double getN(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the number of data points between xMin and xMax for the given x channel / y channel pair
 double getNegativePeak(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the negative peak value of a data sequence
 double getNegativePeakTime(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the negative peak time of a data sequence
 double getPositivePeak(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the positive peak value of a data sequence
 double getPositivePeakTime(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the positive peak time of a data sequence
 double getStandardDeviation(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the standard deviation of a data sequence.
 double getStandardError(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the standard error of a data sequence.
 double getSumOfSquaredDeviations(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the sum of squared mean deviations of a data sequence.
 double getVariance(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the variance of a data sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelStatsProxy

public ChannelStatsProxy()
Creates new ChannelStatsProxy

Method Detail

clear

public void clear()
Resets class state to the initial conditions


getN

public final double getN(double xMin,
                         double xMax,
                         DataChannel xChannel,
                         DataChannel yChannel)
Returns the number of data points between xMin and xMax for the given x channel / y channel pair

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
number of data points between xMin and xMax

getMean

public final double getMean(double xMin,
                            double xMax,
                            DataChannel xChannel,
                            DataChannel yChannel)
Returns the mean of a data sequence. That is sum / size

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getVariance

public final double getVariance(double xMin,
                                double xMax,
                                DataChannel xChannel,
                                DataChannel yChannel)
Returns the variance of a data sequence. That is (sumOfSquares - mean*sum) / size with mean = sum/size

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getStandardDeviation

public final double getStandardDeviation(double xMin,
                                         double xMax,
                                         DataChannel xChannel,
                                         DataChannel yChannel)
Returns the standard deviation of a data sequence. That is Math.sqrt(variance)

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getStandardError

public final double getStandardError(double xMin,
                                     double xMax,
                                     DataChannel xChannel,
                                     DataChannel yChannel)
Returns the standard error of a data sequence. That is Math.sqrt(variance/size)

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getSumOfSquaredDeviations

public final double getSumOfSquaredDeviations(double xMin,
                                              double xMax,
                                              DataChannel xChannel,
                                              DataChannel yChannel)
Returns the sum of squared mean deviations of a data sequence. That is variance * (size-1) == Sum( (data[i] - mean)^2 )

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getNegativePeak

public final double getNegativePeak(double xMin,
                                    double xMax,
                                    DataChannel xChannel,
                                    DataChannel yChannel)
Returns the negative peak value of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getNegativePeakTime

public final double getNegativePeakTime(double xMin,
                                        double xMax,
                                        DataChannel xChannel,
                                        DataChannel yChannel)
Returns the negative peak time of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getPositivePeak

public final double getPositivePeak(double xMin,
                                    double xMax,
                                    DataChannel xChannel,
                                    DataChannel yChannel)
Returns the positive peak value of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getPositivePeakTime

public final double getPositivePeakTime(double xMin,
                                        double xMax,
                                        DataChannel xChannel,
                                        DataChannel yChannel)
Returns the positive peak time of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getAbsolutePeak

public final double getAbsolutePeak(double xMin,
                                    double xMax,
                                    DataChannel xChannel,
                                    DataChannel yChannel)
Returns the absolute peak value of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getAbsolutePeakTime

public final double getAbsolutePeakTime(double xMin,
                                        double xMax,
                                        DataChannel xChannel,
                                        DataChannel yChannel)
Returns the absolute peak time of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getCurveArea

public final double getCurveArea(double xMin,
                                 double xMax,
                                 DataChannel xChannel,
                                 DataChannel yChannel)
Returns the area under the curve of a data sequence.

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getMaxSlopeTime

public final double getMaxSlopeTime(double xMin,
                                    double xMax,
                                    int direction,
                                    DataChannel xChannel,
                                    DataChannel yChannel)
Returns the maximum slope abs(delta(data)/delta(time)) time

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
direction - search direction (to left or to right from the peak)
xChannel - x channel
yChannel - y channel
Returns:
int

getMaxSlope

public final double getMaxSlope(double xMin,
                                double xMax,
                                int direction,
                                DataChannel xChannel,
                                DataChannel yChannel)
Returns the maximum slope abs(delta(data)/delta(time)) value

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
direction - search direction (to left or to right from the p)
xChannel - x channel
yChannel - y channel
Returns:
int

getAbsoluteSlope

public final double getAbsoluteSlope(double xMin,
                                     double xMax,
                                     DataChannel xChannel,
                                     DataChannel yChannel)
Returns the maximum slope abs(delta(data)/delta(time)) index

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
slope

getHalfWidthTime

public final double getHalfWidthTime(double xMin,
                                     double xMax,
                                     DataChannel xChannel,
                                     DataChannel yChannel)
Returns the half-width of curve in time units

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
int

get10_90RiseTime

public final double get10_90RiseTime(double xMin,
                                     double xMax,
                                     DataChannel xChannel,
                                     DataChannel yChannel)
Returns the time for curve rise from 10 to 90%

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
int

get90_10DecayTime

public final double get90_10DecayTime(double xMin,
                                      double xMax,
                                      DataChannel xChannel,
                                      DataChannel yChannel)
Returns the time for curve decay from 90 to 10%

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
int

CESE 1.4.7

Copyright (c) 1999 - 2007 Cell Electrophysiology Simulation Environment (CESE). All rights reserved.