X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tests%2Fimage%2FDijkstra_Identity.cxx;fp=tests%2Fimage%2FDijkstra_Identity.cxx;h=0000000000000000000000000000000000000000;hb=3c639e5da479c7216a0a302ffa156ac6762caeed;hp=54d1511bdaf15022c618296f3f85ecbae10f5766;hpb=5bf766068f54d061d3816f4950a076c3cf3a4d8b;p=FrontAlgorithms.git diff --git a/tests/image/Dijkstra_Identity.cxx b/tests/image/Dijkstra_Identity.cxx deleted file mode 100644 index 54d1511..0000000 --- a/tests/image/Dijkstra_Identity.cxx +++ /dev/null @@ -1,74 +0,0 @@ -#include "BaseFunctions.h" -#include -#include -#include - -// ------------------------------------------------------------------------- -const unsigned int Dim = 2; -typedef unsigned char TPixel; -typedef float TScalar; - -typedef itk::Image< TPixel, Dim > TInputImage; -typedef itk::Image< TScalar, Dim > TScalarImage; -typedef fpa::Image::Dijkstra< TInputImage, TScalarImage > TFilter; -typedef fpa::Image::Functors::Dijkstra::Identity< TInputImage, TScalar > TWeight; - -// ------------------------------------------------------------------------- -int main( int argc, char* argv[] ) -{ - // Get arguments - if( argc < 5 ) - { - std::cerr - << "Usage: " << argv[ 0 ] - << " output_image output_marks width height ..." - << std::endl; - return( 1 ); - - } // fi - std::string output_image_filename = argv[ 1 ]; - std::string output_marks_filename = argv[ 2 ]; - int width = std::atoi( argv[ 3 ] ); - int height = std::atoi( argv[ 4 ] ); - - // Create image - TInputImage::Pointer image; - fpa::tests::image::CreateImage( image, 1, width, height, 1.0, 1.0 ); - - // Prepare weight - TWeight::Pointer weight = TWeight::New( ); - - // Prepare filter - TFilter::Pointer filter = TFilter::New( ); - filter->SetInput( image ); - filter->SetWeightFunction( weight ); - - // Get all seeds - for( int i = 5; i < argc; i += 2 ) - { - if( i + 1 < argc ) - { - TInputImage::IndexType seed; - seed[ 0 ] = std::atoi( argv[ i ] ); - seed[ 1 ] = std::atoi( argv[ i + 1 ] ); - filter->AddSeed( seed ); - - } // fi - - } // rof - - // 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->GetMarks( ), output_marks_filename ); - if( err1 != "" ) std::cerr << err1 << std::endl; - if( err2 != "" ) std::cerr << err2 << std::endl; - - return( 0 ); -} - -// eof - $RCSfile$