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/Common/PeakDetector.h>
10 #include <fpa/Filters/QueueAlgorithm.h>
11 #include <fpa/Functors/RegionGrow/BinaryThreshold.h>
19 template< class _TDataInterface >
21 : public fpa::Filters::QueueAlgorithm< _TDataInterface >
24 typedef _TDataInterface TDataInterface;
25 typedef fpa::Filters::QueueAlgorithm< TDataInterface > Superclass;
27 typedef itk::SmartPointer< Self > Pointer;
28 typedef itk::SmartPointer< const Self > ConstPointer;
30 typedef typename TDataInterface::TTraits TTraits;
31 fpaTraitsMacro( typename TTraits );
33 typedef std::set< TInputValue > TThresholds;
34 typedef fpa::Common::PeakDetector TPeakDetector;
35 typedef TPeakDetector::TPeak TPeak;
36 typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
39 itkTypeMacro( fpa::Filters::Mori, fpa::Filters::QueueAlgorithm );
41 itkGetConstMacro( InsideValue, TOutputValue );
42 itkSetMacro( InsideValue, TOutputValue );
44 itkGetConstMacro( MinimumThreshold, TInputValue );
45 itkSetMacro( MinimumThreshold, TInputValue );
48 TOutputValue GetOutsideValue( ) const;
49 void SetOutsideValue( const TOutputValue& v );
51 unsigned long GetSignalKernelSize( ) const;
52 void SetSignalKernelSize( unsigned long k );
54 double GetSignalThreshold( ) const;
55 void SetSignalThreshold( double t );
57 double GetSignalInfluence( ) const;
58 void SetSignalInfluence( double i );
60 void ClearThresholds( );
61 void AddThreshold( const TInputValue& thr );
63 const TInputValue& lower,
64 const TInputValue& upper,
65 const TInputValue& delta
67 const TThresholds& GetThresholds( ) const;
68 unsigned long GetNumberOfEvaluatedThresholds( ) const;
69 TInputValue GetOptimumThreshold( ) const;
71 unsigned long i, double& x, double& y, TPeak& p
78 // Pipeline related methods
79 virtual void _BeforeGenerateData( ) override;
81 // Algoritm related methods
82 virtual void _PostComputeOutputValue( TNode& n ) override;
83 virtual void _PreComputeOutputValue( TNode& n ) override;
84 virtual void _Reinitialize( ) override;
87 Mori( const Self& other );
88 Self& operator=( const Self& other );
91 typename TPredicate::Pointer m_Predicate;
93 TOutputValue m_InsideValue;
94 TInputValue m_MinimumThreshold;
95 TThresholds m_Thresholds;
96 typename TThresholds::const_iterator m_CurrThr;
99 TPeakDetector m_PeakDetector;
106 #ifndef ITK_MANUAL_INSTANTIATION
107 # include <fpa/Filters/Mori.hxx>
108 #endif // ITK_MANUAL_INSTANTIATION
109 #endif // __fpa__Filters__Mori__h__