typedef itk::Image<Displacement, Dimension> OutputImageType;
// Filter
-#if ITK_VERSION_MAJOR >= 4
-# if ITK_VERSION_MINOR < 6
+#if (ITK_VERSION_MAJOR == 4) && (ITK_VERSION_MINOR < 6)
typedef itk::TransformToDisplacementFieldSource<OutputImageType, double> ConvertorType;
-# else
- typedef itk::TransformToDisplacementFieldFilter<OutputImageType, double> ConvertorType;
-# endif
#else
- typedef itk::TransformToDeformationFieldSource<OutputImageType, double> ConvertorType;
+ typedef itk::TransformToDisplacementFieldFilter<OutputImageType, double> ConvertorType;
#endif
typename ConvertorType::Pointer filter= ConvertorType::New();
typename OutputImageType::Pointer image=reader2->GetOutput();
#if ITK_VERSION_MAJOR > 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR >= 6)
filter->SetReferenceImage(image);
+ filter->UseReferenceImageOn();
#else
filter->SetOutputParametersFromImage(image);
#endif