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>
14 #include <ivq/ITK/PeakDetector.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::TNode TNode;
34 typedef typename _TAlgorithm::TNodes TNodes;
35 typedef typename _TAlgorithm::TInputValue TInputValue;
36 typedef typename _TAlgorithm::TOutputValue TOutputValue;
37 typedef typename _TAlgorithm::TFrontId TFrontId;
38 typedef typename _TAlgorithm::TVertex TVertex;
40 typedef std::deque< TNode > TQueue;
41 typedef std::set< TInputValue > TThresholds;
43 typedef ivq::ITK::PeakDetector TPeakDetector;
44 typedef TPeakDetector::TPeak TPeak;
46 typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
51 ( itk::Concept::IsUnsignedInteger< TOutputValue > )
54 itkGetConstMacro( InsideValue, TOutputValue );
55 itkSetMacro( InsideValue, TOutputValue );
57 itkGetConstMacro( MinimumThreshold, TInputValue );
58 itkSetMacro( MinimumThreshold, TInputValue );
61 virtual itk::ModifiedTimeType GetMTime( ) const override;
63 TOutputValue GetOutsideValue( ) const;
64 void SetOutsideValue( const TOutputValue& v );
66 unsigned long GetSignalKernelSize( ) const;
67 double GetSignalThreshold( ) const;
68 double GetSignalInfluence( ) const;
70 void SetSignalKernelSize( unsigned long k );
71 void SetSignalThreshold( double t );
72 void SetSignalInfluence( double i );
74 void ClearThresholds( );
75 void AddThreshold( const TInputValue& thr );
77 const TInputValue& init,
78 const TInputValue& end,
79 const TInputValue& delta
81 const TThresholds& GetThresholds( ) const;
82 unsigned long GetNumberOfEvaluatedThresholds( ) const;
83 TInputValue GetOptimumThreshold( ) const;
85 unsigned long i, double& x, double& y, TPeak& p
92 virtual void _BeforeGenerateData( ) override;
93 virtual void _FinishOneLoop( ) override;
94 virtual void _ComputeOutputValue( TNode& n ) override;
95 virtual void _UpdateOutputValue( TNode& n ) override;
96 virtual void _QueueClear( ) override;
97 virtual TNode _QueuePop( ) override;
98 virtual void _QueuePush( const TNode& node ) override;
99 virtual unsigned long _QueueSize( ) const override;
100 virtual void _PrepareSeeds( TNodes& nodes ) override;
103 // Purposely not implemented.
104 Mori( const Self& other );
105 Self& operator=( const Self& other );
108 typename TPredicate::Pointer m_Predicate;
110 TOutputValue m_InsideValue;
111 TInputValue m_MinimumThreshold;
112 TThresholds m_Thresholds;
113 typename TThresholds::const_iterator m_CurrThr;
115 TQueue m_Queues[ 2 ];
116 unsigned int m_CurrQueue;
119 TPeakDetector m_PeakDetector;
126 #ifndef ITK_MANUAL_INSTANTIATION
127 # include <fpa/Base/Mori.hxx>
128 #endif // ITK_MANUAL_INSTANTIATION
130 #endif // __fpa__Base__Mori__h__