Basic Electrophysiology Relacs Plugins  0.9.8
Public Slots | Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DynamicSUSpikeDetector Class Reference

#include <dynamicsuspikedetector.h>

Inheritance diagram for DynamicSUSpikeDetector:
Inheritance graph
[legend]
Collaboration diagram for DynamicSUSpikeDetector:
Collaboration graph
[legend]

Public Slots

void customEvent (QEvent *qce)
 
void autoConfigure (void)
 
- Public Slots inherited from ConfigDialog
virtual void dialog (void)
 
virtual void help (void)
 
virtual void notifyDialog (const Options &opt)
 

Public Member Functions

 DynamicSUSpikeDetector (const string &ident="", int mode=0)
 
 ~DynamicSUSpikeDetector (void)
 
virtual int init (const InData &data, EventData &outevents, const EventList &other, const EventData &stimuli)
 
virtual void notify (void)
 
virtual int adjust (const InData &data)
 
virtual int autoConfigure (const InData &data, double tbegin, double tend)
 
virtual void save (const string &param)
 
void save (void)
 
virtual int detect (const InData &data, EventData &outevents, const EventList &other, const EventData &stimuli)
 
int checkEvent (InData::const_iterator first, InData::const_iterator last, InData::const_iterator event, InData::const_range_iterator eventtime, InData::const_iterator index, InData::const_range_iterator indextime, InData::const_iterator prevevent, InData::const_range_iterator prevtime, EventData &outevents, double &threshold, double &minthresh, double &maxthresh, double &time, double &size, double &width)
 
- Public Member Functions inherited from Filter
 Filter (const string &ident, int mode, FilterType type, int outtraces=0, const string &name="", const string &pluginset="", const string &author="unknown", const string &version="unknown", const string &date=__DATE__)
 
virtual ~Filter (void)
 
virtual int init (const InData &indata, InData &outdata)
 
virtual int init (const InList &indata, InList &outdata)
 
virtual int init (const EventData &inevents, InData &outdata)
 
virtual int init (const EventList &inevents, InList &outdata)
 
virtual int init (const InList &indata, EventList &outevents, const EventList &other, const EventData &stimuli)
 
virtual int init (const EventData &inevents, EventData &outevents, const EventList &other, const EventData &stimuli)
 
virtual int init (const EventList &inevents, EventList &outevents, const EventList &other, const EventData &stimuli)
 
virtual int adjust (const InData &indata, InData &outdata)
 
virtual int adjust (const InList &indata, InList &outdata)
 
virtual int adjust (const EventData &inevents, InData &outdata)
 
virtual int adjust (const EventList &inevents, InList &outdata)
 
virtual int adjust (const InList &indata)
 
virtual int adjust (const EventData &inevents)
 
virtual int adjust (const EventList &inevents)
 
virtual int autoConfigure (const InList &indata, double tbegin, double tend)
 
virtual int autoConfigure (const EventData &inevents, double tbegin, double tend)
 
virtual int autoConfigure (const EventList &inevents, double tbegin, double tend)
 
virtual int filter (const InData &indata, InData &outdata)
 
virtual int filter (const InList &indata, InList &outdata)
 
virtual int filter (const EventData &inevents, InData &outdata)
 
virtual int filter (const EventList &inevents, InList &outdata)
 
virtual int detect (const InList &data, EventList &outevents, const EventList &other, const EventData &stimuli)
 
virtual int detect (const EventData &inevents, EventData &outevents, const EventList &other, const EventData &stimuli)
 
virtual int detect (const EventList &inevents, EventList &outevents, const EventList &other, const EventData &stimuli)
 
void save (void)
 
const string & ident (void) const
 
virtual void setIdent (const string &ident)
 
virtual void setName (const string &name)
 
FilterType type (void) const
 
int outTraces (void) const
 
int mode (void) const
 
void setMode (int mode)
 
- Public Member Functions inherited from ConfigDialog
 ConfigDialog (const string &configident="", int configgroup=0, const string &name="", const string &author="", const string &version="", const string &date=__DATE__)
 
virtual ~ConfigDialog (void)
 
string name (void) const
 
string author (void) const
 
virtual void setAuthor (const string &author)
 
string version (void) const
 
virtual void setVersion (const string &version)
 
