X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkMatrixTransformToVFGenericFilter.txx;h=8a36a882b91017a7c4d1e69cc1f34cd73cdcedd7;hb=04cad017137b756a56c002ae40a2e37f0903ab05;hp=ebc0e45c3ba6ba0beaf9d30dd05b5a954444ebad;hpb=6194949c0beb1589904e22381b9aba1bbface172;p=clitk.git diff --git a/registration/clitkMatrixTransformToVFGenericFilter.txx b/registration/clitkMatrixTransformToVFGenericFilter.txx index ebc0e45..8a36a88 100644 --- a/registration/clitkMatrixTransformToVFGenericFilter.txx +++ b/registration/clitkMatrixTransformToVFGenericFilter.txx @@ -79,10 +79,13 @@ namespace clitk // Filter #if ITK_VERSION_MAJOR >= 4 +# if ITK_VERSION_MINOR < 6 typedef itk::TransformToDisplacementFieldSource ConvertorType; -#else - typedef itk::TransformToDeformationFieldSource ConvertorType; +# else + typedef itk::TransformToDisplacementFieldFilter ConvertorType; +# endif #endif + typename ConvertorType::Pointer filter= ConvertorType::New(); // Output image info @@ -94,7 +97,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 { @@ -118,8 +126,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