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 );
37 typedef typename _TAlgorithm::TNode TNode;
38 typedef typename _TAlgorithm::TNodes TNodes;
39 typedef typename _TAlgorithm::TInputValue TInputValue;
40 typedef typename _TAlgorithm::TOutputValue TOutputValue;
41 typedef typename _TAlgorithm::TFrontId TFrontId;
42 typedef typename _TAlgorithm::TVertex TVertex;
45 typedef std::deque< TNode > TQueue;
46 typedef std::set< TInputValue > TThresholds;
48 typedef ivq::ITK::PeakDetector TPeakDetector;
49 typedef TPeakDetector::TPeak TPeak;
51 typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
56 ( itk::Concept::IsUnsignedInteger< TOutputValue > )
59 itkGetConstMacro( InsideValue, TOutputValue );
60 itkSetMacro( InsideValue, TOutputValue );
62 itkGetConstMacro( MinimumThreshold, TInputValue );
63 itkSetMacro( MinimumThreshold, TInputValue );
66 virtual itk::ModifiedTimeType GetMTime( ) const override;
68 TOutputValue GetOutsideValue( ) const;
69 void SetOutsideValue( const TOutputValue& v );
71 unsigned long GetSignalKernelSize( ) const;
72 double GetSignalThreshold( ) const;
73 double GetSignalInfluence( ) const;
75 void SetSignalKernelSize( unsigned long k );
76 void SetSignalThreshold( double t );
77 void SetSignalInfluence( double i );
79 void ClearThresholds( );
80 void AddThreshold( const TInputValue& thr );
82 const TInputValue& init,
83 const TInputValue& end,
84 const TInputValue& delta
86 const TThresholds& GetThresholds( ) const;
87 unsigned long GetNumberOfEvaluatedThresholds( ) const;
88 TInputValue GetOptimumThreshold( ) const;
90 unsigned long i, double& x, double& y, TPeak& p
97 virtual void _BeforeGenerateData( ) override;
98 virtual void _FinishOneLoop( ) override;
99 virtual void _ComputeOutputValue( TNode& n ) override;
100 virtual void _UpdateOutputValue( TNode& n ) override;
101 virtual void _QueueClear( ) override;
102 virtual TNode _QueuePop( ) override;
103 virtual void _QueuePush( const TNode& node ) override;
104 virtual unsigned long _QueueSize( ) const override;
105 virtual void _PrepareSeeds( TNodes& nodes ) override;
108 // Purposely not implemented.
109 Mori( const Self& other );
110 Self& operator=( const Self& other );
113 typename TPredicate::Pointer m_Predicate;
115 TOutputValue m_InsideValue;
116 TInputValue m_MinimumThreshold;
117 TThresholds m_Thresholds;
118 typename TThresholds::const_iterator m_CurrThr;
120 TQueue m_Queues[ 2 ];
121 unsigned int m_CurrQueue;
124 TPeakDetector m_PeakDetector;
131 #ifndef ITK_MANUAL_INSTANTIATION
132 # include <fpa/Base/Mori.hxx>
133 #endif // ITK_MANUAL_INSTANTIATION
135 #endif // __fpa__Base__Mori__h__