1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
6 #include <vtkPolyDataWriter.h>
7 #include <vtkSmartPointer.h>
8 #include <fpa/DataStructures/Image/PolyLineParametricPath.h>
9 #include <fpa/Common/Image/PolyLineParametricPathReader.h>
10 #include <fpa/VTK/Image/PolyLineParametricPathToPolyDataFilter.h>
12 // -------------------------------------------------------------------------
13 const unsigned int Dim = 2;
14 typedef fpa::DataStructures::Image::PolyLineParametricPath< Dim > TPath;
16 // -------------------------------------------------------------------------
17 int main( int argc, char* argv[] )
23 << "Usage: " << argv[ 0 ]
24 << " input_path output_vtk"
29 std::string input_path_filename = argv[ 1 ];
30 std::string output_vtk_filename = argv[ 2 ];
33 typedef fpa::Common::Image::PolyLineParametricPathReader< TPath > TReader;
34 TReader::Pointer input_path_reader = TReader::New( );
35 input_path_reader->SetFileName( input_path_filename );
36 input_path_reader->Update( );
39 typedef fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< TPath > TFilter;
40 vtkSmartPointer< TFilter > filter = vtkSmartPointer< TFilter >::New( );
41 filter->SetInput( input_path_reader->GetOutput( ) );
45 vtkSmartPointer< vtkPolyDataWriter > output_vtk_writer =
46 vtkSmartPointer< vtkPolyDataWriter >::New( );
47 output_vtk_writer->SetFileName( output_vtk_filename.c_str( ) );
48 output_vtk_writer->SetInputConnection( filter->GetOutputPort( ) );
49 output_vtk_writer->Update( );