]> Creatis software - FrontAlgorithms.git/blobdiff - appli/examples/example_ImageAlgorithmRegionGrow_MultipleThresholds.cxx
Segmentation completely debugged (at least for 10 images)
[FrontAlgorithms.git] / appli / examples / example_ImageAlgorithmRegionGrow_MultipleThresholds.cxx
index ff821034776c889ffcd7cf53accbb754a63c90cb..deef6de805a8e711164b8313a4e4319905a30614 100644 (file)
@@ -42,14 +42,14 @@ int main( int argc, char* argv[] )
   {
     std::cerr
       << "Usage: " << argv[ 0 ]
-      << " input_image thr_0 thr_1 n_samples" << std::endl;
+      << " input_image thr_0 thr_1 step" << std::endl;
     return( 1 );
 
   } // fi
   std::string input_image_fn = argv[ 1 ];
   TPixel thr_0 = TPixel( std::atof( argv[ 2 ] ) );
   TPixel thr_1 = TPixel( std::atof( argv[ 3 ] ) );
-  unsigned int n_samples = std::atoi( argv[ 4 ] );
+  unsigned int step = std::atoi( argv[ 4 ] );
   
   // Read image
   TImageReader::Pointer input_image_reader = TImageReader::New( );
@@ -99,13 +99,13 @@ int main( int argc, char* argv[] )
 
   // Configure algorithm
   TFrontAlgorithm::Pointer algorithm = TFrontAlgorithm::New( );
-  algorithm->AddThresholds( thr_0, thr_1, n_samples );
+  algorithm->AddThresholds( thr_0, thr_1, step );
   algorithm->AddSeed( seed_idx, 0 );
   algorithm->AddObserver( itk::AnyEvent( ), obs );
   algorithm->ThrowEventsOn( );
   algorithm->SetInput( input_image );
   algorithm->SetNeighborhoodOrder( 1 );
-  algorithm->SetDerivativeThreshold( double( 3 ) );
+  algorithm->SetDifferenceThreshold( double( 3 ) );
   algorithm->Update( );
 
   // Let some interaction and close program