#include <itkPoint.h>
#include <itkMinimumMaximumImageCalculator.h>
-#include <itkNearestNeighborInterpolateImageFunction.h>
+#include <itkLinearInterpolateImageFunction.h>
#include <cpExtensions/Algorithms/BezierCurveFunction.h>
// -------------------------------------------------------------------------
TAxis* cpExtensions::Algorithms::CPRFilter< I, S >::
GetAxis( ) const
{
- return( NULL );
+ return(
+ dynamic_cast< const TAxis* >( this->itk::ProcessObject::GetInput( 1 ) )
+ );
}
// -------------------------------------------------------------------------
void cpExtensions::Algorithms::CPRFilter< I, S >::
SetAxis( const TAxis* axis )
{
+ this->itk::ProcessObject::SetNthInput( 1, const_cast< TAxis* >( axis ) );
}
// -------------------------------------------------------------------------
: Superclass( )
{
this->m_Interpolator =
- itk::NearestNeighborInterpolateImageFunction< I, S >::New( );
+ itk::LinearInterpolateImageFunction< I, S >::New( );
}
// -------------------------------------------------------------------------
{
}
+// -------------------------------------------------------------------------
+template< class I, class S >
+void cpExtensions::Algorithms::CPRFilter< I, S >::
+GenerateOutputInformation( )
+{
+ // Do nothing since the output has different geometry and topology.
+}
+
// -------------------------------------------------------------------------
template< class I, class S >
void cpExtensions::Algorithms::CPRFilter< I, S >::
{
// Get geometrical data and correct Frenet frame
S u = S( i ) / S( nSlices );
+ std::cout << u << std::endl;
_V vnex = bezier->Evaluate( u );
_M mnex = bezier->EvaluateFrenetFrame( u );
if( i > 0 )
slicer->SpacingFromMinimumOn( );
slicer->SetDefaultValue( background );
slicer->SetInterpolator( this->m_Interpolator );
+ slicer->Update( );
+
+ std::cout << slicer->GetOutput( )->GetLargestPossibleRegion( ).GetSize( ) << std::endl;
// Add output to join filter and keep track of the current slicer
this->m_Join->SetInput( i, slicer->GetOutput( ) );
// 3. Finish join filter configuration
this->m_Join->SetSpacing( double( len / S( nSlices + 1 ) ) );
+ std::cout << this->m_Join->GetSpacing( ) << std::endl;
this->m_Join->SetOrigin( double( 0 ) );
// 4. Graft outputs
this->m_Join->GraftOutput( this->GetOutput( ) );
- this->m_Join->UpdateLargestPossibleRegion( );
+ this->m_Join->Update( );//LargestPossibleRegion( );
this->GraftOutput( this->m_Join->GetOutput( ) );
}