From c1f8a7a05902373f2b20600b541352172705e176 Mon Sep 17 00:00:00 2001 From: Romulo Pinho Date: Mon, 3 Sep 2012 10:26:25 +0200 Subject: [PATCH] itk4 compatibility --- itk/clitkComposeVFFilter.h | 6 +++++- itk/clitkComposeVFFilter.txx | 5 +++++ itk/clitkInvertVFFilter.txx | 17 ++++++++++++++++- tools/clitkVectorImageToImageFilter.h | 4 ++++ tools/clitkVectorImageToImageFilter.txx | 4 ++++ 5 files changed, 34 insertions(+), 2 deletions(-) diff --git a/itk/clitkComposeVFFilter.h b/itk/clitkComposeVFFilter.h index d66d819..cf1ada2 100644 --- a/itk/clitkComposeVFFilter.h +++ b/itk/clitkComposeVFFilter.h @@ -75,7 +75,11 @@ namespace clitk //======================================================================================== //Threaded execution should implement generate threaded data - void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); +#if ITK_VERSION_MAJOR >= 4 + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); +#else + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); +#endif bool m_Verbose; PixelType m_EdgePaddingValue; diff --git a/itk/clitkComposeVFFilter.txx b/itk/clitkComposeVFFilter.txx index 7103a10..a50ca26 100644 --- a/itk/clitkComposeVFFilter.txx +++ b/itk/clitkComposeVFFilter.txx @@ -35,8 +35,13 @@ namespace clitk //========================================================================================================================= //update the output for the outputRegionForThread +#if ITK_VERSION_MAJOR >= 4 + template + void ComposeVFFilter::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) +#else template void ComposeVFFilter::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) +#endif { //Get pointer to the output diff --git a/itk/clitkInvertVFFilter.txx b/itk/clitkInvertVFFilter.txx index 684b355..b74958f 100644 --- a/itk/clitkInvertVFFilter.txx +++ b/itk/clitkInvertVFFilter.txx @@ -75,7 +75,11 @@ protected: //the actual processing void BeforeThreadedGenerateData(); +#if ITK_VERSION_MAJOR >= 4 + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); +#else void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); +#endif //member data typename WeightsImageType::Pointer m_Weights; @@ -113,7 +117,11 @@ void HelperClass1::BeforeThreadedGenerateData() //========================================================================================================================= //update the output for the outputRegionForThread template +#if ITK_VERSION_MAJOR >= 4 +void HelperClass1::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) +#else void HelperClass1::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) +#endif { //std::cout << "HelperClass1::ThreadedGenerateData - IN" << std::endl; //Get pointer to the input @@ -285,8 +293,11 @@ protected: //the actual processing +#if ITK_VERSION_MAJOR >= 4 + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); +#else void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); - +#endif //member data typename WeightsImageType::Pointer m_Weights; @@ -311,7 +322,11 @@ template HelperClass2= 4 +template void HelperClass2::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) +#else template void HelperClass2::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) +#endif { //std::cout << "HelperClass2::ThreadedGenerateData - IN" << std::endl; diff --git a/tools/clitkVectorImageToImageFilter.h b/tools/clitkVectorImageToImageFilter.h index cf5946e..e2971f4 100644 --- a/tools/clitkVectorImageToImageFilter.h +++ b/tools/clitkVectorImageToImageFilter.h @@ -86,7 +86,11 @@ namespace clitk //---------------------------------------- // Update //---------------------------------------- +#if ITK_VERSION_MAJOR >= 4 + void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId ); +#else void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId ); +#endif //---------------------------------------- // Data members diff --git a/tools/clitkVectorImageToImageFilter.txx b/tools/clitkVectorImageToImageFilter.txx index 909a422..539e8dc 100644 --- a/tools/clitkVectorImageToImageFilter.txx +++ b/tools/clitkVectorImageToImageFilter.txx @@ -47,7 +47,11 @@ namespace clitk //------------------------------------------------------------------- template void +#if ITK_VERSION_MAJOR >= 4 + VectorImageToImageFilter::ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId) +#else VectorImageToImageFilter::ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId) +#endif { // Iterators typename OutputImageType::Pointer output=this->GetOutput(); -- 2.47.1