+ typedef itk::ImageFileWriter< I > _W;
+
+ // Get filename
+ using namespace cpPlugins::Interface;
+ Parameters::TString fname =
+ this->m_Parameters.GetValueAsString( "FileName" );
+
+ _W* writer = dynamic_cast< _W* >( this->m_RealProcessObject.GetPointer( ) );
+ if( writer == NULL )
+ {
+ this->m_RealProcessObject = _W::New( );
+ writer = dynamic_cast< _W* >( this->m_RealProcessObject.GetPointer( ) );
+
+ } // fi
+ writer->SetFileName( fname );
+ writer->SetInput( dynamic_cast< I* >( image ) );
+ try
+ {
+ writer->Update( );
+ }
+ catch( itk::ExceptionObject& err )
+ {
+ return( "ImageWriter: " + std::string( err.GetDescription( ) ) );
+
+ } // yrt
+ return( "" );