// @email florez-l@javeriana.edu.co
// =========================================================================
-// https://stackoverflow.com/questions/22583391/peak-signal-detection-in-realtime-timeseries-data
-
-
#ifndef __fpa__Base__Mori__h__
#define __fpa__Base__Mori__h__
#include <deque>
#include <set>
-#include <vector>
#include <itkConceptChecking.h>
#include <itkFunctionBase.h>
-#include <fpa/Generic/PeakDetector.h>
+#include <ivq/ITK/PeakDetector.h>
#include <fpa/Base/Functors/RegionGrow/BinaryThreshold.h>
namespace fpa
typedef std::deque< TNode > TQueue;
typedef std::set< TInputValue > TThresholds;
- typedef std::pair< TInputValue, unsigned long > TSignalData;
- typedef std::vector< TSignalData > TSignal;
- typedef fpa::Generic::PeakDetector TPeakDetector;
+ typedef ivq::ITK::PeakDetector TPeakDetector;
+ typedef TPeakDetector::TPeak TPeak;
+
typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
public:
);
itkGetConstMacro( InsideValue, TOutputValue );
- itkGetConstMacro( MinimumThreshold, TInputValue );
-
itkSetMacro( InsideValue, TOutputValue );
- itkSetMacro( MinimumThreshold, TInputValue );
-
- itkGetConstReferenceMacro( Signal, TSignal );
- itkGetConstMacro( SignalLag, unsigned long );
- itkGetConstMacro( SignalThreshold, double );
- itkGetConstMacro( SignalInfluence, double );
- itkSetMacro( SignalLag, unsigned long );
- itkSetMacro( SignalThreshold, double );
- itkSetMacro( SignalInfluence, double );
+ itkGetConstMacro( MinimumThreshold, TInputValue );
+ itkSetMacro( MinimumThreshold, TInputValue );
public:
virtual itk::ModifiedTimeType GetMTime( ) const override;
TOutputValue GetOutsideValue( ) const;
void SetOutsideValue( const TOutputValue& v );
+ unsigned long GetSignalKernelSize( ) const;
+ double GetSignalThreshold( ) const;
+ double GetSignalInfluence( ) const;
+
+ void SetSignalKernelSize( unsigned long k );
+ void SetSignalThreshold( double t );
+ void SetSignalInfluence( double i );
+
void ClearThresholds( );
void AddThreshold( const TInputValue& thr );
void SetThresholds(
const TInputValue& end,
const TInputValue& delta
);
+ const TThresholds& GetThresholds( ) const;
unsigned long GetNumberOfEvaluatedThresholds( ) const;
TInputValue GetOptimumThreshold( ) const;
+ void GetSignalValues(
+ unsigned long i, double& x, double& y, TPeak& p
+ ) const;
protected:
Mori( );
protected:
typename TPredicate::Pointer m_Predicate;
- TThresholds m_Thresholds;
- typename TThresholds::const_iterator m_CurrentThreshold;
- TQueue m_Queues[ 2 ];
- unsigned int m_CurrentQueue;
- unsigned long m_Count;
- TPeakDetector m_PeakDetector;
+ TOutputValue m_InsideValue;
+ TInputValue m_MinimumThreshold;
+ TThresholds m_Thresholds;
+ typename TThresholds::const_iterator m_CurrThr;
- TSignal m_Signal;
- unsigned long m_SignalLag;
- double m_SignalThreshold;
- double m_SignalInfluence;
- std::vector< double > m_FilteredSignal;
- std::vector< double > m_SignalAverages;
- std::vector< double > m_SignalDeviations;
- std::vector< short > m_SignalPeaks;
- double m_CurrentAverage;
- double m_CurrentVariance;
+ TQueue m_Queues[ 2 ];
+ unsigned int m_CurrQueue;
+ double m_CurrCount;
- TInputValue m_MinimumThreshold;
- TOutputValue m_InsideValue;
+ TPeakDetector m_PeakDetector;
};
} // ecapseman