--- /dev/null
+#include "BaseFunctions.h"
+#include <itkImage.h>
+#include <fpa/Image/Mori.h>
+
+// -------------------------------------------------------------------------
+const unsigned int Dim = 2;
+typedef unsigned char TPixel;
+
+typedef itk::Image< TPixel, Dim > TImage;
+typedef fpa::Image::Mori< TImage, TImage > TFilter;
+
+// -------------------------------------------------------------------------
+int main( int argc, char* argv[] )
+{
+ // Get arguments
+ if( argc < 9 )
+ {
+ std::cerr
+ << "Usage: " << argv[ 0 ]
+ << " input_image output_image output_levels"
+ << " init_threshold end_threshold number_of_threshold seed_x seed_y"
+ << std::endl;
+ return( 1 );
+
+ } // fi
+ std::string input_image_filename = argv[ 1 ];
+ std::string output_image_filename = argv[ 2 ];
+ std::string output_levels_filename = argv[ 3 ];
+ unsigned char init_threshold = std::atoi( argv[ 4 ] );
+ unsigned char end_threshold = std::atoi( argv[ 5 ] );
+ unsigned char number_of_thresholds = std::atoi( argv[ 6 ] );
+ TImage::IndexType seed;
+ seed[ 0 ] = std::atoi( argv[ 7 ] );
+ seed[ 1 ] = std::atoi( argv[ 8 ] );
+
+ // Create image
+ TImage::Pointer input_image;
+ std::string err0 =
+ fpa::tests::image::Read( input_image, input_image_filename );
+ if( err0 != "" ) std::cerr << err0 << std::endl;
+
+ // Prepare filter
+ TFilter::Pointer filter = TFilter::New( );
+ filter->SetInput( input_image );
+ filter->SetSeed( seed );
+ filter->SetThresholds( init_threshold, end_threshold, number_of_thresholds );
+ filter->SetInsideValue( 255 );
+ filter->SetOutsideValue( 0 );
+
+ // Execute filter
+ filter->Update( );
+
+ // Save results
+ std::string err1 =
+ fpa::tests::image::Write( filter->GetOutput( ), output_image_filename );
+ std::string err2 =
+ fpa::tests::image::Write( filter->GetOutputLevels( ), output_levels_filename );
+ if( err1 != "" ) std::cerr << err1 << std::endl;
+ if( err2 != "" ) std::cerr << err2 << std::endl;
+
+ return( 0 );
+}
+
+// eof - $RCSfile$