#ifdef cpPlugins_Interface_QT4
+ QStringList filters;
+ filters
+ << "Image files (*.bmp *.png *.jpg *.jpeg *.dcm *.mhd *.nhdr *.nrrd *.tiff)"
+ << "Any files (*)";
+
+ std::vector< std::string > names;
+ this->m_Parameters->GetStringList( names, "FileNames" );
+ std::string name = ( names.size( ) > 0 )? names[ 0 ]: ".";
+
// Show dialog and check if it was accepted
QFileDialog dialog( parent );
dialog.setFileMode( QFileDialog::ExistingFiles );
- dialog.setDirectory( QFileDialog::tr( "." ) );
- dialog.setNameFilter( QFileDialog::tr( "All files (*)" ) );
+ dialog.setDirectory( QFileDialog::tr( name.c_str( ) ) );
+ dialog.setNameFilters( filters );
if( dialog.exec( ) )
{
QStringList names = dialog.selectedFiles( );
ImageReader( )
: Superclass( )
{
- this->SetNumberOfOutputs( 1 );
- this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
+ this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
this->m_Parameters->ConfigureAsStringList( "FileNames" );
this->m_Parameters->ConfigureAsBool( "VectorType", false );
_RealGD( const TStringList& names )
{
cpPlugins::Interface::Image* out =
- this->GetOutput< cpPlugins::Interface::Image >( 0 );
+ this->GetOutput< cpPlugins::Interface::Image >( "Output" );
if( out == NULL )
return( "ImageReader: No output object properly created." );