X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkMatrixTransformToVFGenericFilter.txx;h=a1241b5358cc06a0ab63065be57a2f41134c0bfe;hb=bfd2c4f867ddeaa1fdb556c44e58aabe467e64b5;hp=0540a134a12018a2935b6977435cba68fbe47596;hpb=08d1fd56ac1d08bd228d9e557f5472a395e9b708;p=clitk.git diff --git a/registration/clitkMatrixTransformToVFGenericFilter.txx b/registration/clitkMatrixTransformToVFGenericFilter.txx index 0540a13..a1241b5 100644 --- a/registration/clitkMatrixTransformToVFGenericFilter.txx +++ b/registration/clitkMatrixTransformToVFGenericFilter.txx @@ -78,7 +78,16 @@ namespace clitk typedef itk::Image OutputImageType; // Filter +#if ITK_VERSION_MAJOR >= 4 +# if ITK_VERSION_MINOR < 6 + typedef itk::TransformToDisplacementFieldSource ConvertorType; +# else + typedef itk::TransformToDisplacementFieldFilter ConvertorType; +# endif +#else typedef itk::TransformToDeformationFieldSource ConvertorType; +#endif + typename ConvertorType::Pointer filter= ConvertorType::New(); // Output image info @@ -90,7 +99,12 @@ namespace clitk reader2->Update(); typename OutputImageType::Pointer image=reader2->GetOutput(); - filter->SetOutputParametersFromImage(image); +#if ITK_VERSION_MAJOR > 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR >= 6) + filter->SetReferenceImage(image); + filter->UseReferenceImageOn(); +#else + filter->SetOutputParametersFromImage(image); +#endif } else { @@ -114,8 +128,12 @@ namespace clitk typename OutputImageType::SizeType size; for(i=0;iSetOutputSize(size); - } +#if ITK_VERSION_MAJOR > 4 || (ITK_VERSION_MAJOR == 4 && ITK_VERSION_MINOR >= 6) + filter->SetSize(size); +#else + filter->SetOutputSize(size); +#endif + } } // Transform