X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tools%2FclitkInvertVFGenericFilter.txx;h=812ed0c69db5737b56b0eccc26e68c48dab90f3b;hb=d5dbd01830c8c6e6df5254432fc51eb4baec389e;hp=558b34177d48357acd174f7c6fc14f669e20e428;hpb=42f68068ef3488c8ca2d921b6835d34fe6494d5f;p=clitk.git diff --git a/tools/clitkInvertVFGenericFilter.txx b/tools/clitkInvertVFGenericFilter.txx index 558b341..812ed0c 100644 --- a/tools/clitkInvertVFGenericFilter.txx +++ b/tools/clitkInvertVFGenericFilter.txx @@ -19,6 +19,7 @@ #define clitkInvertVFGenericFilter_txx #include "itkVectorResampleImageFilter.h" +#include "clitkConvertBLUTCoeffsToVFFilter.h" /* ================================================= * @file clitkInvertVFGenericFilter.txx @@ -172,6 +173,37 @@ InvertVFGenericFilter::UpdateWithDimAndPixelType() } case 1: { + // Create the InvertVFFilter + typedef clitk::InvertVFFilter FilterType; + typename FilterType::Pointer filter =FilterType::New(); + if (m_ArgsInfo.like_given) { + typedef ConvertBLUTCoeffsToVFFilter 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); + if (m_ArgsInfo.threads_given) filter->SetNumberOfThreads(m_ArgsInfo.threads_arg); + if (m_ArgsInfo.pad_given) { + PixelType pad; + if (m_ArgsInfo.pad_given != (pad.GetNumberOfComponents()) ) + pad.Fill(m_ArgsInfo.pad_arg[0]); + else + for(unsigned int i=0; iSetThreadSafe(m_ArgsInfo.threadSafe_flag); + filter->Update(); + output=filter->GetOutput(); + + break; + } + + case 2: { // Create the InverseDeformationFieldFilter #if ITK_VERSION_MAJOR >= 4 typedef itk::InverseDisplacementFieldImageFilter FilterType; @@ -190,6 +222,7 @@ InvertVFGenericFilter::UpdateWithDimAndPixelType() break; } + } // Output