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__
10 #include <itkConceptChecking.h>
11 #include <fpa/Common/PeakDetector.h>
12 #include <fpa/Filters/Algorithm.h>
13 #include <fpa/Functors/RegionGrow/BinaryThreshold.h>
21 template< class _TTraits >
23 : public fpa::Filters::Algorithm< _TTraits >
26 typedef _TTraits TTraits;
27 fpaTraitsMacro( typename, TTraits );
29 typedef fpa::Filters::Algorithm< TTraits > Superclass;
31 typedef itk::SmartPointer< Self > Pointer;
32 typedef itk::SmartPointer< const Self > ConstPointer;
34 typedef std::deque< TNode > TQueue;
35 typedef std::set< TInputValue > TThresholds;
36 typedef fpa::Common::PeakDetector TPeakDetector;
37 typedef TPeakDetector::TPeak TPeak;
38 typedef fpa::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
43 ( itk::Concept::IsUnsignedInteger< TOutputValue > )
47 itkTypeMacro( fpa::Filters::Image::Mori, fpa::Filters::Algorithm );
49 itkGetConstMacro( InsideValue, TOutputValue );
50 itkSetMacro( InsideValue, TOutputValue );
52 itkGetConstMacro( MinimumThreshold, TInputValue );
53 itkSetMacro( MinimumThreshold, TInputValue );
56 TOutputValue GetOutsideValue( ) const;
57 void SetOutsideValue( const TOutputValue& v );
59 unsigned long GetSignalKernelSize( ) const;
60 void SetSignalKernelSize( unsigned long k );
62 double GetSignalThreshold( ) const;
63 void SetSignalThreshold( double t );
65 double GetSignalInfluence( ) const;
66 void SetSignalInfluence( double i );
68 void ClearThresholds( );
69 void AddThreshold( const TInputValue& thr );
71 const TInputValue& lower,
72 const TInputValue& upper,
73 const TInputValue& delta
75 const TThresholds& GetThresholds( ) const;
76 unsigned long GetNumberOfEvaluatedThresholds( ) const;
77 TInputValue GetOptimumThreshold( ) const;
79 unsigned long i, double& x, double& y, TPeak& p
86 virtual void _BeforeGenerateData( );
87 virtual void _Reinitialize( );
88 virtual void _UpdateOutputValue( TNode& n ) override;
89 virtual void _QueueClear( ) override;
90 virtual TNode _QueuePop( ) override;
91 virtual void _QueuePush( const TNode& n ) override;
92 virtual unsigned long _QueueSize( ) const override;
93 virtual void _ComputeOutputValue( TNode& n ) override;
96 // Purposely not implemented.
97 Mori( const Self& other );
98 Self& operator=( const Self& other );
101 typename TPredicate::Pointer m_Predicate;
103 TOutputValue m_InsideValue;
104 TInputValue m_MinimumThreshold;
105 TThresholds m_Thresholds;
106 typename TThresholds::const_iterator m_CurrThr;
108 TQueue m_Queues[ 2 ];
109 unsigned int m_CurrQueue;
112 TPeakDetector m_PeakDetector;
119 #ifndef ITK_MANUAL_INSTANTIATION
120 # include <fpa/Filters/Mori.hxx>
121 #endif // ITK_MANUAL_INSTANTIATION
122 #endif // __fpa__Filters__Mori__h__