]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/Base/Mori.hxx
...
[FrontAlgorithms.git] / lib / fpa / Base / Mori.hxx
index 17415e772bae2eba47f4fb777f2b4a6be1e1d7d4..7a1df9a854107f0f30e880edc926a5dc9345294d 100644 (file)
@@ -97,6 +97,11 @@ Mori( )
   this->SetInitValue( TOutputValue( 0 ) );
   this->m_Predicate = TPredicate::New( );
   this->m_Predicate->StrictOff( );
+
+  if( std::numeric_limits< TInputValue >::is_integer )
+    this->m_MinimumThreshold = std::numeric_limits< TInputValue >::min( );
+  else
+    this->m_MinimumThreshold = -std::numeric_limits< TInputValue >::max( );
 }
 
 // -------------------------------------------------------------------------
@@ -218,7 +223,7 @@ _FinishOneLoop( )
       this->m_Count = 0;
 
       // Peak detected? -> stop!
-      if( this->m_SignalPeaks.back( ) == 1 )
+      if( this->m_SignalPeaks.back( ) == 1 && this->m_MinimumThreshold < *( this->m_CurrentThreshold ) )
         this->_QueueClear( );
     }
     else