X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2Fexamples%2Fexample_LightCompensation.cxx;h=cb1a1d267a9454204224ad798173cc9806b71fd5;hb=c3c3da5217b6eb255db9c0424f22d4e01250901e;hp=44062edddf794065568fae1af72215d89356ee67;hpb=aa6a578004bddb5b0bb07b780483fda0ecc6cb5e;p=cpPlugins.git diff --git a/appli/examples/example_LightCompensation.cxx b/appli/examples/example_LightCompensation.cxx index 44062ed..cb1a1d2 100644 --- a/appli/examples/example_LightCompensation.cxx +++ b/appli/examples/example_LightCompensation.cxx @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -51,6 +52,22 @@ int main( int argc, char* argv[] ) filter->SetInput( input_image ); filter->Update( ); + // Write image + itk::ImageFileWriter< TImage >::Pointer output_image_writer = + itk::ImageFileWriter< TImage >::New( ); + output_image_writer->SetInput( filter->GetOutput( ) ); + output_image_writer->SetFileName( output_image_fn ); + try + { + output_image_writer->Update( ); + } + catch( itk::ExceptionObject& err ) + { + std::cerr << "Error caught: " << err << std::endl; + return( 1 ); + + } // yrt + return( 0 ); }