string date (void) const
 
virtual void setDate (const string &date)
 
virtual OptWidgetdialogOptions (OptDialog *od, string *tabhotkeys=0)
 
virtual void dialogButtons (OptDialog *od)
 
virtual void dialogEmptyMessage (OptDialog *od)
 
int dialogSelectMask (void) const
 
void setDialogSelectMask (int mask)
 
void addDialogSelectMask (int mask)
 
int dialogReadOnlyMask (void) const
 
void setDialogReadOnlyMask (int mask)
 
void addDialogReadOnlyMask (int mask)
 
int dialogStyle (void) const
 
void setDialogStyle (int style)
 
void addDialogStyle (int style)
 
string dialogCaption (void) const
 
void setDialogCaption (const string &caption)
 
bool dialogHeader (void) const
 
void setDialogHeader (bool d)
 
string headerBackgroundColor (void) const
 
void setHeaderBackgroundColor (const string &color)
 
string headerForegroundColor (void) const
 
void setHeaderForegroundColor (const string &color)
 
string headerImageFile (void) const
 
void setHeaderImageFile (const string &file)
 
virtual void dialogHeaderWidget (OptDialog *od)
 
bool dialogHelp (void) const
 
void setDialogHelp (bool d)
 
string helpCaption (void) const
 
void setHelpCaption (const string &caption)
 
string helpPath (int inx=0) const
 
int helpPathes (void) const
 
void clearHelpPathes (void)
 
void setHelpPath (const string &path)
 
void addHelpPath (const string &path)
 
virtual string helpFileName (void) const
 
bool dialogOpen (void) const
 
bool helpOpen (void) const
 
QWidget * mainWidget (void)
 
virtual void setMainWidget (QWidget *widget)
 
void lock () const
 
void unlock () const
 
bool tryLock (int timeout=1)
 
QMutex * mutex (void)
 
- Public Member Functions inherited from ConfigClass
 ConfigClass (const string &ident, int group=0, int mode=0xffff, int selectmask=0)
 
 ConfigClass (const ConfigClass &C)
 
virtual ~ConfigClass (void)
 
const string & configIdent (void) const
 
void setConfigIdent (const string &ident)
 
int configGroup (void) const
 
void setConfigGroup (int group)
 
int configMode (void) const
 
void setConfigMode (int mode)
 
void addConfigMode (int mode)
 
void delConfigMode (int mode)
 
int configSelectMask (void) const
 
void setConfigSelectMask (int mask)
 
void addConfig (void)
 
void readConfig (void)
 
virtual void readConfig (StrQueue &sq)
 
virtual void saveConfig (ofstream &str)
 
virtual int configSize (void) const
 
virtual void config (void)
 
virtual void preConfig (void)
 

Protected Attributes

Detector
< InData::const_iterator,
InData::const_range_iterator
D
 
double Threshold
 
double MinThresh
 
double MaxThresh
 
double MaxRangeThresh
 
double RecordingDelay
 
double RecordingDecay
 
double SearchDelay
 
double SearchDecay
 
bool TestWidth
 
double MaxWidth
 
bool TestInterval
 
double MinInterval
 
bool FitPeak
 
double FitWidth
 
int FitIndices
 
double Ratio
 
double NoSpikeInterval
 
bool StimulusRequired
 
bool LogHistogram
 
double UpdateTime
 
double HistoryTime
 
double QualityThresh
 
double TrendThresh
 
double TrendTime
 
double SizeResolution
 
OptWidget SDW
 
long LastSize
 
double LastTime
 
double StimulusEnd
 
double IntervalStart
 
double IntervalEnd
 
double IntervalWidth
 
QTime Update
 
PlotP
 
SampleDataD GoodSpikesHist
 
SampleDataD BadSpikesHist
 
SampleDataD AllSpikesHist
 
QPixmap GoodQuality
 
QPixmap OkQuality
 
QPixmap PotentialQuality
 
QPixmap BadQuality
 
QPixmap * QualityPixs [4]
 
int Quality
 
QLabel * QualityIndicator
 
QPixmap BadTrend
 
QPixmap OkTrend
 
QPixmap GoodTrend
 
QPixmap BadArrow
 
QPixmap GoodArrow
 
