]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/CPRFilter.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / CPRFilter.cxx
index 21dcbab574a8c1f0649872b35d73aec9b0b2ba5e..a67baa177a394637b3ffcfd6cb7daf842c86bc24 100644 (file)
@@ -9,8 +9,8 @@ cpPlugins::BasicFilters::CPRFilter::
 CPRFilter( )
   : Superclass( )
 {
-  this->_AddInput( "InputImage", true );
-  this->_AddInput( "InputAxis", true );
+  this->_AddInput( "InputImage" );
+  this->_AddInput( "InputAxis" );
   this->_AddInput( "Interpolator", false );
   this->_AddOutput< cpPlugins::Interface::Image >( "Output" );
 
@@ -38,9 +38,6 @@ _GenerateData( )
 {
   auto image =
     this->GetInputData< cpPlugins::Interface::Image >( "InputImage" );
-  if( image == NULL )
-    return( "CPRFilter: No input image." );
-
   itk::DataObject* itk_image = NULL;
   std::string r = "";
   cpPlugins_Image_Demangle_AllScalarTypes( 3, image, itk_image, r, _GD0 );
@@ -77,6 +74,8 @@ _GD1( I* image )
     this->GetInputData< cpPlugins::Interface::PolyLineParametricPath >(
       "InputAxis"
       )->GetITK< _Path >( );
+  if( axis == NULL )
+    return( "CPRFilter: Invalid input axis." );
   auto w_int =
     this->GetInputData< cpPlugins::Interface::DataObject >( "Interpolator" );
   _Interpolator* interpolator = NULL;
@@ -96,7 +95,7 @@ _GD1( I* image )
   // Assign output
   auto out =
     this->GetOutputData< cpPlugins::Interface::Image >( "Output" );
-  out->SetITK< I >( filter->GetOutput( ) );
+  out->SetITK( filter->GetOutput( ) );
   return( "" );
 }