]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/ImageReader.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / ImageReader.cxx
index 24399718c9e5477f8c6a45fb6461abe95e5e0570..d4ca0ba1471f500df0036b130cdb87b93e6e032e 100644 (file)
@@ -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
   }