QPixmap * TrendPixs [5]
 
int Trend
 
QLabel * TrendIndicator
 
double LastSpikeSize
 
- Protected Attributes inherited from ConfigDialog
Options DialogOptions
 

Static Protected Attributes

static const int UpdateFlag = 8192
 

Additional Inherited Members

- Public Types inherited from Filter
enum  FilterType
 
- Public Types inherited from ConfigClass
enum  Action
 
- Signals inherited from ConfigDialog
void dialogAccepted (void)
 
void dialogAction (int r)
 
void dialogClosed (int r)
 
- Static Public Member Functions inherited from ConfigClass
static void setConfigureClasses (ConfigureClasses *cfg)
 
- Protected Slots inherited from ConfigDialog
void notificationFromDialog (const Parameter &p)
 
virtual void dClosed (int r)
 
virtual void hClosed (int r)
 
- Protected Member Functions inherited from ConfigDialog
void setDialogOpen (bool open=true)
 
void setHelpOpen (bool open=true)
 

Detailed Description

[Detector] A detector for spikes in single unit recordings.

Author
Jan Benda
Version
1.9 (Jun 21, 2010)
Options
  • Detector
  • minthresh=10mV: Minimum threshold (number)
  • threshold=10mV: Threshold (number)
  • delay=1sec: Delay time (number)
  • decay=10sec: Decay time constant (number)
  • searchdelay=1sec: Delay time for inbetween the recording sessions (number)
  • searchdecay=10sec: Decay time constant for inbetween the recording sessions (number)
  • ratio=50%: Ratio threshold / size (number)
  • testwidth=true: Test spike width (boolean)
  • maxwidth=1.5ms: Maximum spike width (number)
  • testisi=true: Test interspike interval (boolean)
  • minisi=1ms: Minimum interspike interval (number)
  • fitpeak=false: Fit parabula to peak of spike (boolean)
  • fitwidth=0.5ms: Width of parabula fit (number)
  • Running average
  • nospike=100ms: Interval for no spike (number)
  • considerstimulus=false: Expect spikes during stimuli only (boolean)
  • Indicators
  • resolution=0.5mV: Resolution of spike size (number)
  • log=false: Logarithmic histograms (boolean)
  • update=1sec: Update time interval (number)
  • history=10sec: Maximum history time (number)
  • qualitythresh=5%: Quality threshold (number)
  • trendthresh=1%: Trend threshold (number)
  • trendtime=1sec: Trend timescale (number)

Constructor & Destructor Documentation

DynamicSUSpikeDetector ( const string &  ident = "",
int  mode = 0 
)

The constructor.

References ConfigDialog::addDialogStyle(), OptWidget::assign(), DynamicSUSpikeDetector::autoConfigure(), DynamicSUSpikeDetector::BadArrow, DynamicSUSpikeDetector::BadQuality, DynamicSUSpikeDetector::BadTrend, ConfigDialog::dialog(), DynamicSUSpikeDetector::FitIndices, DynamicSUSpikeDetector::FitPeak, DynamicSUSpikeDetector::FitWidth, DynamicSUSpikeDetector::GoodArrow, DynamicSUSpikeDetector::GoodQuality, DynamicSUSpikeDetector::GoodTrend, DynamicSUSpikeDetector::HistoryTime, DynamicSUSpikeDetector::LastSize, DynamicSUSpikeDetector::LastTime, Plot::lock(), DynamicSUSpikeDetector::LogHistogram, DynamicSUSpikeDetector::MaxRangeThresh, DynamicSUSpikeDetector::MaxThresh, DynamicSUSpikeDetector::MaxWidth, DynamicSUSpikeDetector::MinInterval, DynamicSUSpikeDetector::MinThresh, ConfigDialog::mutex(), Plot::noGrid(), DynamicSUSpikeDetector::NoSpikeInterval, DynamicSUSpikeDetector::OkQuality, DynamicSUSpikeDetector::OkTrend, DynamicSUSpikeDetector::P, DynamicSUSpikeDetector::PotentialQuality, DynamicSUSpikeDetector::Quality, DynamicSUSpikeDetector::QualityIndicator, DynamicSUSpikeDetector::QualityPixs, DynamicSUSpikeDetector::QualityThresh, DynamicSUSpikeDetector::Ratio, DynamicSUSpikeDetector::RecordingDecay, DynamicSUSpikeDetector::RecordingDelay, DynamicSUSpikeDetector::SDW, DynamicSUSpikeDetector::SearchDecay, DynamicSUSpikeDetector::SearchDelay, ConfigClass::setConfigSelectMask(), ConfigDialog::setDialogSelectMask(), Plot::setLMarg(), OptWidget::setMargins(), Plot::setRMarg(), Plot::setTMarg(), OptWidget::setVerticalSpacing(), Plot::setXLabel(), Plot::setXLabelPos(), Plot::setXTics(), Plot::setYLabel(), Plot::setYRange(), DynamicSUSpikeDetector::SizeResolution, DynamicSUSpikeDetector::StimulusRequired, DynamicSUSpikeDetector::TestInterval, DynamicSUSpikeDetector::TestWidth, DynamicSUSpikeDetector::Threshold, DynamicSUSpikeDetector::Trend, DynamicSUSpikeDetector::TrendIndicator, DynamicSUSpikeDetector::TrendPixs, DynamicSUSpikeDetector::TrendThresh, DynamicSUSpikeDetector::TrendTime, Plot::unlock(), DynamicSUSpikeDetector::Update, and DynamicSUSpikeDetector::UpdateTime.

