-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-WriteImage( const std::string& fname, const std::string& name )
-{
- // Check if objects exist
- if( this->m_ImageWriter.IsNull( ) )
- return( false );
- TImage* image = this->GetImage( name );
- if( image == NULL )
- return( false );
-
- // Configure writer
- this->m_ImageWriter->GetParameters( )->SetString( "FileName", fname );
- this->m_ImageWriter->SetInput( "Input", image );
-
- // Execute filter
- this->BlockWidget( );
- std::string err = this->m_ImageWriter->Update( );
- this->UnblockWidget( );
-
- // Get result, if any
- if( err != "" )
- {
-#ifdef cpPlugins_Interface_QT4
- if( this->m_Widget != NULL )
- QMessageBox::critical(
- this->m_Widget,
- QMessageBox::tr( "Error reading mesh." ),
- QMessageBox::tr( err.c_str( ) )
- );
-#else // cpPlugins_Interface_QT4
- std::cerr << "Error reading mesh: " << err << std::endl;
-#endif // cpPlugins_Interface_QT4
- return( false );
- }
- else
- return( true );
-}
-
-// -------------------------------------------------------------------------
-bool cpPlugins::Interface::Plugins::
-WriteImage( const std::string& name )
-{
- // Check if objects exist
- if( this->m_ImageWriter.IsNull( ) )
- return( false );
- TImage* image = this->GetImage( name );
- if( image == NULL )
- return( false );
-
- // Configure writer
- TProcessObject::DialogResult dret =
- this->m_ImageWriter->ExecConfigurationDialog( this->m_Widget );
- if( dret == TProcessObject::DialogResult_Cancel )
- return( "" );
- this->m_ImageWriter->SetInput( "Input", image );
-
- // Execute filter
- this->BlockWidget( );
- std::string err = this->m_ImageWriter->Update( );
- this->UnblockWidget( );
-
- // Get result, if any
- if( err != "" )