X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcpPlugins%2FPlugins%2FImageReader.cxx;h=d4ca0ba1471f500df0036b130cdb87b93e6e032e;hb=a3cae0375976d524c957493a3cc565b9f5b20bce;hp=24399718c9e5477f8c6a45fb6461abe95e5e0570;hpb=7c7bc497af96e7b5845be9a2fc277036ec752be9;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/ImageReader.cxx b/lib/cpPlugins/Plugins/ImageReader.cxx index 2439971..d4ca0ba 100644 --- a/lib/cpPlugins/Plugins/ImageReader.cxx +++ b/lib/cpPlugins/Plugins/ImageReader.cxx @@ -66,7 +66,6 @@ _GenerateData( ) { switch( io->GetNumberOfDimensions( ) ) { - case 1: r = this->_GD0< 1 >( io, names ); break; case 2: r = this->_GD0< 2 >( io, names ); break; case 3: r = this->_GD0< 3 >( io, names ); break; case 4: r = this->_GD0< 4 >( io, names ); break; @@ -283,9 +282,6 @@ _GD0( itk::ImageIOBase* io, const TStringList& names ) { switch( D ) { - case 1: - r = this->_RealGD< itk::Offset< 1 >, 1 >( names ); - break; case 2: r = this->_RealGD< itk::Offset< 2 >, 2 >( names ); break; @@ -436,12 +432,22 @@ _RealGD( const TStringList& names ) try { reader->Update( ); - this->m_Outputs[ 0 ]->SetITKDataObject( reader->GetOutput( ) ); + cpPlugins::Interface::Image* out = + this->_Output< cpPlugins::Interface::Image >( 0 ); + if( out != NULL ) + out->SetITKImage< _I >( reader->GetOutput( ) ); + else + r = "ImageReader: output not correctly created."; } catch( itk::ExceptionObject& err ) { r = "ImageReader: " + std::string( err.GetDescription( ) ); - this->m_Outputs[ 0 ]->SetITKDataObject( NULL ); + cpPlugins::Interface::Image* out = + this->_Output< cpPlugins::Interface::Image >( 0 ); + if( out != NULL ) + out->SetITKImage< _I >( NULL ); + else + r = "ImageReader: output not correctly created."; } // yrt } @@ -468,12 +474,22 @@ _RealGD( const TStringList& names ) try { reader->Update( ); - this->m_Outputs[ 0 ]->SetITKDataObject( reader->GetOutput( ) ); + cpPlugins::Interface::Image* out = + this->_Output< cpPlugins::Interface::Image >( 0 ); + if( out != NULL ) + out->SetITKImage< _I >( reader->GetOutput( ) ); + else + r = "ImageReader: output not correctly created."; } catch( itk::ExceptionObject& err ) { r = "ImageReader: " + std::string( err.GetDescription( ) ); - this->m_Outputs[ 0 ]->SetITKDataObject( NULL ); + cpPlugins::Interface::Image* out = + this->_Output< cpPlugins::Interface::Image >( 0 ); + if( out != NULL ) + out->SetITKImage< _I >( NULL ); + else + r = "ImageReader: output not correctly created."; } // yrt }