The destructor.

Member Function Documentation

int init ( const InData data,
EventData outevents,
const EventList other,
const EventData stimuli 
)
virtual
void notify ( void  )
virtual
int adjust ( const InData data)
virtual
int autoConfigure ( const InData data,
double  tbegin,
double  tend 
)
virtual

Reimplemented from Filter.

References DynamicSUSpikeDetector::autoConfigure().

void save ( const string &  param)
virtual

Reimplemented from Filter.

References DynamicSUSpikeDetector::save().

void save ( void  )
int detect ( const InData data,
EventData outevents,
const EventList other,
const EventData stimuli 
)
virtual

Detect spikes in a single trace of the analog data data.

Reimplemented from Filter.

References DynamicSUSpikeDetector::AllSpikesHist, EventData::back(), EventData::backWidth(), Detector< DataIter, TimeIter >::badEvents(), DynamicSUSpikeDetector::BadSpikesHist, Plot::clear(), EventData::count(), DynamicSUSpikeDetector::D, Plot::draw(), Detector< DataIter, TimeIter >::dynamicPeakHist(), InData::end(), DynamicSUSpikeDetector::FitIndices, DynamicSUSpikeDetector::FitWidth, Detector< DataIter, TimeIter >::goodEvents(), DynamicSUSpikeDetector::GoodSpikesHist, DynamicSUSpikeDetector::HistoryTime, InData::indices(), InData::interval(), DynamicSUSpikeDetector::IntervalEnd, DynamicSUSpikeDetector::IntervalStart, DynamicSUSpikeDetector::IntervalWidth, DynamicSUSpikeDetector::LastSize, DynamicSUSpikeDetector::LastSpikeSize, DynamicSUSpikeDetector::LastTime, Plot::lock(), log(), DynamicSUSpikeDetector::LogHistogram, DynamicSUSpikeDetector::MaxRangeThresh, DynamicSUSpikeDetector::MaxThresh, EventData::meanRate(), EventData::meanSize(), InData::minBegin(), DynamicSUSpikeDetector::MinThresh, DynamicSUSpikeDetector::NoSpikeInterval, Plot::noYTics(), DynamicSUSpikeDetector::P, Plot::plot(), Plot::plotVLine(), SampleData< T >::pos(), DynamicSUSpikeDetector::Quality, DynamicSUSpikeDetector::QualityThresh, DynamicSUSpikeDetector::RecordingDecay, DynamicSUSpikeDetector::RecordingDelay, DynamicSUSpikeDetector::SDW, DynamicSUSpikeDetector::SearchDecay, DynamicSUSpikeDetector::SearchDelay, EventData::setMeanRatio(), Plot::setXRange(), Plot::setYTics(), EventData::size(), SampleData< T >::size(), EventData::sizeHist(), DynamicSUSpikeDetector::StimulusEnd, DynamicSUSpikeDetector::StimulusRequired, sum(), DynamicSUSpikeDetector::Threshold, DynamicSUSpikeDetector::Trend, DynamicSUSpikeDetector::TrendThresh, DynamicSUSpikeDetector::TrendTime, Plot::unlock(), DynamicSUSpikeDetector::Update, EventData::updateMean(), DynamicSUSpikeDetector::UpdateTime, OptWidget::updateValues(), and Plot::zoomedXRange().

