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__
12 #include <itkConceptChecking.h>
13 #include <itkFunctionBase.h>
14 #include <fpa/Base/Functors/RegionGrow/BinaryThreshold.h>
22 template< class _TAlgorithm >
28 typedef _TAlgorithm Superclass;
29 typedef itk::SmartPointer< Self > Pointer;
30 typedef itk::SmartPointer< const Self > ConstPointer;
32 typedef typename _TAlgorithm::TNode TNode;
33 typedef typename _TAlgorithm::TNodes TNodes;
34 typedef typename _TAlgorithm::TInputValue TInputValue;
35 typedef typename _TAlgorithm::TOutputValue TOutputValue;
36 typedef typename _TAlgorithm::TFrontId TFrontId;
37 typedef typename _TAlgorithm::TVertex TVertex;
39 typedef std::deque< TNode > TQueue;
40 typedef std::set< TInputValue > TThresholds;
41 typedef std::pair< TInputValue, unsigned long > TSignalData;
42 typedef std::map< TFrontId, TSignalData > TSignal;
43 typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
48 ( itk::Concept::IsUnsignedInteger< TOutputValue > )
51 itkGetConstMacro( InsideValue, TOutputValue );
52 itkSetMacro( InsideValue, TOutputValue );
55 virtual itk::ModifiedTimeType GetMTime( ) const override;
57 TOutputValue GetOutsideValue( ) const;
58 void SetOutsideValue( const TOutputValue& v );
60 void ClearThresholds( );
61 void AddThreshold( const TInputValue& thr );
63 const TInputValue& init,
64 const TInputValue& end,
65 const TInputValue& delta
72 virtual void _BeforeGenerateData( ) override;
73 virtual void _AfterGenerateData( ) override;
74 virtual void _FinishOneLoop( ) override;
75 virtual bool _ComputeOutputValue( TNode& n ) override;
76 virtual void _QueueClear( ) override;
77 virtual TNode _QueuePop( ) override;
78 virtual void _QueuePush( const TNode& node ) override;
79 virtual unsigned long _QueueSize( ) const override;
80 virtual void _PrepareSeeds( TNodes& nodes ) override;
83 // Purposely not implemented.
84 Mori( const Self& other );
85 Self& operator=( const Self& other );
88 typename TPredicate::Pointer m_Predicate;
89 TThresholds m_Thresholds;
90 typename TThresholds::const_iterator m_CurrentThreshold;
92 unsigned int m_CurrentQueue;
93 unsigned long m_Count;
96 TOutputValue m_InsideValue;
103 #ifndef ITK_MANUAL_INSTANTIATION
104 # include <fpa/Base/Mori.hxx>
105 #endif // ITK_MANUAL_INSTANTIATION
107 #endif // __fpa__Base__Mori__h__