X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tests%2Fimage%2FVTK%2FPolyLineParametricPathToPolyData.cxx;fp=tests%2Fimage%2FVTK%2FPolyLineParametricPathToPolyData.cxx;h=e92af292337421819518383943005f5721ddfe00;hb=2047276c8f1a02432fbcc7014722d460d6c1e60f;hp=0000000000000000000000000000000000000000;hpb=3c639e5da479c7216a0a302ffa156ac6762caeed;p=FrontAlgorithms.git diff --git a/tests/image/VTK/PolyLineParametricPathToPolyData.cxx b/tests/image/VTK/PolyLineParametricPathToPolyData.cxx new file mode 100644 index 0000000..e92af29 --- /dev/null +++ b/tests/image/VTK/PolyLineParametricPathToPolyData.cxx @@ -0,0 +1,54 @@ +// ========================================================================= +// @author Leonardo Florez Valencia +// @email florez-l@javeriana.edu.co +// ========================================================================= + +#include +#include +#include +#include +#include + +// ------------------------------------------------------------------------- +const unsigned int Dim = 2; +typedef fpa::DataStructures::Image::PolyLineParametricPath< Dim > TPath; + +// ------------------------------------------------------------------------- +int main( int argc, char* argv[] ) +{ + // Get arguments + if( argc < 3 ) + { + std::cerr + << "Usage: " << argv[ 0 ] + << " input_path output_vtk" + << std::endl; + return( 1 ); + + } // fi + std::string input_path_filename = argv[ 1 ]; + std::string output_vtk_filename = argv[ 2 ]; + + // Read image + typedef fpa::Common::Image::PolyLineParametricPathReader< TPath > TReader; + TReader::Pointer input_path_reader = TReader::New( ); + input_path_reader->SetFileName( input_path_filename ); + input_path_reader->Update( ); + + // Execute filter + typedef fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< TPath > TFilter; + vtkSmartPointer< TFilter > filter = vtkSmartPointer< TFilter >::New( ); + filter->SetInput( input_path_reader->GetOutput( ) ); + filter->Update( ); + + // Save results + vtkSmartPointer< vtkPolyDataWriter > output_vtk_writer = + vtkSmartPointer< vtkPolyDataWriter >::New( ); + output_vtk_writer->SetFileName( output_vtk_filename.c_str( ) ); + output_vtk_writer->SetInputConnection( filter->GetOutputPort( ) ); + output_vtk_writer->Update( ); + + return( 0 ); +} + +// eof - $RCSfile$