===================================================*/
#include "itkVectorResampleImageFilter.h"
-#include "clitkCoeffsToDVF.h"
+#include "clitkConvertBLUTCoeffsToVFFilter.h"
namespace clitk
{
typename DeformationFieldType::Pointer deformationField;
if (m_ArgsInfo.coeff_given) {
- deformationField = CoeffsToDVF<DeformationFieldType>(m_ArgsInfo.coeff_arg, m_InputFileName, m_Verbose);
+ typedef ConvertBLUTCoeffsToVFFilter<DeformationFieldType> FilterType;
+ typename FilterType::Pointer filter = FilterType::New();
+ filter->SetInputFileName(m_ArgsInfo.coeff_arg);
+ filter->SetLikeFileName(m_InputFileName);
+ filter->SetVerbose(m_Verbose);
+ filter->Update();
+ deformationField = filter->GetOutput();
}
else {
//Read the deformation field
resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
resampler->SetInput(deformationField);
resampler->SetOutputSpacing(deformationField->GetSpacing());
+ resampler->SetOutputDirection(deformationField->GetDirection());
resampler->SetSize(newSize);
resampler->SetOutputOrigin(input->GetOrigin());
resampler->SetInterpolator(genericInterpolator->GetInterpolatorPointer());
resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
resampler->SetInput(deformationField);
resampler->SetOutputSpacing(input->GetSpacing());
+ resampler->SetOutputDirection(deformationField->GetDirection());
resampler->SetSize(newSize);
resampler->SetOutputOrigin(input->GetOrigin());
resampler->SetInterpolator(genericInterpolator->GetInterpolatorPointer());
//Backward mapping
typedef itk::WarpImageFilter<InputImageType, InputImageType, DeformationFieldType> BackwardWarpFilterType;
typename BackwardWarpFilterType::Pointer backwardWarpFilter= BackwardWarpFilterType::New();
-#if ITK_VERSION_MAJOR >= 4
backwardWarpFilter->SetDisplacementField( deformationField );
-#else
- backwardWarpFilter->SetDeformationField( deformationField );
-#endif
backwardWarpFilter->SetEdgePaddingValue( static_cast<PixelType>(m_ArgsInfo.pad_arg) );
backwardWarpFilter->SetOutputSpacing( deformationField->GetSpacing() );
backwardWarpFilter->SetOutputOrigin( input->GetOrigin() );
backwardWarpFilter->SetOutputSize( deformationField->GetLargestPossibleRegion().GetSize() );
+ backwardWarpFilter->SetOutputDirection( input->GetDirection() );
typename itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::Pointer
resampler =itk::VectorResampleImageFilter<DeformationFieldType, DeformationFieldType >::New();
backwardWarpFilter->SetInterpolator(genericInterpolator->GetInterpolatorPointer());