int checkEvent ( InData::const_iterator  first,
InData::const_iterator  last,
InData::const_iterator  event,
InData::const_range_iterator  eventtime,
InData::const_iterator  index,
InData::const_range_iterator  indextime,
InData::const_iterator  prevevent,
InData::const_range_iterator  prevtime,
EventData outevents,
double &  threshold,
double &  minthresh,
double &  maxthresh,
double &  time,
double &  size,
double &  width 
)
void customEvent ( QEvent *  qce)
slot
void autoConfigure ( void  )
slot

Member Data Documentation

double Threshold
protected
double MinThresh
protected
double MaxThresh
protected

Maximum value for the threshold detecting spikes.

Referenced by DynamicSUSpikeDetector::detect(), DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

double MaxRangeThresh
protected

Maximum value for the threshold detecting spikes according to the input range.

Referenced by DynamicSUSpikeDetector::adjust(), DynamicSUSpikeDetector::detect(), and DynamicSUSpikeDetector::DynamicSUSpikeDetector().

double RecordingDelay
protected
double RecordingDecay
protected

Decay time constant of the threshold dynamics in seconds.

Referenced by DynamicSUSpikeDetector::detect(), DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

double SearchDelay
protected
double SearchDecay
protected

Decay time constant of the threshold dynamics in seconds.

Referenced by DynamicSUSpikeDetector::detect(), DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

bool TestWidth
protected
double MaxWidth
protected
bool TestInterval
protected
double MinInterval
protected
bool FitPeak
protected
double FitWidth
protected
int FitIndices
protected

Width of the parabula fit in indices of the input trace.

Referenced by DynamicSUSpikeDetector::checkEvent(), DynamicSUSpikeDetector::detect(), and DynamicSUSpikeDetector::DynamicSUSpikeDetector().

double Ratio
protected

Ratio of the spike size to which the new value of the threshold is set.

Referenced by DynamicSUSpikeDetector::checkEvent(), DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

double NoSpikeInterval
protected

If no spikes are detected, update statistic assuming that a single spike did not occur within NoSpikeInterval.

Referenced by DynamicSUSpikeDetector::detect(), DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

bool StimulusRequired
protected
bool LogHistogram
protected
double UpdateTime
protected
double HistoryTime
protected
double QualityThresh
protected

Threshold for quality indicator (fraction of overlap).

Referenced by DynamicSUSpikeDetector::detect(), DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

double TrendThresh
protected

Threshold for trend indicator relative to spike size.

Referenced by DynamicSUSpikeDetector::detect(), DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

double TrendTime
protected
double SizeResolution
protected

Resolution of spike sizes and thresholds.

Referenced by DynamicSUSpikeDetector::DynamicSUSpikeDetector(), and DynamicSUSpikeDetector::notify().

OptWidget SDW
protected
const int UpdateFlag = 8192
staticprotected
long LastSize
protected
double LastTime
protected
double StimulusEnd
protected
double IntervalStart
protected
double IntervalEnd
protected
double IntervalWidth
protected
QTime Update
protected
Plot* P
protected
SampleDataD GoodSpikesHist
protected
SampleDataD BadSpikesHist
protected
SampleDataD AllSpikesHist
protected
QPixmap GoodQuality
protected
QPixmap OkQuality
protected
QPixmap PotentialQuality
protected
QPixmap BadQuality
protected
QPixmap* QualityPixs[4]
protected
int Quality
protected
QLabel* QualityIndicator
protected
QPixmap BadTrend
protected
QPixmap OkTrend
protected
QPixmap GoodTrend
protected
QPixmap BadArrow
protected
QPixmap GoodArrow
protected
QPixmap* TrendPixs[5]
protected
int Trend
protected
QLabel* TrendIndicator
protected
double LastSpikeSize
protected

The documentation for this class was generated from the following files: