]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Mori.h
...
[FrontAlgorithms.git] / lib / fpa / Base / Mori.h
index 430ff03ae5bc222da3ac1547efab3e0074554006..0cc7a248410458bfe45573458e4cbb3b0e7ec270 100644 (file)
@@ -10,6 +10,8 @@
 #include <set>
 #include <itkConceptChecking.h>
 #include <itkFunctionBase.h>
+#include <ivq/ITK/PeakDetector.h>
+#include <fpa/Config.h>
 #include <fpa/Base/Functors/RegionGrow/BinaryThreshold.h>
 
 namespace fpa
@@ -28,15 +30,15 @@ namespace fpa
       typedef itk::SmartPointer< Self >       Pointer;
       typedef itk::SmartPointer< const Self > ConstPointer;
 
-      typedef typename _TAlgorithm::TNode        TNode;
-      typedef typename _TAlgorithm::TNodes       TNodes;
-      typedef typename _TAlgorithm::TInputValue  TInputValue;
-      typedef typename _TAlgorithm::TOutputValue TOutputValue;
-      typedef typename _TAlgorithm::TFrontId     TFrontId;
-      typedef typename _TAlgorithm::TVertex      TVertex;
+      typedef typename _TAlgorithm::TTraits TTraits;
+      fpa_Base_TraitTypes( typename TTraits );
 
       typedef std::deque< TNode >     TQueue;
       typedef std::set< TInputValue > TThresholds;
+
+      typedef ivq::ITK::PeakDetector TPeakDetector;
+      typedef TPeakDetector::TPeak   TPeak;
+
       typedef fpa::Base::Functors::RegionGrow::BinaryThreshold< TInputValue > TPredicate;
 
     public:
@@ -48,25 +50,45 @@ namespace fpa
       itkGetConstMacro( InsideValue, TOutputValue );
       itkSetMacro( InsideValue, TOutputValue );
 
+      itkGetConstMacro( MinimumThreshold, TInputValue );
+      itkSetMacro( MinimumThreshold, TInputValue );
+
     public:
       virtual itk::ModifiedTimeType GetMTime( ) const override;
 
       TOutputValue GetOutsideValue( ) const;
       void SetOutsideValue( const TOutputValue& v );
 
+      unsigned long GetSignalKernelSize( ) const;
+      double GetSignalThreshold( ) const;
+      double GetSignalInfluence( ) const;
+
+      void SetSignalKernelSize( unsigned long k );
+      void SetSignalThreshold( double t );
+      void SetSignalInfluence( double i );
+
       void ClearThresholds( );
       void AddThreshold( const TInputValue& thr );
       void SetThresholds(
         const TInputValue& init,
         const TInputValue& end,
-        unsigned long number_of_thresholds
+        const TInputValue& delta
         );
+      const TThresholds& GetThresholds( ) const;
+      unsigned long GetNumberOfEvaluatedThresholds( ) const;
+      TInputValue GetOptimumThreshold( ) const;
+      void GetSignalValues(
+        unsigned long i, double& x, double& y, TPeak& p
+        ) const;
 
     protected:
       Mori( );
       virtual ~Mori( );
 
-      virtual TOutputValue _ComputeOutputValue( const TNode& n ) override;
+      virtual void _BeforeGenerateData( ) override;
+      virtual void _FinishOneLoop( ) override;
+      virtual void _ComputeOutputValue( TNode& n ) override;
+      virtual void _UpdateOutputValue( TNode& n ) override;
       virtual void _QueueClear( ) override;
       virtual TNode _QueuePop( ) override;
       virtual void _QueuePush( const TNode& node ) override;
@@ -80,22 +102,26 @@ namespace fpa
 
     protected:
       typename TPredicate::Pointer m_Predicate;
-      TThresholds m_Thresholds;
-      TQueue m_Queues[ 2 ];
-      unsigned int m_CurrentQueue;
 
       TOutputValue m_InsideValue;
+      TInputValue  m_MinimumThreshold;
+      TThresholds  m_Thresholds;
+      typename TThresholds::const_iterator m_CurrThr;
+
+      TQueue       m_Queues[ 2 ];
+      unsigned int m_CurrQueue;
+      double       m_CurrCount;
+
+      TPeakDetector m_PeakDetector;
     };
 
   } // ecapseman
 
 } // ecapseman
 
-/* TODO
-   #ifndef ITK_MANUAL_INSTANTIATION
-   #  include <fpa/Base/Mori.hxx>
-   #endif // ITK_MANUAL_INSTANTIATION
-*/
+#ifndef ITK_MANUAL_INSTANTIATION
+#  include <fpa/Base/Mori.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
 
 #endif // __fpa__Base__Mori__h__