X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=registration%2FclitkMatrixTransformToVFGenericFilter.txx;h=a1241b5358cc06a0ab63065be57a2f41134c0bfe;hb=bfd2c4f867ddeaa1fdb556c44e58aabe467e64b5;hp=df1ed8ae74a0f6c9c80b8327b91524cccc57e3e0;hpb=657652a78c2e2717a6f77e027049173442ca29f0;p=clitk.git diff --git a/registration/clitkMatrixTransformToVFGenericFilter.txx b/registration/clitkMatrixTransformToVFGenericFilter.txx old mode 100755 new mode 100644 index df1ed8a..a1241b5 --- a/registration/clitkMatrixTransformToVFGenericFilter.txx +++ b/registration/clitkMatrixTransformToVFGenericFilter.txx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,7 +14,7 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ +===========================================================================**/ #ifndef clitkMatrixTransformToVFGenericFilter_txx #define 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