]> Creatis software - FrontAlgorithms.git/blobdiff - tests/image/Dijkstra/Gaussian.cxx
...
[FrontAlgorithms.git] / tests / image / Dijkstra / Gaussian.cxx
diff --git a/tests/image/Dijkstra/Gaussian.cxx b/tests/image/Dijkstra/Gaussian.cxx
deleted file mode 100644 (file)
index 3139e83..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-// =========================================================================
-// @author Leonardo Florez Valencia
-// @email florez-l@javeriana.edu.co
-// =========================================================================
-
-#include <itkImage.h>
-#include <itkImageFileReader.h>
-#include <itkImageFileWriter.h>
-#include <fpa/Filters/Image/Dijkstra.h>
-#include <fpa/Functors/Dijkstra/Image/Gaussian.h>
-
-// -------------------------------------------------------------------------
-const unsigned int Dim = 2;
-typedef unsigned char TInputPixel;
-typedef float         TOutputPixel;
-typedef itk::Image< TInputPixel, Dim >  TInputImage;
-typedef itk::Image< TOutputPixel, Dim > TOutputImage;
-
-// -------------------------------------------------------------------------
-int main( int argc, char* argv[] )
-{
-  // Get arguments
-  if( argc < 7 )
-  {
-    std::cerr
-      << "Usage: " << argv[ 0 ]
-      << " input_image output_image output_marks output_mst alpha beta [seeds]"
-      << std::endl;
-    return( 1 );
-
-  } // fi
-  std::string input_image_filename = argv[ 1 ];
-  std::string output_image_filename = argv[ 2 ];
-  std::string output_marks_filename = argv[ 3 ];
-  std::string output_mst_filename = argv[ 4 ];
-  double alpha = std::atof( argv[ 5 ] );
-  double beta = std::atof( argv[ 6 ] );
-
-  // Read image
-  typedef itk::ImageFileReader< TInputImage > TInputImageReader;
-  TInputImageReader::Pointer input_image_reader = TInputImageReader::New( );
-  input_image_reader->SetFileName( input_image_filename );
-
-  // Prepare weight functor
-  typedef fpa::Functors::Dijkstra::Image::Gaussian< TInputImage, TOutputPixel > TWeight;
-  TWeight::Pointer weight = TWeight::New( );
-  weight->SetAlpha( alpha );
-  weight->SetBeta( beta );
-
-  // Prepare filter
-  typedef fpa::Filters::Image::Dijkstra< TInputImage, TOutputImage > TFilter;
-  TFilter::Pointer filter = TFilter::New( );
-  filter->SetInput( input_image_reader->GetOutput( ) );
-  filter->SetWeightFunction( weight );
-
-  // Get all seeds
-  for( int i = 7; i < argc; i += Dim )
-  {
-    TInputImage::IndexType seed;
-    for( int j = 0; j < Dim; ++j )
-      if( i + j < argc )
-        seed[ j ] = std::atoi( argv[ i + j ] );
-    filter->AddSeed( seed );
-
-  } // rof
-
-  // Execute filter
-  filter->Update( );
-
-  // Save results
-  typedef itk::ImageFileWriter< TFilter::TOutputImage > TOutputWriter;
-  TOutputWriter::Pointer output_writer = TOutputWriter::New( );
-  output_writer->SetInput( filter->GetOutput( ) );
-  output_writer->SetFileName( output_image_filename );
-
-  typedef itk::ImageFileWriter< TFilter::TMarksImage > TMarksWriter;
-  TMarksWriter::Pointer marks_writer = TMarksWriter::New( );
-  marks_writer->SetInput( filter->GetMarks( ) );
-  marks_writer->SetFileName( output_marks_filename );
-
-  typedef itk::ImageFileWriter< TFilter::TMST > TMSTWriter;
-  TMSTWriter::Pointer mst_writer = TMSTWriter::New( );
-  mst_writer->SetInput( filter->GetMinimumSpanningTree( ) );
-  mst_writer->SetFileName( output_mst_filename );
-
-  try
-  {
-    output_writer->Update( );
-    marks_writer->Update( );
-    mst_writer->Update( );
-  }
-  catch( std::exception& err )
-  {
-    std::cerr << "Error caught: " << err.what( ) << std::endl;
-    return( 1 );
-
-  } // yrt
-
-  return( 0 );
-}
-
-// eof - $RCSfile$