I did not success to modify clitk::VectorBSplineInterpolateImageFunction according to this commit
#include "clitkImageCommon.h"
//itk include
+#if ( ITK_VERSION_MAJOR < 5 )
#include "itkVectorNearestNeighborInterpolateImageFunction.h"
#include "itkVectorLinearInterpolateImageFunction.h"
+#else
+#include "itkNearestNeighborInterpolateImageFunction.h"
+#include "itkLinearInterpolateImageFunction.h"
+#endif
#include "clitkVectorBSplineInterpolateImageFunction.h"
#include "clitkVectorBSplineInterpolateImageFunctionWithLUT.h"
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
+#if ( ITK_VERSION_MAJOR < 5 )
typedef itk::VectorInterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
+#else
+ typedef itk::InterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
+#endif
typedef typename InterpolatorType::Pointer InterpolatorPointer;
/** Method for creation through the object factory. */
{
case 0:
+#if ( ITK_VERSION_MAJOR < 5 )
interpolator= itk::VectorNearestNeighborInterpolateImageFunction< ImageType,TCoordRep >::New();
+#else
+ interpolator= itk::NearestNeighborInterpolateImageFunction< ImageType,TCoordRep >::New();
+#endif
if (m_Verbose) std::cout<<"Using nearestneighbor interpolation..."<<std::endl;
break;
case 1:
+#if ( ITK_VERSION_MAJOR < 5 )
interpolator = itk::VectorLinearInterpolateImageFunction< ImageType,TCoordRep >::New();
+#else
+ interpolator = itk::LinearInterpolateImageFunction< ImageType,TCoordRep >::New();
+#endif
if (m_Verbose) std::cout<<"Using linear interpolation..."<<std::endl;
break;
- case 2:
+/* case 2:
{
typename clitk::VectorBSplineInterpolateImageFunction< ImageType,TCoordRep >::Pointer m =clitk::VectorBSplineInterpolateImageFunction< ImageType,TCoordRep >::New();
m->SetSplineOrder(m_ArgsInfo.interpVFOrder_arg);
if (m_Verbose) std::cout<<"Using BLUT interpolation..."<<std::endl;
break;
}
-
+*/
}//end of switch
#include "itkLightObject.h"
#include "itkAffineTransform.h"
#include "itkResampleImageFilter.h"
+#if ( ITK_VERSION_MAJOR < 5 )
#include "itkVectorResampleImageFilter.h"
+#endif
namespace clitk
}
//Filter
+#if ( ITK_VERSION_MAJOR < 5 )
typedef itk::VectorResampleImageFilter< InputImageType,OutputImageType, double > ResampleFilterType;
+#else
+ typedef itk::ResampleImageFilter< InputImageType,OutputImageType, double > ResampleFilterType;
+#endif
typename ResampleFilterType::Pointer resampler = ResampleFilterType::New();
// Matrix
// itk include
#include "itkCastImageFilter.h"
+#if ( ITK_VERSION_MAJOR < 5 )
#include "itkVectorCastImageFilter.h"
+#endif
namespace clitk {
// Cast
typedef itk::Image<itk::Vector<OutputPixelType, InputImageType::PixelType::Dimension>, InputImageType::ImageDimension> OutputImageType;
+#if ( ITK_VERSION_MAJOR < 5 )
typedef itk::VectorCastImageFilter<InputImageType, OutputImageType> FilterType;
+#else
+ typedef itk::CastImageFilter<InputImageType, OutputImageType> FilterType;
+#endif
typename FilterType::Pointer cast_filter = FilterType::New();
cast_filter->SetInput(input);
cast_filter->Update();
#ifndef clitkInvertVFGenericFilter_txx
#define clitkInvertVFGenericFilter_txx
+#if ( ITK_VERSION_MAJOR < 5 )
#include "itkVectorResampleImageFilter.h"
+#else
+#include "itkResampleImageFilter.h"
+#endif
#include "clitkConvertBLUTCoeffsToVFFilter.h"
/* =================================================
spacing[i] = header->GetSpacing(i);
}
+#if ( ITK_VERSION_MAJOR < 5 )
typedef itk::VectorResampleImageFilter<InputImageType, OutputImageType> ResampleFilterType;
+#else
+ typedef itk::ResampleImageFilter<InputImageType, OutputImageType> ResampleFilterType;
+#endif
typename ResampleFilterType::Pointer resampler = ResampleFilterType::New();
resampler->SetInput(input);
resampler->SetOutputOrigin(input->GetOrigin());
typedef typename ImageType::PointType PointType;
// Create Image Filter
+#if ( ITK_VERSION_MAJOR < 5 )
typedef itk::VectorResampleImageFilter<ImageType,ImageType> FilterType;
+#else
+ typedef itk::ResampleImageFilter<ImageType,ImageType> FilterType;
+#endif
typename FilterType::Pointer filter = FilterType::New();
// Instance of the transform object to be passed to the resample
// Select interpolator
if (mInterpolatorName == "nn") {
+#if ( ITK_VERSION_MAJOR < 5 )
typedef itk::VectorNearestNeighborInterpolateImageFunction<ImageType, double> InterpolatorType;
+#else
+ typedef itk::NearestNeighborInterpolateImageFunction<ImageType, double> InterpolatorType;
+#endif
typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
filter->SetInterpolator(interpolator);
} else {
if (mInterpolatorName == "linear") {
+#if ( ITK_VERSION_MAJOR < 5 )
typedef itk::VectorLinearInterpolateImageFunction<ImageType, double> InterpolatorType;
+#else
+ typedef itk::LinearInterpolateImageFunction<ImageType, double> InterpolatorType;
+#endif
typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
filter->SetInterpolator(interpolator);
} else {
#include "itkImageSeriesReader.h"
#include "itkImageFileWriter.h"
#include "itkRecursiveGaussianImageFilter.h"
+#if ( ITK_VERSION_MAJOR < 5 )
#include "itkVectorResampleImageFilter.h"
-#include "itkAffineTransform.h"
#include "itkVectorNearestNeighborInterpolateImageFunction.h"
#include "itkVectorLinearInterpolateImageFunction.h"
+#else
+#include "itkResampleImageFilter.h"
+#include "itkNearestNeighborInterpolateImageFunction.h"
+#include "itkLinearInterpolateImageFunction.h"
+#endif
+#include "itkAffineTransform.h"
#include "itkBSplineInterpolateImageFunction.h"
#include "itkBSplineInterpolateImageFunctionWithLUT.h"
#include "itkCommand.h"
//itk include
#include "itkLightObject.h"
#include "itkWarpImageFilter.h"
+#if ( ITK_VERSION_MAJOR < 5 )
#include "itkVectorResampleImageFilter.h"
+#else
+#include "itkResampleImageFilter.h"
+#endif
namespace clitk
{
*
===================================================*/
+#if ( ITK_VERSION_MAJOR < 5 )
#include "itkVectorResampleImageFilter.h"
+#else
+#include "itkResampleImageFilter.h"
+#endif
#include "clitkConvertBLUTCoeffsToVFFilter.h"
namespace clitk
genericInterpolator->SetArgsInfo(m_ArgsInfo);
// Resample to match the extent of the input
+#if ( ITK_VERSION_MAJOR < 5 )
typename itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
+#else
+ typename itk::ResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
+ resampler =itk::ResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
+#endif
resampler->SetInput(deformationField);
resampler->SetOutputSpacing(deformationField->GetSpacing());
resampler->SetOutputDirection(deformationField->GetDirection());
newSize[i]=input->GetLargestPossibleRegion().GetSize()[i];
// Resample to match the extent of the input
+#if ( ITK_VERSION_MAJOR < 5 )
typename itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
+#else
+ typename itk::ResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
+ resampler =itk::ResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
+#endif
resampler->SetInput(deformationField);
resampler->SetOutputSpacing(input->GetSpacing());
resampler->SetOutputDirection(deformationField->GetDirection());
backwardWarpFilter->SetOutputOrigin( input->GetOrigin() );
backwardWarpFilter->SetOutputSize( deformationField->GetLargestPossibleRegion().GetSize() );
backwardWarpFilter->SetOutputDirection( input->GetDirection() );
+#if ( ITK_VERSION_MAJOR < 5 )
typename itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
+#else
+ typename itk::ResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
+ resampler =itk::ResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
+#endif
backwardWarpFilter->SetInterpolator(genericInterpolator->GetInterpolatorPointer());
warpFilter=backwardWarpFilter;
}
#include <QApplication>
#include <itkWarpImageFilter.h>
+#if ( ITK_VERSION_MAJOR < 5 )
#include <itkVectorResampleImageFilter.h>
+#else
+#include <itkResampleImageFilter.h>
+#endif
#include "vvMidPosition.h"
#include "clitkCommon.h"
//We resample the VF because itk's warp filter doesn't like it when the vf and the image have
//different spacings
+#if ( ITK_VERSION_MAJOR < 5 )
typename itk::VectorResampleImageFilter<OutputVFType, OutputVFType >::Pointer
resampler =itk::VectorResampleImageFilter<OutputVFType, OutputVFType >::New();
+#else
+ typename itk::ResampleImageFilter<OutputVFType, OutputVFType >::Pointer
+ resampler =itk::ResampleImageFilter<OutputVFType, OutputVFType >::New();
+#endif
resampler->SetInput(vf);
resampler->SetOutputSpacing(input->GetSpacing());
resampler->SetOutputOrigin(vf->GetOrigin());