]> Creatis software - FrontAlgorithms.git/blobdiff - plugins/RegionGrowFunctors/BinaryThreshold.cxx
...
[FrontAlgorithms.git] / plugins / RegionGrowFunctors / BinaryThreshold.cxx
index 05010ab4974efd39bdf28d082e29b491dcbe711e..68882724a884a5b529177fe5402da189210764d2 100644 (file)
@@ -80,6 +80,7 @@ _GD0( _TImage* image )
 
     typename _TImage::SizeType r;
     r.Fill( this->m_Parameters.GetUint( "Radius" ) );
+
     _TInIt iIt( r, image, image->GetRequestedRegion( ) );
     double v_s1 = double( 0 );
     double v_s2 = double( 0 );
@@ -101,10 +102,15 @@ _GD0( _TImage* image )
       } // rof
 
     } // rof
+    double m = v_s1 / v_n;
     double s = ( v_s2 - ( ( v_s1 * v_s1 ) / v_n ) ) / ( v_n - double( 1 ) );
-    s = std::sqrt( s ) / double( 2 );
+    s = std::sqrt( s );
+    v_min = m - s;
+    v_max = m + s;
     f->SetLowerThreshold( v_min );
     f->SetUpperThreshold( v_max );
+    this->m_Parameters.SetReal( "LowerThreshold", f->GetLowerThreshold( ) );
+    this->m_Parameters.SetReal( "UpperThreshold", f->GetUpperThreshold( ) );
   }
   else
   {