From: Vivien Delmon Date: Fri, 18 Nov 2011 16:37:54 +0000 (+0100) Subject: itkv4 migration use itk::ThreadIdType X-Git-Tag: v1.3.0~164 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a6957c4825e83c61b977ec316dd841878617ffbd;p=clitk.git itkv4 migration use itk::ThreadIdType - Add a typedef on unsigned int for itk 3.20 compatibility - Use itk::ThreadIdType where needed --- diff --git a/common/clitkCommon.h b/common/clitkCommon.h index 769ca63..11a6255 100644 --- a/common/clitkCommon.h +++ b/common/clitkCommon.h @@ -42,6 +42,13 @@ # include #endif +#if ITK_VERSION_MAJOR < 4 +namespace itk +{ + typedef unsigned int ThreadIdType; +} +#endif + //-------------------------------------------------------------------- namespace clitk { diff --git a/itk/RelativePositionPropImageFilter.h b/itk/RelativePositionPropImageFilter.h index 11797e7..0517224 100644 --- a/itk/RelativePositionPropImageFilter.h +++ b/itk/RelativePositionPropImageFilter.h @@ -194,7 +194,7 @@ namespace itk virtual ~RelativePositionPropImageFilter() {} void PrintSelf(std::ostream& os, Indent indent) const; - //void GenerateThreadedData(const typename TOutputImage::RegionType& outputRegionForThread, int threadId); + //void GenerateThreadedData(const typename TOutputImage::RegionType& outputRegionForThread, ThreadIdType threadId); void GenerateData(); private: diff --git a/itk/RelativePositionPropImageFilter.txx b/itk/RelativePositionPropImageFilter.txx index 15a5773..8e677b9 100644 --- a/itk/RelativePositionPropImageFilter.txx +++ b/itk/RelativePositionPropImageFilter.txx @@ -82,7 +82,7 @@ namespace itk template< class TInputImage, class TOutputImage ,class TtNorm> void RelativePositionPropImageFilter< TInputImage, TOutputImage ,TtNorm> - //::GenerateThreadedData(const typename TOutputImage::RegionType& outputRegionForThread, int threadId) + //::GenerateThreadedData(const typename TOutputImage::RegionType& outputRegionForThread, ThreadIdType threadId) ::GenerateData() { diff --git a/itk/clitkBackProjectImageFilter.h b/itk/clitkBackProjectImageFilter.h index 7de71a1..0b90558 100644 --- a/itk/clitkBackProjectImageFilter.h +++ b/itk/clitkBackProjectImageFilter.h @@ -242,7 +242,7 @@ namespace clitk void BeforeThreadedGenerateData(void ); // Threaded Generate Data - void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId ); + void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId ); //------------------------------------------------ diff --git a/itk/clitkBackProjectImageFilter.txx b/itk/clitkBackProjectImageFilter.txx index befc882..af78d84 100644 --- a/itk/clitkBackProjectImageFilter.txx +++ b/itk/clitkBackProjectImageFilter.txx @@ -303,7 +303,7 @@ namespace clitk template void BackProjectImageFilter - ::ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, int threadId ) + ::ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId ) { //Projection pointer InputImageConstPointer inputPtr=this->GetInput(); diff --git a/itk/clitkComposeVFFilter.h b/itk/clitkComposeVFFilter.h index d66d819..d043c1a 100644 --- a/itk/clitkComposeVFFilter.h +++ b/itk/clitkComposeVFFilter.h @@ -75,7 +75,7 @@ namespace clitk //======================================================================================== //Threaded execution should implement generate threaded data - void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); bool m_Verbose; PixelType m_EdgePaddingValue; diff --git a/itk/clitkComposeVFFilter.txx b/itk/clitkComposeVFFilter.txx index e70d9c3..f0bf5a9 100644 --- a/itk/clitkComposeVFFilter.txx +++ b/itk/clitkComposeVFFilter.txx @@ -36,7 +36,7 @@ namespace clitk //========================================================================================================================= //update the output for the outputRegionForThread template - void ComposeVFFilter::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) + void ComposeVFFilter::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) { //Get pointer to the output diff --git a/itk/clitkDecomposeAndReconstructImageFilter.h b/itk/clitkDecomposeAndReconstructImageFilter.h index 32d6bcc..bf97509 100644 --- a/itk/clitkDecomposeAndReconstructImageFilter.h +++ b/itk/clitkDecomposeAndReconstructImageFilter.h @@ -131,7 +131,7 @@ namespace clitk // // Threaded Generate Data // void BeforeThreadedGenerateData(void ); - // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId ); + // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId ); // void AfterThreadedGenerateData(void ); // // Override defaults // virtual void GenerateInputRequestedRegion(); diff --git a/itk/clitkDecomposeThroughErosionImageFilter.h b/itk/clitkDecomposeThroughErosionImageFilter.h index 3ab61cb..aff2b12 100644 --- a/itk/clitkDecomposeThroughErosionImageFilter.h +++ b/itk/clitkDecomposeThroughErosionImageFilter.h @@ -124,7 +124,7 @@ namespace clitk // // Threaded Generate Data // void BeforeThreadedGenerateData(void ); - // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId ); + // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId ); // void AfterThreadedGenerateData(void ); // // Override defaults // virtual void GenerateInputRequestedRegion(); diff --git a/itk/clitkExtractImageFilter.h b/itk/clitkExtractImageFilter.h index 7ea101a..aae8332 100644 --- a/itk/clitkExtractImageFilter.h +++ b/itk/clitkExtractImageFilter.h @@ -95,7 +95,7 @@ protected: void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, - int threadId ); + itk::ThreadIdType threadId ); InputImageRegionType m_ExtractionRegion; OutputImageRegionType m_OutputImageRegion; diff --git a/itk/clitkExtractImageFilter.txx b/itk/clitkExtractImageFilter.txx index 236a7cb..36cd3fd 100644 --- a/itk/clitkExtractImageFilter.txx +++ b/itk/clitkExtractImageFilter.txx @@ -237,7 +237,7 @@ template void ExtractImageFilter ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, - int threadId) + itk::ThreadIdType threadId) { itkDebugMacro(<<"Actually executing"); diff --git a/itk/clitkForwardWarpImageFilter.txx b/itk/clitkForwardWarpImageFilter.txx index c072b5d..37a76d6 100644 --- a/itk/clitkForwardWarpImageFilter.txx +++ b/itk/clitkForwardWarpImageFilter.txx @@ -84,7 +84,7 @@ protected: //the actual processing void BeforeThreadedGenerateData(); - void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); //member data typename itk::Image< double, ImageDimension>::Pointer m_Weights; @@ -124,7 +124,7 @@ void HelperClass1::Before //========================================================================================================================= //update the output for the outputRegionForThread template -void HelperClass1::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) +void HelperClass1::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) { //Get pointer to the input @@ -303,7 +303,7 @@ protected: //the actual processing - void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); //member data @@ -330,7 +330,7 @@ HelperClass2::HelperClass2() //========================================================================================================================= //update the output for the outputRegionForThread template void -HelperClass2::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) +HelperClass2::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) { //Get pointer to the input diff --git a/itk/clitkInvertVFFilter.txx b/itk/clitkInvertVFFilter.txx index 2e517c9..6bda75e 100644 --- a/itk/clitkInvertVFFilter.txx +++ b/itk/clitkInvertVFFilter.txx @@ -74,7 +74,7 @@ protected: //the actual processing void BeforeThreadedGenerateData(); - void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); //member data typename WeightsImageType::Pointer m_Weights; @@ -111,7 +111,7 @@ void HelperClass1::BeforeThreadedGenerateData() //========================================================================================================================= //update the output for the outputRegionForThread template -void HelperClass1::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) +void HelperClass1::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) { //Get pointer to the input @@ -282,7 +282,7 @@ protected: //the actual processing - void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ); + void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ); //member data @@ -308,7 +308,7 @@ template HelperClass2 void HelperClass2::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId ) +template void HelperClass2::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId ) { //Get pointer to the input diff --git a/itk/clitkReconstructThroughDilationImageFilter.h b/itk/clitkReconstructThroughDilationImageFilter.h index 32d31fe..de4d5ab 100644 --- a/itk/clitkReconstructThroughDilationImageFilter.h +++ b/itk/clitkReconstructThroughDilationImageFilter.h @@ -115,7 +115,7 @@ namespace clitk // // Threaded Generate Data // void BeforeThreadedGenerateData(void ); - // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId ); + // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId ); // void AfterThreadedGenerateData(void ); // // Override defaults // virtual void GenerateInputRequestedRegion(); diff --git a/itk/itkLabelOverlapMeasuresImageFilter.txx b/itk/itkLabelOverlapMeasuresImageFilter.txx index ced277b..dd047ba 100644 --- a/itk/itkLabelOverlapMeasuresImageFilter.txx +++ b/itk/itkLabelOverlapMeasuresImageFilter.txx @@ -145,7 +145,7 @@ template void LabelOverlapMeasuresImageFilter ::ThreadedGenerateData( const RegionType& outputRegionForThread, - int threadId ) + ThreadIdType threadId ) { ImageRegionConstIterator ItS( this->GetSourceImage(), outputRegionForThread ); diff --git a/registration/clitkDifferenceImageFilter.h b/registration/clitkDifferenceImageFilter.h index 5199d9e..b958c69 100644 --- a/registration/clitkDifferenceImageFilter.h +++ b/registration/clitkDifferenceImageFilter.h @@ -17,6 +17,7 @@ ===========================================================================**/ #ifndef __clitkDifferenceImageFilter_h #define __clitkDifferenceImageFilter_h +#include "clitkCommon.h" #include "clitkImageCommon.h" //itk include @@ -56,7 +57,7 @@ namespace clitk protected: DifferenceImageFilter(); ~DifferenceImageFilter() {}; - void ThreadedGenerateData(const OutputImageRegionType& threadRegion, int threadId); + void ThreadedGenerateData(const OutputImageRegionType& threadRegion, itk::ThreadIdType threadId); }; diff --git a/registration/clitkDifferenceImageFilter.txx b/registration/clitkDifferenceImageFilter.txx index 6aa822e..4ea8213 100644 --- a/registration/clitkDifferenceImageFilter.txx +++ b/registration/clitkDifferenceImageFilter.txx @@ -53,7 +53,7 @@ namespace clitk //========================================================================================================================= //Update template - void DifferenceImageFilter::ThreadedGenerateData(const OutputImageRegionType &threadRegion, int threadId) + void DifferenceImageFilter::ThreadedGenerateData(const OutputImageRegionType &threadRegion, itk::ThreadIdType threadId) { //Pointers to input and output typename InputImageType::ConstPointer input1=this->GetInput(0); diff --git a/registration/clitkExtractImageFilter.h b/registration/clitkExtractImageFilter.h index 1e797bc..f3eac18 100644 --- a/registration/clitkExtractImageFilter.h +++ b/registration/clitkExtractImageFilter.h @@ -93,7 +93,7 @@ protected: void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, - int threadId ); + itk::ThreadIdType threadId ); InputImageRegionType m_ExtractionRegion; OutputImageRegionType m_OutputImageRegion; diff --git a/registration/clitkExtractImageFilter.txx b/registration/clitkExtractImageFilter.txx index d321f9e..7ce13a1 100644 --- a/registration/clitkExtractImageFilter.txx +++ b/registration/clitkExtractImageFilter.txx @@ -236,7 +236,7 @@ template void ExtractImageFilter ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, - int threadId) + itk::ThreadIdType threadId) { itkDebugMacro(<<"Actually executing"); diff --git a/registration/clitkLinearCombinationImageFilter.h b/registration/clitkLinearCombinationImageFilter.h index 879f0ad..196ab02 100644 --- a/registration/clitkLinearCombinationImageFilter.h +++ b/registration/clitkLinearCombinationImageFilter.h @@ -73,7 +73,7 @@ namespace clitk LinearCombinationImageFilter(); virtual ~LinearCombinationImageFilter(){}; - virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId); + virtual void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, itk::ThreadIdType threadId); private: LinearCombinationImageFilter(const Self&); //purposely not implemented diff --git a/registration/clitkLinearCombinationImageFilter.txx b/registration/clitkLinearCombinationImageFilter.txx index fad326c..eeb61ff 100644 --- a/registration/clitkLinearCombinationImageFilter.txx +++ b/registration/clitkLinearCombinationImageFilter.txx @@ -71,7 +71,7 @@ namespace clitk template void LinearCombinationImageFilter - ::ThreadedGenerateData(const OutputImageRegionType &threadRegion, int threadId) + ::ThreadedGenerateData(const OutputImageRegionType &threadRegion, itk::ThreadIdType threadId) { //Pointers to input and output typename InputImageType::ConstPointer input1=this->GetInput(0); diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetric.h b/registration/clitkOptNormalizedCorrelationImageToImageMetric.h index 83448af..1508994 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetric.h +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetric.h @@ -130,13 +130,13 @@ private: MeasureType ComputeSums( const ParametersType & parameters ) const; - inline bool GetValueThreadProcessSample( unsigned int threadID, + inline bool GetValueThreadProcessSample( itk::ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue ) const; - inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, + inline bool GetValueAndDerivativeThreadProcessSample( itk::ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue, diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx b/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx index e8d4c27..d1a89f9 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetric.txx @@ -159,7 +159,7 @@ NormalizedCorrelationImageToImageMetric delete [] m_ThreaderDerivativeF; } m_ThreaderDerivativeF = new DerivativeType[this->m_NumberOfThreads]; - for(unsigned int threadID=0; threadIDm_NumberOfThreads; threadID++) { + for(itk::ThreadIdType threadID=0; threadIDm_NumberOfThreads; threadID++) { m_ThreaderDerivativeF[threadID].SetSize( this->m_NumberOfParameters ); } @@ -167,7 +167,7 @@ NormalizedCorrelationImageToImageMetric delete [] m_ThreaderDerivativeM; } m_ThreaderDerivativeM = new DerivativeType[this->m_NumberOfThreads]; - for(unsigned int threadID=0; threadIDm_NumberOfThreads; threadID++) { + for(itk::ThreadIdType threadID=0; threadIDm_NumberOfThreads; threadID++) { m_ThreaderDerivativeM[threadID].SetSize( this->m_NumberOfParameters ); } } @@ -177,7 +177,7 @@ template < class TFixedImage, class TMovingImage > inline bool NormalizedCorrelationImageToImageMetric ::GetValueThreadProcessSample( - unsigned int threadID, + itk::ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue) const @@ -354,7 +354,7 @@ template < class TFixedImage, class TMovingImage > inline bool NormalizedCorrelationImageToImageMetric ::GetValueAndDerivativeThreadProcessSample( - unsigned int threadID, + itk::ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue, @@ -440,7 +440,7 @@ NormalizedCorrelationImageToImageMetric 0, this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) ); - for( unsigned int threadID = 0; threadIDm_NumberOfThreads; threadID++ ) { + for( itk::ThreadIdType threadID = 0; threadIDm_NumberOfThreads; threadID++ ) { memset( m_ThreaderDerivativeF[threadID].data_block(), 0, this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) ); diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h index 65559c2..93a2ba9 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h @@ -130,13 +130,13 @@ private: MeasureType ComputeSums( const ParametersType & parameters ) const; - inline bool GetValueThreadProcessSample( unsigned int threadID, + inline bool GetValueThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue ) const; - inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, + inline bool GetValueAndDerivativeThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue, diff --git a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx index 643b802..147c6fb 100644 --- a/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx @@ -159,7 +159,7 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD delete [] m_ThreaderDerivativeF; } m_ThreaderDerivativeF = new DerivativeType[this->m_NumberOfThreads]; - for(unsigned int threadID=0; threadIDm_NumberOfThreads; threadID++) { + for(ThreadIdType threadID=0; threadIDm_NumberOfThreads; threadID++) { m_ThreaderDerivativeF[threadID].SetSize( this->m_NumberOfParameters ); } @@ -167,7 +167,7 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD delete [] m_ThreaderDerivativeM; } m_ThreaderDerivativeM = new DerivativeType[this->m_NumberOfThreads]; - for(unsigned int threadID=0; threadIDm_NumberOfThreads; threadID++) { + for(ThreadIdType threadID=0; threadIDm_NumberOfThreads; threadID++) { m_ThreaderDerivativeM[threadID].SetSize( this->m_NumberOfParameters ); } } @@ -177,7 +177,7 @@ template < class TFixedImage, class TMovingImage > inline bool NormalizedCorrelationImageToImageMetricFor3DBLUTFFD ::GetValueThreadProcessSample( - unsigned int threadID, + ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue) const @@ -354,7 +354,7 @@ template < class TFixedImage, class TMovingImage > inline bool NormalizedCorrelationImageToImageMetricFor3DBLUTFFD ::GetValueAndDerivativeThreadProcessSample( - unsigned int threadID, + ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue, @@ -464,7 +464,7 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD 0, this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) ); - for( unsigned int threadID = 0; threadIDm_NumberOfThreads; threadID++ ) { + for( ThreadIdType threadID = 0; threadIDm_NumberOfThreads; threadID++ ) { memset( m_ThreaderDerivativeF[threadID].data_block(), 0, this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) ); diff --git a/registration/clitkResampleBSplineDeformableTransformImageFilter.h b/registration/clitkResampleBSplineDeformableTransformImageFilter.h index a5788a9..3d4fbed 100644 --- a/registration/clitkResampleBSplineDeformableTransformImageFilter.h +++ b/registration/clitkResampleBSplineDeformableTransformImageFilter.h @@ -133,7 +133,7 @@ namespace clitk void GenerateData(void); // // Threaded Generate Data // void BeforeThreadedGenerateData(void ); - // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId ); + // void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId ); // void AfterThreadedGenerateData(void ); // // Override defaults // virtual void GenerateInputRequestedRegion(); diff --git a/registration/clitkTransformToDeformationFieldSource.h b/registration/clitkTransformToDeformationFieldSource.h index 69a6df7..2700821 100644 --- a/registration/clitkTransformToDeformationFieldSource.h +++ b/registration/clitkTransformToDeformationFieldSource.h @@ -184,21 +184,21 @@ protected: */ void ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, - int threadId ); + itk::ThreadIdType threadId ); /** Default implementation for resampling that works for any * transformation type. */ void NonlinearThreadedGenerateData( const OutputImageRegionType& outputRegionForThread, - int threadId ); + itk::ThreadIdType threadId ); /** Faster implementation for resampling that works for with linear * transformation types. */ void LinearThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, - int threadId ); + itk::ThreadIdType threadId ); private: diff --git a/registration/clitkTransformToDeformationFieldSource.txx b/registration/clitkTransformToDeformationFieldSource.txx index d45f49d..adac4f6 100644 --- a/registration/clitkTransformToDeformationFieldSource.txx +++ b/registration/clitkTransformToDeformationFieldSource.txx @@ -182,7 +182,7 @@ void TransformToDeformationFieldSource ::ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, - int threadId ) + itk::ThreadIdType threadId ) { // Check whether we can use a fast path for resampling. Fast path // can be used if the transformation is linear. Transform respond @@ -203,7 +203,7 @@ void TransformToDeformationFieldSource ::NonlinearThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, - int threadId ) + itk::ThreadIdType threadId ) { // Get the output pointer OutputImagePointer outputPtr = this->GetOutput(); @@ -253,7 +253,7 @@ void TransformToDeformationFieldSource ::LinearThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, - int threadId ) + itk::ThreadIdType threadId ) { // Get the output pointer OutputImagePointer outputPtr = this->GetOutput(); diff --git a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h index 7cfe51e..54eedb8 100644 --- a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h +++ b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h @@ -313,7 +313,7 @@ private: FixedImageSampleContainer & samples ); /** Compute PDF derivative contribution for each parameter. */ - virtual void ComputePDFDerivatives( unsigned int threadID, + virtual void ComputePDFDerivatives( ThreadIdType threadID, unsigned int sampleNumber, int movingImageParzenWindowIndex, const ImageDerivativesType @@ -333,26 +333,26 @@ private: mutable bool m_ImplicitDerivativesSecondPass; - virtual inline void GetValueThreadPreProcess( unsigned int threadID, + virtual inline void GetValueThreadPreProcess( ThreadIdType threadID, bool withinSampleThread ) const; - virtual inline bool GetValueThreadProcessSample( unsigned int threadID, + virtual inline bool GetValueThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue ) const; - virtual inline void GetValueThreadPostProcess( unsigned int threadID, + virtual inline void GetValueThreadPostProcess( ThreadIdType threadID, bool withinSampleThread ) const; virtual inline void GetValueAndDerivativeThreadPreProcess( - unsigned int threadID, + ThreadIdType threadID, bool withinSampleThread ) const; - virtual inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, + virtual inline bool GetValueAndDerivativeThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue, const ImageDerivativesType & movingImageGradientValue ) const; virtual inline void GetValueAndDerivativeThreadPostProcess( - unsigned int threadID, + ThreadIdType threadID, bool withinSampleThread ) const; }; diff --git a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx index 9099ca4..efe9cba 100644 --- a/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx @@ -386,7 +386,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD } m_ThreaderJointPDFSum = new double[this->m_NumberOfThreads]; - unsigned int threadID; + ThreadIdType threadID; int binRange = m_NumberOfHistogramBins / this->m_NumberOfThreads; @@ -473,7 +473,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline void MattesMutualInformationImageToImageMetricFor3DBLUTFFD -::GetValueThreadPreProcess( unsigned int threadID, +::GetValueThreadPreProcess( ThreadIdType threadID, bool withinSampleThread ) const { @@ -501,7 +501,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline bool MattesMutualInformationImageToImageMetricFor3DBLUTFFD -::GetValueThreadProcessSample( unsigned int threadID, +::GetValueThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue) const @@ -576,7 +576,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline void MattesMutualInformationImageToImageMetricFor3DBLUTFFD -::GetValueThreadPostProcess( unsigned int threadID, +::GetValueThreadPostProcess( ThreadIdType threadID, bool itkNotUsed(withinSampleThread) ) const { unsigned int t; @@ -638,7 +638,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD // MUST BE CALLED TO INITIATE PROCESSING this->GetValueMultiThreadedPostProcessInitiate(); - for(unsigned int threadID = 0; threadIDm_NumberOfThreads-1; threadID++) { + for(ThreadIdType threadID = 0; threadIDm_NumberOfThreads-1; threadID++) { m_JointPDFSum += m_ThreaderJointPDFSum[threadID]; } if ( m_JointPDFSum == 0.0 ) { @@ -720,7 +720,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline void MattesMutualInformationImageToImageMetricFor3DBLUTFFD -::GetValueAndDerivativeThreadPreProcess( unsigned int threadID, +::GetValueAndDerivativeThreadPreProcess( ThreadIdType threadID, bool itkNotUsed(withinSampleThread) ) const { if(threadID > 0) { @@ -757,7 +757,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline bool MattesMutualInformationImageToImageMetricFor3DBLUTFFD -::GetValueAndDerivativeThreadProcessSample( unsigned int threadID, +::GetValueAndDerivativeThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue, @@ -864,7 +864,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline void MattesMutualInformationImageToImageMetricFor3DBLUTFFD -::GetValueAndDerivativeThreadPostProcess( unsigned int threadID, +::GetValueAndDerivativeThreadPostProcess( ThreadIdType threadID, bool withinSampleThread ) const { this->GetValueThreadPostProcess( threadID, withinSampleThread ); @@ -931,7 +931,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD } else { this->m_PRatioArray.Fill( 0.0 ); this->m_MetricDerivative.Fill( NumericTraits< MeasureType >::Zero ); - for(unsigned int threadID = 0; threadID < this->m_NumberOfThreads-1; threadID++ ) { + for(ThreadIdType threadID = 0; threadID < this->m_NumberOfThreads-1; threadID++ ) { this->m_ThreaderMetricDerivative[threadID].Fill( NumericTraits< MeasureType >::Zero ); } this->m_ImplicitDerivativesSecondPass = false; @@ -947,7 +947,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD // CALL IF DOING THREADED POST PROCESSING this->GetValueAndDerivativeMultiThreadedPostProcessInitiate(); - for(unsigned int threadID = 0; threadIDm_NumberOfThreads-1; threadID++) { + for(ThreadIdType threadID = 0; threadIDm_NumberOfThreads-1; threadID++) { m_JointPDFSum += m_ThreaderJointPDFSum[threadID]; } if ( m_JointPDFSum == 0.0 ) { @@ -1091,7 +1091,7 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > void MattesMutualInformationImageToImageMetricFor3DBLUTFFD -::ComputePDFDerivatives( unsigned int threadID, +::ComputePDFDerivatives( ThreadIdType threadID, unsigned int sampleNumber, int pdfMovingIndex, const ImageDerivativesType & movingImageGradientValue, diff --git a/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h b/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h index acb0b1b..2eb0bc7 100644 --- a/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h +++ b/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h @@ -129,12 +129,12 @@ private: //purposely not implemented void operator=(const Self &); - inline bool GetValueThreadProcessSample( unsigned int threadID, + inline bool GetValueThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue ) const; - inline bool GetValueAndDerivativeThreadProcessSample( unsigned int threadID, + inline bool GetValueAndDerivativeThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & mappedPoint, double movingImageValue, diff --git a/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.txx b/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.txx index feaeaaf..f7b7f96 100644 --- a/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.txx @@ -115,7 +115,7 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD delete [] m_ThreaderMSEDerivatives; } m_ThreaderMSEDerivatives = new DerivativeType[this->m_NumberOfThreads]; - for(unsigned int threadID=0; threadIDm_NumberOfThreads; threadID++) { + for(ThreadIdType threadID=0; threadIDm_NumberOfThreads; threadID++) { m_ThreaderMSEDerivatives[threadID].SetSize( this->m_NumberOfParameters ); } } @@ -123,7 +123,7 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline bool MeanSquaresImageToImageMetricFor3DBLUTFFD -::GetValueThreadProcessSample( unsigned int threadID, +::GetValueThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue) const @@ -184,7 +184,7 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD template < class TFixedImage, class TMovingImage > inline bool MeanSquaresImageToImageMetricFor3DBLUTFFD -::GetValueAndDerivativeThreadProcessSample( unsigned int threadID, +::GetValueAndDerivativeThreadProcessSample( ThreadIdType threadID, unsigned long fixedImageSample, const MovingImagePointType & itkNotUsed(mappedPoint), double movingImageValue, @@ -270,7 +270,7 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD 0, this->m_NumberOfParameters * sizeof(double) ); - for( unsigned int threadID = 0; threadIDm_NumberOfThreads; threadID++ ) { + for( ThreadIdType threadID = 0; threadIDm_NumberOfThreads; threadID++ ) { memset( m_ThreaderMSEDerivatives[threadID].data_block(), 0, this->m_NumberOfParameters * sizeof(double) ); diff --git a/tools/clitkCombineImageFilter.h b/tools/clitkCombineImageFilter.h index 024b5c6..c48b1d1 100644 --- a/tools/clitkCombineImageFilter.h +++ b/tools/clitkCombineImageFilter.h @@ -90,7 +90,7 @@ namespace clitk // Update //---------------------------------------- // Generate Data - void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId); + void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId); //---------------------------------------- // Data members diff --git a/tools/clitkCombineImageFilter.txx b/tools/clitkCombineImageFilter.txx index 8a4f051..206adac 100644 --- a/tools/clitkCombineImageFilter.txx +++ b/tools/clitkCombineImageFilter.txx @@ -46,7 +46,7 @@ namespace clitk //------------------------------------------------------------------- template void - CombineImageFilter::ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId) + CombineImageFilter::ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId) { typename InputImageType::ConstPointer input1=this->GetInput(0); typename InputImageType::ConstPointer input2=this->GetInput(1); diff --git a/tools/clitkComposeVFGenericFilter.h b/tools/clitkComposeVFGenericFilter.h index c3e8bd3..dcb913e 100644 --- a/tools/clitkComposeVFGenericFilter.h +++ b/tools/clitkComposeVFGenericFilter.h @@ -21,6 +21,7 @@ // clitk #include "clitkIO.h" +#include "clitkCommon.h" #include "clitkImageCommon.h" #include "clitkComposeVFFilter.h" diff --git a/tools/clitkVectorImageToImageFilter.h b/tools/clitkVectorImageToImageFilter.h index cf5946e..f2288f0 100644 --- a/tools/clitkVectorImageToImageFilter.h +++ b/tools/clitkVectorImageToImageFilter.h @@ -86,7 +86,7 @@ namespace clitk //---------------------------------------- // Update //---------------------------------------- - void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId ); + void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId ); //---------------------------------------- // Data members diff --git a/tools/clitkVectorImageToImageFilter.txx b/tools/clitkVectorImageToImageFilter.txx index 909a422..018a8f7 100644 --- a/tools/clitkVectorImageToImageFilter.txx +++ b/tools/clitkVectorImageToImageFilter.txx @@ -47,7 +47,7 @@ namespace clitk //------------------------------------------------------------------- template void - VectorImageToImageFilter::ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, int threadId) + VectorImageToImageFilter::ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, itk::ThreadIdType threadId) { // Iterators typename OutputImageType::Pointer output=this->GetOutput();