1 #include <ITKImageInterpolators/LinearInterpolateImageFunction.h>
2 #include <cpInstances/Image.h>
4 #include <itkLinearInterpolateImageFunction.h>
6 // -------------------------------------------------------------------------
7 cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
8 LinearInterpolateImageFunction( )
13 // -------------------------------------------------------------------------
14 cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
15 ~LinearInterpolateImageFunction( )
19 // -------------------------------------------------------------------------
20 void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
22 itk::LightObject* image, const std::string& precision_type
25 this->m_PrecisionType = precision_type;
26 cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( image, _GD0 )
27 this->_Error( "Invalid input image." );
30 // -------------------------------------------------------------------------
31 void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
36 // -------------------------------------------------------------------------
37 template< class _TImage >
38 void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
39 _GD0( _TImage* image )
41 if( this->m_PrecisionType == "float" )
42 this->_GD1< _TImage, float >( image );
43 else if( this->m_PrecisionType == "double" )
44 this->_GD1< _TImage, double >( image );
47 // -------------------------------------------------------------------------
48 template< class _TImage, class _TScalar >
49 void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
50 _GD1( _TImage* image )
52 typedef itk::LinearInterpolateImageFunction< _TImage, _TScalar > _TFunction;
54 auto function = this->_CreateITK< _TFunction >( );
55 this->GetOutput( "Output" )->SetITK( function );