1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__Mori__h__
6 #define __fpa__Filters__Mori__h__
8 #include <fpa/Config.h>
9 #include <fpa/Filters/QueueAlgorithm.h>
10 #include <fpa/Functors/RegionGrow/BinaryThreshold.h>
12 #include <ivq/ITK/PeakDetector.h>
20 template< class _TDataInterface >
22 : public fpa::Filters::QueueAlgorithm< _TDataInterface >
25 typedef _TDataInterface TDataInterface;
26 typedef fpa::Filters::QueueAlgorithm< TDataInterface > Superclass;
28 typedef itk::SmartPointer< Self > Pointer;
29 typedef itk::SmartPointer< const Self > ConstPointer;
31 typedef typename TDataInterface::TTraits TTraits;
32 fpaTraitsMacro( typename TTraits );
34 typedef std::set< TInputValue > TThresholds;
35 typedef ivq::ITK::PeakDetector TPeakDetector;
36 typedef TPeakDetector::TPeak TPeak;
37 typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
40 itkTypeMacro( fpa::Filters::Mori, fpa::Filters::QueueAlgorithm );
42 itkGetConstMacro( InsideValue, TOutputValue );
43 itkSetMacro( InsideValue, TOutputValue );
45 itkGetConstMacro( MinimumThreshold, TInputValue );
46 itkSetMacro( MinimumThreshold, TInputValue );
49 TOutputValue GetOutsideValue( ) const;
50 void SetOutsideValue( const TOutputValue& v );
52 unsigned long GetSignalKernelSize( ) const;
53 void SetSignalKernelSize( unsigned long k );
55 double GetSignalThreshold( ) const;
56 void SetSignalThreshold( double t );
58 double GetSignalInfluence( ) const;
59 void SetSignalInfluence( double i );
61 void ClearThresholds( );
62 void AddThreshold( const TInputValue& thr );
64 const TInputValue& lower,
65 const TInputValue& upper,
66 const TInputValue& delta
68 const TThresholds& GetThresholds( ) const;
69 unsigned long GetNumberOfEvaluatedThresholds( ) const;
70 TInputValue GetOptimumThreshold( ) const;
72 unsigned long i, double& x, double& y, TPeak& p
79 // Pipeline related methods
80 virtual void _BeforeGenerateData( ) override;
82 // Algoritm related methods
83 virtual void _PostComputeOutputValue( TNode& n ) override;
84 virtual void _PreComputeOutputValue( TNode& n ) override;
85 virtual void _Reinitialize( ) override;
88 Mori( const Self& other );
89 Self& operator=( const Self& other );
92 typename TPredicate::Pointer m_Predicate;
94 TOutputValue m_InsideValue;
95 TInputValue m_MinimumThreshold;
96 TThresholds m_Thresholds;
97 typename TThresholds::const_iterator m_CurrThr;
100 TPeakDetector m_PeakDetector;
107 #ifndef ITK_MANUAL_INSTANTIATION
108 # include <fpa/Filters/Mori.hxx>
109 #endif // ITK_MANUAL_INSTANTIATION
110 #endif // __fpa__Filters__Mori__h__