]> Creatis software - FrontAlgorithms.git/blobdiff - tests/image/MoriSegmentation.cxx
...
[FrontAlgorithms.git] / tests / image / MoriSegmentation.cxx
index 7a84a5e467cab0dec20ec7701a2e9aee968c69b4..5a5a472757121fc7ed1425198a9630565a3437d7 100644 (file)
@@ -62,7 +62,7 @@ int main( int argc, char* argv[] )
   filter->SetThresholds( init_threshold, end_threshold, delta );
   filter->SetInsideValue( 255 );
   filter->SetOutsideValue( 0 );
-  filter->SetSignalLag( 20 );
+  filter->SetSignalKernelSize( 20 );
   filter->SetSignalThreshold( 500 );
   filter->SetSignalInfluence( 0.5 );
   filter->SetMinimumThreshold( -850 );
@@ -83,18 +83,22 @@ int main( int argc, char* argv[] )
   if( err2 != "" ) std::cerr << err2 << std::endl;
 
   std::ofstream osignal( output_signal_filename.c_str( ) );
-  const TFilter::TSignal& signal = filter->GetSignal( );
-  for( unsigned long i = 0; i < signal.size( ); ++i )
-    osignal << signal[ i ].first << " " << signal[ i ].second << std::endl;
+  unsigned long nThr = filter->GetNumberOfEvaluatedThresholds( );
+  for( unsigned long i = 0; i < nThr; ++i )
+  {
+    double x, y;
+    TFilter::TPeak p;
+    filter->GetSignalValues( i, x, y, p );
+    osignal << x << " " << y << std::endl;
+
+  } // rof
   osignal.close( );
 
   std::cout
     << "------------------------------------------------------" << std::endl
     << "Elapsed time: " << telapsed.count( ) << " s" << std::endl
-    << "Optimum threshold: "
-    << filter->GetOptimumThreshold( ) << std::endl
-    << "Number of evaluated thresholds: "
-    << filter->GetNumberOfEvaluatedThresholds( ) << std::endl
+    << "Optimum threshold: " << filter->GetOptimumThreshold( ) << std::endl
+    << "Number of evaluated thresholds: " << nThr << std::endl
     << "------------------------------------------------------"
     << std::endl;