+// -------------------------------------------------------------------------
+std::string ImageMPR::
+_LoadImage( TPluginImage::Pointer& image, const QStringList& names )
+{
+ // Block application
+ QApplication::setOverrideCursor( Qt::WaitCursor );
+ this->setEnabled( false );
+
+ std::string ret = "";
+ image = NULL;
+
+ // Get a reader from loaded plugins
+ TPluginFilter::Pointer reader =
+ this->m_Plugins.CreateProcessObject( this->m_ImageReaderClass );
+ if( reader.IsNotNull( ) )
+ {
+ // Configure reader
+ TParameters params = reader->GetDefaultParameters( );
+ QStringList::const_iterator qIt = names.begin( );
+ for( ; qIt != names.end( ); ++qIt )
+ params.AddValueToStringList( "FileNames", qIt->toStdString( ) );
+ params.SetValueAsBool( "VectorType", false );
+ reader->SetParameters( params );
+
+ // Execute and get error message, if any
+ ret = reader->Update( );
+
+ // Assign fresh image, if any
+ if( ret == "" )
+ {
+ image = reader->GetOutput< TPluginImage >( 0 );
+ reader->DisconnectOutputs( );
+
+ } // fi
+ }
+ else
+ ret = "No suitable reader object found in loaded plugins.";
+
+ // Finish reading
+ QApplication::restoreOverrideCursor( );
+ this->setEnabled( true );
+ return( ret );
+}
+