ExtractSliceImageFilter( )
: Superclass( )
{
- this->SetNumberOfInputs( 1 );
- this->SetNumberOfOutputs( 1 );
- this->_MakeOutput< cpPlugins::Interface::Image >( 0 );
+ this->_AddInput( "Input" );
+ this->_MakeOutput< cpPlugins::Interface::Image >( "Output" );
- using namespace cpPlugins::Interface;
- this->m_DefaultParameters.Configure( Parameters::Int, "Axis" );
- this->m_DefaultParameters.Configure( Parameters::Int, "Slice" );
- this->m_DefaultParameters.SetValueAsInt( "Axis", 0 );
- this->m_DefaultParameters.SetValueAsInt( "Slice", 0 );
- this->m_Parameters = this->m_DefaultParameters;
+ this->m_Parameters->ConfigureAsUint( "Axis", 0 );
+ this->m_Parameters->ConfigureAsInt( "Slice", 0 );
}
// -------------------------------------------------------------------------
_GenerateData( )
{
cpPlugins::Interface::Image* image =
- this->GetInput< cpPlugins::Interface::Image >( 0 );
+ this->GetInput< cpPlugins::Interface::Image >( "Input" );
if( image == NULL )
return( "ExtractSliceImageFilter: No input image." );
typedef typename O::PixelType _OP;
// Get parameters
- int axis = this->m_Parameters.GetValueAsInt( "Axis" );
- int slice = this->m_Parameters.GetValueAsInt( "Slice" );
-
- std::cout << "HOLA: " << slice << std::endl;
-
+ int axis = this->m_Parameters->GetUint( "Axis" );
+ int slice = this->m_Parameters->GetInt( "Slice" );
// Compute region
I* img = dynamic_cast< I* >( image );
region.SetSize( size );
region.SetIndex( index );
- std::cout << "HOLA-: " << region << std::endl;
-
// Configure filter
_F* filter = this->_CreateITK< _F >( );
filter->SetInput( img );
// Connect output
cpPlugins::Interface::Image* out =
- this->GetOutput< cpPlugins::Interface::Image >( 0 );
+ this->GetOutput< cpPlugins::Interface::Image >( "Output" );
if( out != NULL )
{
out->SetITK< O >( filter->GetOutput( ) );