]> Creatis software - clitk.git/blobdiff - tools/clitkInvertVFGenericFilter.txx
Set the Root Tree maximum size to 1TB instead of 1GB
[clitk.git] / tools / clitkInvertVFGenericFilter.txx
index e4b590e060b757c4d298dbabe7d0e33a88e7ec10..a18a6417c6b0ad26c3efc14225fba5d1c7444153 100644 (file)
@@ -19,7 +19,7 @@
 #define clitkInvertVFGenericFilter_txx
 
 #include "itkVectorResampleImageFilter.h"
-#include "clitkCoeffsToDVF.h"
+#include "clitkConvertBLUTCoeffsToVFFilter.h"
 
 /* =================================================
  * @file   clitkInvertVFGenericFilter.txx
@@ -177,7 +177,13 @@ InvertVFGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
     typedef clitk::InvertVFFilter<InputImageType,OutputImageType> FilterType;
     typename FilterType::Pointer filter =FilterType::New();
     if (m_ArgsInfo.like_given) {
-      filter->SetInput(CoeffsToDVF<OutputImageType>(m_InputFileName, m_ArgsInfo.like_arg));
+      typedef ConvertBLUTCoeffsToVFFilter<InputImageType> VFFilterType;
+      typename VFFilterType::Pointer vf_filter = VFFilterType::New();
+      vf_filter->SetInputFileName(m_InputFileName);
+      vf_filter->SetLikeFileName(m_ArgsInfo.like_arg);
+      vf_filter->SetVerbose(m_Verbose);
+      vf_filter->Update();
+      filter->SetInput(vf_filter->GetOutput());
     }
 
     filter->SetVerbose(m_Verbose);
@@ -199,11 +205,7 @@ InvertVFGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
 
   case 2: {
     // Create the InverseDeformationFieldFilter
-#if ITK_VERSION_MAJOR >= 4
     typedef itk::InverseDisplacementFieldImageFilter<InputImageType,OutputImageType> FilterType;
-#else
-    typedef itk::InverseDeformationFieldImageFilter<InputImageType,OutputImageType> FilterType;
-#endif
     typename FilterType::Pointer filter =FilterType::New();
     filter->SetInput(input);
     filter->SetOutputOrigin(input->GetOrigin());