1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #ifndef __fpa__Base__Mori__h__
7 #define __fpa__Base__Mori__h__
11 #include <itkConceptChecking.h>
12 #include <itkFunctionBase.h>
13 #include <ivq/ITK/PeakDetector.h>
14 #include <fpa/Config.h>
15 #include <fpa/Base/Functors/RegionGrow/BinaryThreshold.h>
23 template< class _TAlgorithm >
29 typedef _TAlgorithm Superclass;
30 typedef itk::SmartPointer< Self > Pointer;
31 typedef itk::SmartPointer< const Self > ConstPointer;
33 typedef typename _TAlgorithm::TTraits TTraits;
34 fpa_Base_TraitTypes( typename TTraits );
36 typedef std::deque< TNode > TQueue;
37 typedef std::set< TInputValue > TThresholds;
39 typedef ivq::ITK::PeakDetector TPeakDetector;
40 typedef TPeakDetector::TPeak TPeak;
42 typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
47 ( itk::Concept::IsUnsignedInteger< TOutputValue > )
50 itkGetConstMacro( InsideValue, TOutputValue );
51 itkSetMacro( InsideValue, TOutputValue );
53 itkGetConstMacro( MinimumThreshold, TInputValue );
54 itkSetMacro( MinimumThreshold, TInputValue );
57 virtual itk::ModifiedTimeType GetMTime( ) const override;
59 TOutputValue GetOutsideValue( ) const;
60 void SetOutsideValue( const TOutputValue& v );
62 unsigned long GetSignalKernelSize( ) const;
63 double GetSignalThreshold( ) const;
64 double GetSignalInfluence( ) const;
66 void SetSignalKernelSize( unsigned long k );
67 void SetSignalThreshold( double t );
68 void SetSignalInfluence( double i );
70 void ClearThresholds( );
71 void AddThreshold( const TInputValue& thr );
73 const TInputValue& init,
74 const TInputValue& end,
75 const TInputValue& delta
77 const TThresholds& GetThresholds( ) const;
78 unsigned long GetNumberOfEvaluatedThresholds( ) const;
79 TInputValue GetOptimumThreshold( ) const;
81 unsigned long i, double& x, double& y, TPeak& p
88 virtual void _BeforeGenerateData( ) override;
89 virtual void _FinishOneLoop( ) override;
90 virtual void _ComputeOutputValue( TNode& n ) override;
91 virtual void _UpdateOutputValue( TNode& n ) override;
92 virtual void _QueueClear( ) override;
93 virtual TNode _QueuePop( ) override;
94 virtual void _QueuePush( const TNode& node ) override;
95 virtual unsigned long _QueueSize( ) const override;
96 virtual void _PrepareSeeds( TNodes& nodes ) override;
99 // Purposely not implemented.
100 Mori( const Self& other );
101 Self& operator=( const Self& other );
104 typename TPredicate::Pointer m_Predicate;
106 TOutputValue m_InsideValue;
107 TInputValue m_MinimumThreshold;
108 TThresholds m_Thresholds;
109 typename TThresholds::const_iterator m_CurrThr;
111 TQueue m_Queues[ 2 ];
112 unsigned int m_CurrQueue;
115 TPeakDetector m_PeakDetector;
122 #ifndef ITK_MANUAL_INSTANTIATION
123 # include <fpa/Base/Mori.hxx>
124 #endif // ITK_MANUAL_INSTANTIATION
126 #endif // __fpa__Base__Mori__h__