- return( err.GetDescription( ) );
-
- } // yrt
- this->_SetOutput( 0, reader->GetOutput( ) );
- return( "" );
+ // Read image series
+ std::set< std::string > ordered_names;
+ for( unsigned int i = 0; i < unordered_names.size( ); ++i )
+ ordered_names.insert( unordered_names[ i ] );
+
+ typedef itk::ImageSeriesReader< _TImage > _TMultiReader;
+ _TMultiReader* multiReader =
+ dynamic_cast< _TMultiReader* >(
+ this->m_RealProcessObject.GetPointer( )
+ );
+ if( multiReader == NULL )
+ {
+ this->m_RealProcessObject = _TMultiReader::New( );
+ multiReader =
+ dynamic_cast< _TMultiReader* >(
+ this->m_RealProcessObject.GetPointer( )
+ );
+
+ } // fi
+ std::set< std::string >::const_iterator fnIt = ordered_names.begin( );
+ for( ; fnIt != ordered_names.end( ); ++fnIt )
+ multiReader->AddFileName( *fnIt );
+ try
+ {
+ multiReader->Update( );
+ }
+ catch( itk::ExceptionObject& err )
+ {
+ return( err.GetDescription( ) );
+
+ } // yrt
+ this->_SetOutput( 0, multiReader->GetOutput( ) );
+ return( "" );
+ }
+ else
+ return( "No image filename(s) given." );