_TScalar cpExtensions::DataStructures::FourierSeriesContour< _TScalar >::
GetArea( ) const
{
- S a = TScalar( 0 );
+ TScalar a = TScalar( 0 );
int q = this->GetNumberOfHarmonics( );
typename Self::const_iterator i = this->begin( );
for( int l = -q; i != this->end( ); ++i, ++l )
int q = this->GetNumberOfHarmonics( );
typename Self::const_iterator i = this->begin( );
for( int l = -q; i != this->end( ); ++i, ++l )
- res.push_back( *i * std::polar( S( 1 ), S( l ) * phase ) );
+ res.push_back( *i * std::polar( TScalar( 1 ), TScalar( l ) * phase ) );
return( res );
}
int q = this->GetNumberOfHarmonics( );
typename Self::iterator i = this->begin( );
for( int l = -q; i != this->end( ); ++i, ++l )
- *i *= std::polar( S( 1 ), S( l ) * phase );
+ *i *= std::polar( TScalar( 1 ), TScalar( l ) * phase );
return( *this );
}
// 1.1. Roughly sample phases
for( unsigned int s = 0; s < _samples; ++s )
{
- S w = TScalar( s ) * _angleOff;
- S a = std::arg( contour._Z( w, 0 ) );
+ TScalar w = TScalar( s ) * _angleOff;
+ TScalar a = std::arg( contour._Z( w, 0 ) );
function.push_back( std::pair< TScalar, TScalar >( w, a ) );
if( a < minA )
{
static const TScalar _2pi = TScalar( 2 ) * TScalar( vnl_math::pi );
TScalar off = _2pi / TScalar( s - 1 );
for( unsigned int w = 0; w < s; ++w )
- p.push_back( ( *this )( S( w ) * off ) );
+ p.push_back( ( *this )( TScalar( w ) * off ) );
}
// -------------------------------------------------------------------------
{
zp /= np;
zn /= nn;
- t = std::real( std::log( zp * zn ) / TComplex( TScalar( 0 ), S( 2 ) ) );
- p = std::real( std::log( zp / zn ) / TComplex( TScalar( 0 ), S( 2 * l ) ) );
+ t = std::real(
+ std::log( zp * zn ) / TComplex( TScalar( 0 ), TScalar( 2 ) )
+ );
+ p = std::real(
+ std::log( zp / zn ) / TComplex( TScalar( 0 ), TScalar( 2 * l ) )
+ );
}
else
{
void cpExtensions::DataStructures::FourierSeriesContour< _TScalar >::
_DFT( const std::vector< TComplex >& p, unsigned int q )
{
- static const S _2pi = TScalar( 2 ) * TScalar( vnl_math::pi );
+ static const TScalar _2pi = TScalar( 2 ) * TScalar( vnl_math::pi );
this->SetNumberOfHarmonics( q );
*this *= TScalar( 0 );
*
*/
template< class _TScalar >
- class cpExtensions_EXPORT FourierSeries
+ class cpExtensions_EXPORT FourierSeriesContour
: public std::deque< std::complex< _TScalar > >
{
public:
- typedef FourierSeries Self;
- typedef _TScalar TScalar;
- typedef itk::Matrix< S, 2, 2 > TMatrix;
- typedef itk::Point< S, 2 > TPoint;
- typedef typename TPoint::VectorType TVector;
- typedef std::complex< S > TComplex;
- typedef std::deque< TComplex > Superclass;
+ typedef FourierSeriesContour Self;
+ typedef _TScalar TScalar;
+ typedef itk::Matrix< TScalar, 2, 2 > TMatrix;
+ typedef itk::Point< TScalar, 2 > TPoint;
+ typedef typename TPoint::VectorType TVector;
+ typedef std::complex< TScalar > TComplex;
+ typedef std::deque< TComplex > Superclass;
public:
- FourierSeries( unsigned int q = 1 );
+ FourierSeriesContour( unsigned int q = 1 );
template< class _TScalar2 >
- FourierSeries( const FourierSeries< _TScalar2 >& o );
+ FourierSeriesContour( const FourierSeriesContour< _TScalar2 >& o );
template< class _TIterator >
- FourierSeries(
+ FourierSeriesContour(
const _TIterator& b, const _TIterator& e, unsigned int q
);
- virtual ~FourierSeries( );
+ virtual ~FourierSeriesContour( );
template< class _TScalar2 >
- Self& operator=( const FourierSeries< _TSCalar2 >& o );
+ Self& operator=( const FourierSeriesContour< _TScalar2 >& o );
bool operator==( const Self& o ) const { return( false ); }
bool operator!=( const Self& o ) const { return( true ); }
${CMAKE_CURRENT_SOURCE_DIR}/ITKMeshes.i
${CMAKE_CURRENT_SOURCE_DIR}/ITKPaths.i
${CMAKE_CURRENT_SOURCE_DIR}/ITKTransforms.i
- ${CMAKE_CURRENT_SOURCE_DIR}/ITKImageInterpolators.i
)
TARGET_LINK_LIBRARIES(
${_pfx}ITKDataObjects
${_pfx}ITKDataObjects
)
+CreateLib(
+ ${_pfx}ITKImageInterpolators
+ SHARED
+ ${CMAKE_CURRENT_SOURCE_DIR}/ITKImageInterpolators.i
+ )
+TARGET_LINK_LIBRARIES(
+ ${_pfx}ITKImageInterpolators
+ ${_pfx}ITKBaseImageFilters
+ )
+
CreateLib(
${_pfx}ITKBaseImageFilters
SHARED
TARGET_LINK_LIBRARIES(
cpPluginsDataObjects
cpPlugins
+ cpExtensions
${_pfx}ITKBaseImageFilters
)
${_pfx}ITKBaseObjects
${_pfx}ITKDataObjects
${_pfx}ITKImageIterators
+ ${_pfx}ITKImageInterpolators
${_pfx}ITKBaseImageFilters
CACHE INTERNAL "All valid instances." FORCE
)
instances itk::VectorLinearInterpolateImageFunction< itk::Image< itk::#v#< #i_real#, #pdims# >, #pdims# >, #o_real# >
+tinclude itkBSplineDecompositionImageFilter:h|hxx
+tinclude itkBSplineInterpolateImageFunction:h|hxx
+instances itk::BSplineInterpolateImageFunction< itk::Image< #scalar_types#, #pdims# >, #real_types#, #real_types# >
+instances itk::BSplineDecompositionImageFilter< itk::Image< #scalar_types#, #pdims# >, itk::Image< #real_types#, #pdims# > >
+
** eof - $RCSfile$
choices.push_back( "float" );
choices.push_back( "double" );
this->ConfigureAsChoices( name, choices );
+ this->SetSelectedChoice( name, "float" );
}
// -------------------------------------------------------------------------
choices.push_back( "long" );
choices.push_back( "ulong" );
this->ConfigureAsChoices( name, choices );
+ this->SetSelectedChoice( name, "char" );
}
// -------------------------------------------------------------------------
choices.push_back( "float" );
choices.push_back( "double" );
this->ConfigureAsChoices( name, choices );
+ this->SetSelectedChoice( name, "char" );
}
// -------------------------------------------------------------------------
ITKSeparableFilters
ITKMorphology
ITKParaMorphology
+ ITKSliceFilters
+ ITKImageInterpolators
cpExtensions
)
cpPluginsITKMorphology
cpPluginsITKUnaryFunctorFilters
)
+TARGET_LINK_LIBRARIES(
+ cpPluginsITKSliceFilters
+ cpPluginsITKImageInterpolators
+ )
## eof - $RCSfile$
--- /dev/null
+#include <ITKImageInterpolators/BSplineInterpolateImageFunction.h>
+#include <cpInstances/Image.h>
+#include <itkImage.h>
+#include <itkBSplineInterpolateImageFunction.h>
+
+// -------------------------------------------------------------------------
+cpPluginsITKImageInterpolators::BSplineInterpolateImageFunction::
+BSplineInterpolateImageFunction( )
+ : Superclass( )
+{
+ this->m_Parameters.ConfigureAsUint( "SplineOrder", 3 );
+ this->m_Parameters.ConfigureAsBool( "UseImageDirection", true );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsITKImageInterpolators::BSplineInterpolateImageFunction::
+~BSplineInterpolateImageFunction( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKImageInterpolators::BSplineInterpolateImageFunction::
+CreateInterpolator(
+ itk::LightObject* image, const std::string& precision_type
+ )
+{
+ this->m_PrecisionType = precision_type;
+ cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( image, _GD0 )
+ this->_Error( "Invalid input image." );
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKImageInterpolators::BSplineInterpolateImageFunction::
+_GenerateData( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsITKImageInterpolators::BSplineInterpolateImageFunction::
+_GD0( _TImage* image )
+{
+ if( this->m_PrecisionType == "float" )
+ this->_GD1< _TImage, float >( image );
+ else if( this->m_PrecisionType == "double" )
+ this->_GD1< _TImage, double >( image );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TScalar >
+void cpPluginsITKImageInterpolators::BSplineInterpolateImageFunction::
+_GD1( _TImage* image )
+{
+ typedef itk::BSplineInterpolateImageFunction< _TImage, _TScalar, _TScalar > _TFunction;
+
+ auto function = this->_CreateITK< _TFunction >( );
+ function->SetSplineOrder( this->m_Parameters.GetUint( "SplineOrder" ) );
+ function->SetUseImageDirection( this->m_Parameters.GetBool( "UseImageDirection" ) );
+ this->GetOutput( "Output" )->SetITK( function );
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __cpPluginsITKImageInterpolators__BSplineInterpolateImageFunction__h__
+#define __cpPluginsITKImageInterpolators__BSplineInterpolateImageFunction__h__
+
+#include <cpPluginsITKImageInterpolators_Export.h>
+#include <ITKImageInterpolators/InterpolateImageFunction.h>
+
+namespace cpPluginsITKImageInterpolators
+{
+ /**
+ */
+ class cpPluginsITKImageInterpolators_EXPORT BSplineInterpolateImageFunction
+ : public InterpolateImageFunction
+ {
+ cpPluginsObject(
+ BSplineInterpolateImageFunction,
+ InterpolateImageFunction,
+ ITKImageInterpolators
+ );
+
+ public:
+ virtual void CreateInterpolator(
+ itk::LightObject* image,
+ const std::string& precision_type
+ ) cpPlugins_OVERRIDE;
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image );
+
+ template< class _TImage, class _TScalar >
+ inline void _GD1( _TImage* image );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsITKImageInterpolators__BSplineInterpolateImageFunction__h__
+
+// eof - $RCSfile$
--- /dev/null
+#include <ITKImageInterpolators/InterpolateImageFunction.h>
+
+// -------------------------------------------------------------------------
+cpPluginsITKImageInterpolators::InterpolateImageFunction::
+InterpolateImageFunction( )
+ : Superclass( )
+{
+ this->_ConfigureOutput< cpPlugins::BaseObjects::DataObject >( "Output" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsITKImageInterpolators::InterpolateImageFunction::
+~InterpolateImageFunction( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKImageInterpolators::InterpolateImageFunction::
+_GenerateData( )
+{
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __cpPluginsITKImageInterpolators__InterpolateImageFunction__h__
+#define __cpPluginsITKImageInterpolators__InterpolateImageFunction__h__
+
+#include <cpPluginsITKImageInterpolators_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsITKImageInterpolators
+{
+ /**
+ */
+ class cpPluginsITKImageInterpolators_EXPORT InterpolateImageFunction
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ public:
+ typedef InterpolateImageFunction Self;
+ typedef cpPlugins::BaseObjects::ProcessObject Superclass;
+ typedef itk::SmartPointer< Self > Pointer;
+ typedef itk::SmartPointer< const Self > ConstPointer;
+
+ public:
+ itkTypeMacro( BaseFilter, cpPlugins::BaseObjects::ProcessObject );
+ cpPlugins_Id_Macro( InterpolateImageFunction, ImageInterpolators );
+
+ protected:
+ InterpolateImageFunction( );
+ virtual ~InterpolateImageFunction( );
+
+ public:
+ virtual void CreateInterpolator(
+ itk::LightObject* image,
+ const std::string& precision_type
+ ) = 0;
+
+ protected:
+ virtual void _GenerateData( ) cpPlugins_OVERRIDE;
+
+ private:
+ // Purposely not implemented.
+ InterpolateImageFunction( const Self& other );
+ Self& operator=( const Self& other );
+
+ protected:
+ std::string m_PrecisionType;
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsITKImageInterpolators__InterpolateImageFunction__h__
+
+// eof - $RCSfile$
--- /dev/null
+#include <ITKImageInterpolators/LinearInterpolateImageFunction.h>
+#include <cpInstances/Image.h>
+#include <itkImage.h>
+#include <itkLinearInterpolateImageFunction.h>
+
+// -------------------------------------------------------------------------
+cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
+LinearInterpolateImageFunction( )
+ : Superclass( )
+{
+}
+
+// -------------------------------------------------------------------------
+cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
+~LinearInterpolateImageFunction( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
+CreateInterpolator(
+ itk::LightObject* image, const std::string& precision_type
+ )
+{
+ this->m_PrecisionType = precision_type;
+ cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( image, _GD0 )
+ this->_Error( "Invalid input image." );
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
+_GenerateData( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
+_GD0( _TImage* image )
+{
+ if( this->m_PrecisionType == "float" )
+ this->_GD1< _TImage, float >( image );
+ else if( this->m_PrecisionType == "double" )
+ this->_GD1< _TImage, double >( image );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TScalar >
+void cpPluginsITKImageInterpolators::LinearInterpolateImageFunction::
+_GD1( _TImage* image )
+{
+ typedef itk::LinearInterpolateImageFunction< _TImage, _TScalar > _TFunction;
+
+ auto function = this->_CreateITK< _TFunction >( );
+ this->GetOutput( "Output" )->SetITK( function );
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __cpPluginsITKImageInterpolators__LinearInterpolateImageFunction__h__
+#define __cpPluginsITKImageInterpolators__LinearInterpolateImageFunction__h__
+
+#include <cpPluginsITKImageInterpolators_Export.h>
+#include <ITKImageInterpolators/InterpolateImageFunction.h>
+
+namespace cpPluginsITKImageInterpolators
+{
+ /**
+ */
+ class cpPluginsITKImageInterpolators_EXPORT LinearInterpolateImageFunction
+ : public InterpolateImageFunction
+ {
+ cpPluginsObject(
+ LinearInterpolateImageFunction,
+ InterpolateImageFunction,
+ ITKImageInterpolators
+ );
+
+ public:
+ virtual void CreateInterpolator(
+ itk::LightObject* image,
+ const std::string& precision_type
+ ) cpPlugins_OVERRIDE;
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image );
+
+ template< class _TImage, class _TScalar >
+ inline void _GD1( _TImage* image );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsITKImageInterpolators__LinearInterpolateImageFunction__h__
+
+// eof - $RCSfile$
#include <ITKSliceFilters/CPRImageFilter.h>
-#include <cpInstances/Image.h>
-#include <cpInstances/Simple3DCurve.h>
-#include <itkImage.h>
-#include <cpExtensions/DataStructures/Simple3DCurve.h>
-#include <cpExtensions/Algorithms/CPRImageFilter.h>
+/* TODO
+ #include <cpInstances/Image.h>
+ #include <cpInstances/Simple3DCurve.h>
+
+ #include <itkImage.h>
+ #include <cpExtensions/DataStructures/Simple3DCurve.h>
+ #include <cpExtensions/Algorithms/CPRImageFilter.h>
+*/
// -------------------------------------------------------------------------
cpPluginsITKSliceFilters::CPRImageFilter::
CPRImageFilter( )
: Superclass( )
{
- typedef cpInstances::Image _TImage;
- typedef cpInstances::Simple3DCurve _TCurve;
- this->_ConfigureInput< _TImage >( "Image", true, false );
- this->_ConfigureInput< _TCurve >( "Curve", true, false );
- this->_ConfigureOutput< _TImage >( "Output" );
+ /* TODO
+ typedef cpInstances::Image _TImage;
+ typedef cpInstances::Simple3DCurve _TCurve;
+ this->_ConfigureInput< _TImage >( "Image", true, false );
+ this->_ConfigureInput< _TCurve >( "Curve", true, false );
+ this->_ConfigureOutput< _TImage >( "Output" );
- this->m_Parameters.ConfigureAsReal( "SliceRadius", 1 );
+ this->m_Parameters.ConfigureAsReal( "SliceRadius", 1 );
+ */
}
// -------------------------------------------------------------------------
void cpPluginsITKSliceFilters::CPRImageFilter::
_GenerateData( )
{
- auto o = this->GetInputData( "Image" );
- cpPlugins_Demangle_Image_ScalarPixels_1( o, _GD0, 3 )
- this->_Error( "Invalid input image." );
+ /* TODO
+ auto o = this->GetInputData( "Image" );
+ cpPlugins_Demangle_Image_ScalarPixels_1( o, _GD0, 3 )
+ this->_Error( "Invalid input image." );
+ */
}
// -------------------------------------------------------------------------
void cpPluginsITKSliceFilters::CPRImageFilter::
_GD0( _TImage* image )
{
- auto o = this->GetInputData( "Curve" );
- cpPlugins_Demangle_Simple3DCurve_All_2( o, _GD1, image )
- this->_Error( "Invalid input curve." );
+ /* TODO
+ auto o = this->GetInputData( "Curve" );
+ cpPlugins_Demangle_Simple3DCurve_All_2( o, _GD1, image )
+ this->_Error( "Invalid input curve." );
+ */
}
// -------------------------------------------------------------------------
void cpPluginsITKSliceFilters::CPRImageFilter::
_GD1( _TCurve* curve, _TImage* image )
{
- typedef cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve > _TFilter;
-
- auto filter = this->_CreateITK< _TFilter >( );
- filter->SetInput( image );
- filter->SetCurve( curve );
- filter->SetSliceRadius( this->m_Parameters.GetReal( "SliceRadius" ) );
- filter->Update( );
- this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+ /* TODO
+ typedef cpExtensions::Algorithms::CPRImageFilter< _TImage, _TCurve > _TFilter;
+
+ auto filter = this->_CreateITK< _TFilter >( );
+ filter->SetInput( image );
+ filter->SetCurve( curve );
+ filter->SetSliceRadius( this->m_Parameters.GetReal( "SliceRadius" ) );
+ filter->Update( );
+ this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+ */
}
// eof - $RCSfile$
--- /dev/null
+header #define ITK_MANUAL_INSTANTIATION
+
+tinclude itkResampleImageFilter:h|hxx
+
+instances itk::ResampleImageFilter< itk::Image< #scalar_types#, #pdims# >, itk::Image< #scalar_types#, #pdims# >, #real_types#, #real_types# >
+
+** eof - $RCSfile$
--- /dev/null
+#include <ITKSliceFilters/IsoResampleImageFilter.h>
+#include <ITKImageInterpolators/InterpolateImageFunction.h>
+
+#include <cpInstances/Image.h>
+#include <itkImage.h>
+#include <itkResampleImageFilter.h>
+#include <itkIdentityTransform.h>
+
+// -------------------------------------------------------------------------
+cpPluginsITKSliceFilters::IsoResampleImageFilter::
+IsoResampleImageFilter( )
+ : Superclass( )
+{
+ this->_ConfigureInput< cpInstances::Image >( "Input", true, false );
+ this->_ConfigureInput< cpPlugins::BaseObjects::DataObject >( "Interpolator", false, false );
+ this->_ConfigureOutput< cpInstances::Image >( "Output" );
+
+ this->m_Parameters.ConfigureAsReal( "Scale", 1 );
+ this->m_Parameters.ConfigureAsBool( "ScaleFromMinimumSpacing", true );
+ this->m_Parameters.ConfigureAsRealTypesChoices( "PrecisionType" );
+}
+
+// -------------------------------------------------------------------------
+cpPluginsITKSliceFilters::IsoResampleImageFilter::
+~IsoResampleImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+void cpPluginsITKSliceFilters::IsoResampleImageFilter::
+_GenerateData( )
+{
+ auto o = this->GetInputData( "Input" );
+ cpPlugins_Demangle_Image_ScalarPixels_AllDims_1( o, _GD0 )
+ this->_Error( "Invalid input image." );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void cpPluginsITKSliceFilters::IsoResampleImageFilter::
+_GD0( _TImage* image )
+{
+ typedef cpPluginsITKImageInterpolators::InterpolateImageFunction _TInterpolator;
+
+ std::string p_type = this->m_Parameters.GetSelectedChoice( "PrecisionType" );
+ auto interpolator = dynamic_cast< _TInterpolator* >(
+ this->GetInput( "Interpolator" )->GetSource( )
+ );
+ if( interpolator != NULL )
+ interpolator->CreateInterpolator( image, p_type );
+ if ( p_type == "float" ) this->_GD1< _TImage, float >( image );
+ else if( p_type == "double" ) this->_GD1< _TImage, double >( image );
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage, class _TScalar >
+void cpPluginsITKSliceFilters::IsoResampleImageFilter::
+_GD1( _TImage* image )
+{
+ typedef itk::IdentityTransform< _TScalar, _TImage::ImageDimension > _TTransform;
+ typedef itk::ResampleImageFilter< _TImage, _TImage, _TScalar, _TScalar > _TFilter;
+ typedef typename _TFilter::InterpolatorType _TInterpolator;
+
+ // Initial configuration
+ auto filter = this->_CreateITK< _TFilter >( );
+ filter->SetInput( image );
+
+ // Associate transform
+ typename _TTransform::Pointer transform = _TTransform::New( );
+ transform->SetIdentity( );
+ filter->SetTransform( transform );
+
+ // Compute new spacing
+ typename _TImage::SpacingType in_spac = image->GetSpacing( );
+ double val_spac = in_spac[ 0 ];
+ if( this->m_Parameters.GetBool( "ScaleFromMinimumSpacing" ) )
+ for( unsigned int d = 1; d < _TImage::ImageDimension; ++d )
+ val_spac = ( in_spac[ d ] < val_spac )? in_spac[ d ]: val_spac;
+ else
+ for( unsigned int d = 1; d < _TImage::ImageDimension; ++d )
+ val_spac = ( in_spac[ d ] > val_spac )? in_spac[ d ]: val_spac;
+ val_spac *= this->m_Parameters.GetReal( "Scale" );
+ typename _TImage::SpacingType out_spac;
+ out_spac.Fill( val_spac );
+ filter->SetOutputSpacing( out_spac );
+
+ // Compute new size
+ typename _TImage::SizeType in_size = image->GetRequestedRegion( ).GetSize( );
+ typename _TImage::SizeType out_size;
+ for( unsigned int d = 0; d < _TImage::ImageDimension; ++d )
+ out_size[ d ] = ( unsigned long )(
+ double( in_size[ d ] ) * double( in_spac[ d ] ) / val_spac
+ );
+ filter->SetSize( out_size );
+
+ // New origin
+ filter->SetOutputOrigin( image->GetOrigin( ) );
+
+ // Set interpolator
+ auto interpolator = this->GetInputData< _TInterpolator >( "Interpolator" );
+ if( interpolator != NULL )
+ filter->SetInterpolator( interpolator );
+
+ // Update
+ filter->Update( );
+ this->GetOutput( "Output" )->SetITK( filter->GetOutput( ) );
+}
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __cpPluginsITKSliceFilters__IsoResampleImageFilter__h__
+#define __cpPluginsITKSliceFilters__IsoResampleImageFilter__h__
+
+#include <cpPluginsITKSliceFilters_Export.h>
+#include <cpPlugins/BaseObjects/ProcessObject.h>
+
+namespace cpPluginsITKSliceFilters
+{
+ /**
+ */
+ class cpPluginsITKSliceFilters_EXPORT IsoResampleImageFilter
+ : public cpPlugins::BaseObjects::ProcessObject
+ {
+ cpPluginsObject(
+ IsoResampleImageFilter,
+ cpPlugins::BaseObjects::ProcessObject,
+ ITKSliceFilters
+ );
+
+ protected:
+ template< class _TImage >
+ inline void _GD0( _TImage* image );
+
+ template< class _TImage, class _TScalar >
+ inline void _GD1( _TImage* image );
+ };
+
+} // ecapseman
+
+#endif // __cpPluginsITKSliceFilters__IsoResampleImageFilter__h__
+
+// eof - $RCSfile$