]> Creatis software - clitk.git/commitdiff
Merge branch 'master' of https://github.com/open-vv/vv
authortbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 28 Feb 2019 13:26:46 +0000 (14:26 +0100)
committertbaudier <thomas.baudier@creatis.insa-lyon.fr>
Thu, 28 Feb 2019 13:26:46 +0000 (14:26 +0100)
41 files changed:
.travis.yml
common/clitkMatrix.cxx
itk/RelativePositionPropImageFilter.h
itk/clitkAddRelativePositionConstraintToLabelImageFilter.h
itk/clitkAddRelativePositionConstraintToLabelImageFilter.txx
itk/clitkBooleanOperatorLabelImageFilter.h
itk/clitkComposeVFFilter.txx
itk/clitkCropLikeImageFilter.h
itk/clitkForwardWarpImageFilter.h
itk/clitkForwardWarpImageFilter.txx
itk/clitkInvertVFFilter.h
itk/clitkInvertVFFilter.txx
itk/clitkLabelImageOverlapMeasureFilter.h
itk/clitkPasteImageFilter.h
itk/clitkSliceBySliceRelativePositionFilter.txx
itk/clitkVectorBSplineDecompositionImageFilter.txx
itk/clitkVectorBSplineDecompositionImageFilterWithOBD.txx
itk/clitkVectorBSplineInterpolateImageFunction.txx
itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx
itk/itkBSplineDecompositionImageFilterWithOBD.txx
itk/itkBSplineInterpolateImageFunctionWithLUT.txx
itk/itkBSplineInterpolateImageFunctionWithLUT.txx.original
itk/itkRayCastInterpolateImageFunctionWithOrigin.txx
registration/clitkAffineRegistrationGenericFilter.cxx
registration/clitkAffineRegistrationGenericFilter.h
registration/clitkBSplineDeformableTransform.txx
registration/clitkCorrelationRatioImageToImageMetric.txx
registration/clitkDeformationListStatisticsFilter.h
registration/clitkMultiResolutionPDEDeformableRegistration.txx
registration/clitkMultiResolutionPyramidRegionFilter.txx
registration/clitkOptNormalizedCorrelationImageToImageMetric.h
registration/clitkOptNormalizedCorrelationImageToImageMetric.txx
registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h
registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx
registration/clitkRecursiveSpatioTemporalMultiResolutionPyramidImageFilter.txx
registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx
registration/clitkSpatioTemporalMultiResolutionImageRegistrationMethod.txx
registration/clitkSpatioTemporalMultiResolutionPyramidImageFilter.txx
registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h
registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx
registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h

index 99db61bc90fadc2e0e3110ddcb6a00798637b62c..a36890ab68c2e384c1a3096c99188a4edd51bce7 100644 (file)
@@ -19,14 +19,14 @@ env:
     - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=4.8.7 C11=false
     - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=5.5.1 C11=false
     - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
-    - WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=false
+    - WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0rc01 QT_VERSION=5.5.1 C11=false
     - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.9.1 QT_VERSION=4.8.7 C11=true
     - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.9.1 QT_VERSION=5.5.1 C11=true
     - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
     - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=4.8.7 C11=true
     - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=5.5.1 C11=true
     - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
-    - WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=true
+    - WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0rc01 QT_VERSION=5.5.1 C11=true
 
 matrix:
   exclude:
@@ -44,7 +44,7 @@ matrix:
     env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
   - os: linux
     compiler: clang
-    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=false
+    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0rc01 QT_VERSION=5.5.1 C11=false
   - os: linux
     compiler: clang
     env: WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
@@ -53,19 +53,19 @@ matrix:
     env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
   - os: linux
     compiler: clang
-    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=true
+    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0rc01 QT_VERSION=5.5.1 C11=true
   - os: osx
     env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
   - os: osx
     env: WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
   - os: osx
-    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=flase
+    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0rc01 QT_VERSION=5.5.1 C11=flase
   - os: osx
     env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
   - os: osx
     env: WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
   - os: osx
-    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=true
+    env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0rc01 QT_VERSION=5.5.1 C11=true
 
 
 language: cpp
index 2c09f311dd523416720c3496e890de46eaf1397b..e4afa7b20c7646e0c64562b1a004d78e88f941f2 100644 (file)
@@ -35,7 +35,7 @@ Get4x4MatrixDoubleAsString(vtkMatrix4x4 *matrix,
   for (unsigned int j = 0; j < 4; j++){
     double absmax = 0.;
     for (unsigned int i = 0; i < 4; i++)
-      absmax = std::max(absmax, vnl_math_abs(matrix->GetElement(i, j)));
+      absmax = std::max(absmax, std::abs(matrix->GetElement(i, j)));
     unsigned ndigits = (unsigned)std::max(0.,std::log10(absmax))+1;
     width[j] = precision+ndigits+3;
   }
index e876f9fd6e042ba29a134f1f9cb709fdbe09f891..c2391e7b538a16cbf06ba0ad0eddfe77d0b0a56c 100644 (file)
@@ -181,7 +181,7 @@ namespace itk
       {
         m_Alpha1 = 0;
         m_Alpha2 = 0;
-        m_K1 = vcl_acos(-1.0)/2;
+        m_K1 = std::acos(-1.0)/2;
         // m_K2 = 3.1417/2;
         m_Radius = 2; // DS
         m_Fast = true; // DS
index 45f331ed9d7cf5e55989a1852a54f9737bdccc90..df052838b2f7e12e139a77fccdd734b3a0f80a16 100644 (file)
@@ -149,7 +149,11 @@ namespace clitk {
     typename FloatImageType::Pointer GetFuzzyMap() { return m_FuzzyMap; }
 
     // I dont want to verify inputs information
+#if ITK_VERSION_MAJOR <= 4
     virtual void VerifyInputInformation() ITK_OVERRIDE { }
+#else
+    virtual void VerifyInputInformation() const ITK_OVERRIDE { }
+#endif
     
     // For debug
     void PrintOptions();
index c97ba0ea915b4aef1bfd79c3b5611906c9d1f1cc..0e3581ee2eeae844b806e15ecd5a3fabbc620897 100644 (file)
@@ -61,7 +61,7 @@ AddRelativePositionConstraintToLabelImageFilter():
   FuzzyMapOnlyFlagOff();
   FastFlagOff();
   SetRadius(2.0);
-  SetK1(vcl_acos(-1.0)/2);
+  SetK1(std::acos(-1.0)/2);
 }
 //--------------------------------------------------------------------
 
index e7d1b73113fb99918b1dd001308373f76a880b87..523a179f8087f713919883e28194f259b7f4a119 100644 (file)
@@ -99,8 +99,12 @@ namespace clitk {
     itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension);
 
     // I dont want to verify inputs information
+#if ITK_VERSION_MAJOR <= 4
     virtual void VerifyInputInformation() ITK_OVERRIDE { }
-    
+#else
+    virtual void VerifyInputInformation() const ITK_OVERRIDE { }
+#endif
+
   protected:
     BooleanOperatorLabelImageFilter();
     virtual ~BooleanOperatorLabelImageFilter() {}
index 5cc5db123bc505a9a77836b7160d00058d309e7c..e42c8520e66392f5619162be817b2f6b32b5f03e 100644 (file)
@@ -98,7 +98,7 @@ namespace clitk
              {
                // The following  block is equivalent to the following line without
                // having to call floor. (Only for positive inputs, we already now that is in the image)
-               // baseIndex[dim] = (long) vcl_floor(contIndex[dim] );
+               // baseIndex[dim] = (long) std::floor(contIndex[dim] );
        
                baseIndex[dim] = (long) contIndex[dim];
                distance[dim] = contIndex[dim] - double( baseIndex[dim] );
index 47ae445a2b2312c53b6e8521b684110f0449e205..6e6360891c05112f5a9505a7970c82918dfa3cba 100644 (file)
@@ -71,7 +71,11 @@ namespace clitk {
     itkStaticConstMacro(ImageDimension, unsigned int, ImageType::ImageDimension);
 
     // I dont want to verify inputs information
+#if ITK_VERSION_MAJOR <= 4
     virtual void VerifyInputInformation() ITK_OVERRIDE { }
+#else
+    virtual void VerifyInputInformation() const ITK_OVERRIDE { }
+#endif
 
   protected:
     CropLikeImageFilter();
index 7efac8fc8268291bd3564fb0a1a03045a9744cbb..ec46f0ca8fa97a11590c8a0a0c750b5d4e7a809a 100644 (file)
 #include "itkImageRegionIterator.h"
 #include "itkImageRegionIteratorWithIndex.h"
 #include "itkNumericTraits.h"
+#if ITK_VERSION_MAJOR <= 4
 #include "itkSimpleFastMutexLock.h"
+#else
+#include <mutex>
+#endif
 
 namespace clitk
 {
@@ -56,7 +60,9 @@ namespace clitk
     //Some other typedefs
     typedef double CoordRepType;
     typedef itk::Image<double, ImageDimension> WeightsImageType;
+#if ITK_VERSION_MAJOR <= 4
     typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension> MutexImageType;
+#endif
 
     /** Point type */
     typedef itk::Point<CoordRepType,itkGetStaticConstMacro(ImageDimension)> PointType;
index 4d49b4dd7e98cf9d5797fcc4127eb29d86963614..4c38b5a5e3d5a627668de493c6cefccb6e2d5021 100644 (file)
@@ -53,7 +53,9 @@ public:
   //Typedefs
   typedef typename OutputImageType::PixelType        OutputPixelType;
   typedef itk::Image<double, ImageDimension > WeightsImageType;
-  typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension > MutexImageType;
+#if ITK_VERSION_MAJOR <= 4
+    typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension> MutexImageType;
+#endif
   //===================================================================================
   //Set methods
   void SetWeights(const typename WeightsImageType::Pointer input) {
@@ -64,11 +66,18 @@ public:
     m_DeformationField=input;
     this->Modified();
   }
+#if ITK_VERSION_MAJOR <= 4
   void SetMutexImage(const typename MutexImageType::Pointer input) {
     m_MutexImage=input;
     this->Modified();
     m_ThreadSafe=true;
   }
+#else
+  void SetMutexImage() {
+    this->Modified();
+    m_ThreadSafe=true;
+  }
+#endif
 
   //Get methods
   typename WeightsImageType::Pointer GetWeights() {
@@ -89,7 +98,11 @@ protected:
   //member data
   typename  itk::Image< double, ImageDimension>::Pointer m_Weights;
   typename DeformationFieldType::Pointer m_DeformationField;
+#if ITK_VERSION_MAJOR <= 4
   typename MutexImageType::Pointer m_MutexImage;
+#else
+  std::mutex m_Mutex;
+#endif
   bool m_ThreadSafe;
 
 };
@@ -184,7 +197,7 @@ void HelperClass1<InputImageType, OutputImageType, DeformationFieldType>::Thread
       for(dim = 0; dim < ImageDimension; dim++) {
         // The following  block is equivalent to the following line without
         // having to call floor. For positive inputs!!!
-        // baseIndex[dim] = (long) vcl_floor(contIndex[dim] );
+        // baseIndex[dim] = (long) std::floor(contIndex[dim] );
         baseIndex[dim] = (long) contIndex[dim];
         distance[dim] = contIndex[dim] - double( baseIndex[dim] );
       }
@@ -224,14 +237,22 @@ void HelperClass1<InputImageType, OutputImageType, DeformationFieldType>::Thread
 
           } else {
             //Entering critilal section: shared memory
+#if ITK_VERSION_MAJOR <= 4
             m_MutexImage->GetPixel(neighIndex).Lock();
+#else
+            m_Mutex.lock();
+#endif
 
             //Set the pixel and weight at neighIndex
             outputPtr->SetPixel(neighIndex, outputPtr->GetPixel(neighIndex) + overlap * static_cast<OutputPixelType>(inputIt.Get()));
             m_Weights->SetPixel(neighIndex, m_Weights->GetPixel(neighIndex) + overlap);
 
             //Unlock
+#if ITK_VERSION_MAJOR <= 4
             m_MutexImage->GetPixel(neighIndex).Unlock();
+#else
+            m_Mutex.unlock();
+#endif
 
           }
           //Add to total overlap
@@ -459,11 +480,15 @@ void ForwardWarpImageFilter<InputImageType, OutputImageType, DeformationFieldTyp
   //Threadsafe?
   if(m_ThreadSafe) {
     //Allocate the mutex image
+#if ITK_VERSION_MAJOR <= 4
     typename MutexImageType::Pointer mutex=ForwardWarpImageFilter::MutexImageType::New();
     mutex->SetRegions(region);
     mutex->Allocate();
     mutex->SetSpacing(inputPtr->GetSpacing());
     helper1->SetMutexImage(mutex);
+#else
+    helper1->SetMutexImage();
+#endif
     if (m_Verbose) std::cout <<"Forwarp warping using a thread-safe algorithm" <<std::endl;
   } else  if(m_Verbose)std::cout <<"Forwarp warping using a thread-unsafe algorithm" <<std::endl;
 
index 8ad84a2e969c6ba75ed7da41dbe50676b4ab6a0b..b3167450dd810d2fe6b30b13dea74cdfc50cdec1 100644 (file)
@@ -51,7 +51,9 @@ namespace clitk
     //Some other typedefs
     typedef double CoordRepType;
     typedef itk::Image<double, ImageDimension> WeightsImageType;
+#if ITK_VERSION_MAJOR <= 4
     typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension> MutexImageType;
+#endif
 
     /** Point type */
     typedef itk::Point<CoordRepType,itkGetStaticConstMacro(ImageDimension)> PointType;
index b2485e0e51a5f6c260c3aeed26cfc5575c396543..6c91dbb9ebf4fa14d72a411b5bf0fad28ef42986 100644 (file)
@@ -47,7 +47,9 @@ public:
   //Typedefs
   typedef typename OutputImageType::PixelType        PixelType;
   typedef itk::Image<double, ImageDimension > WeightsImageType;
-  typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension > MutexImageType;
+#if ITK_VERSION_MAJOR <= 4
+  typedef itk::Image<itk::SimpleFastMutexLock, ImageDimension> MutexImageType;
+#endif
 
   //===================================================================================
   //Set methods
@@ -55,11 +57,18 @@ public:
     m_Weights = input;
     this->Modified();
   }
+#if ITK_VERSION_MAJOR <= 4
   void SetMutexImage(const typename MutexImageType::Pointer input) {
     m_MutexImage=input;
     this->Modified();
     m_ThreadSafe=true;
   }
+#else
+  void SetMutexImage() {
+    this->Modified();
+    m_ThreadSafe=true;
+  }
+#endif
 
   //Get methods
   typename  WeightsImageType::Pointer GetWeights() {
@@ -79,7 +88,11 @@ protected:
 
   //member data
   typename  WeightsImageType::Pointer m_Weights;
+#if ITK_VERSION_MAJOR <= 4
   typename MutexImageType::Pointer m_MutexImage;
+#else
+  std::mutex m_Mutex;
+#endif
   bool m_ThreadSafe;
 
 };
@@ -169,7 +182,7 @@ void HelperClass1<InputImageType, OutputImageType>::ThreadedGenerateData(const O
       for(dim = 0; dim < ImageDimension; dim++) {
         // The following  block is equivalent to the following line without
         // having to call floor. (Only for positive inputs, we already now that is in the image)
-        // baseIndex[dim] = (long) vcl_floor(contIndex[dim] );
+        // baseIndex[dim] = (long) std::floor(contIndex[dim] );
 
         baseIndex[dim] = (long) contIndex[dim];
         distance[dim] = contIndex[dim] - double( baseIndex[dim] );
@@ -215,14 +228,22 @@ void HelperClass1<InputImageType, OutputImageType>::ThreadedGenerateData(const O
 
           else {
             //Entering critilal section: shared memory
+#if ITK_VERSION_MAJOR <= 4
             m_MutexImage->GetPixel(neighIndex).Lock();
+#else
+            m_Mutex.lock();
+#endif
 
             //Set the pixel and weight at neighIndex
             outputPtr->SetPixel(neighIndex, outputPtr->GetPixel(neighIndex) - (displacement*overlap));
             m_Weights->SetPixel(neighIndex, m_Weights->GetPixel(neighIndex) + overlap);
 
             //Unlock
+#if ITK_VERSION_MAJOR <= 4
             m_MutexImage->GetPixel(neighIndex).Unlock();
+#else
+            m_Mutex.unlock();
+#endif
 
           }
           //Add to total overlap
@@ -451,11 +472,15 @@ template <class InputImageType, class OutputImageType> void InvertVFFilter<Input
   //Threadsafe?
   if(m_ThreadSafe) {
     //Allocate the mutex image
+#if ITK_VERSION_MAJOR <= 4
     typename MutexImageType::Pointer mutex=InvertVFFilter::MutexImageType::New();
     mutex->SetRegions(region);
     mutex->Allocate();
     mutex->SetSpacing(inputPtr->GetSpacing());
     helper1->SetMutexImage(mutex);
+#else
+    helper1->SetMutexImage();
+#endif
     if (m_Verbose) std::cout <<"Inverting using a thread-safe algorithm" <<std::endl;
   } else  if(m_Verbose)std::cout <<"Inverting using a thread-unsafe algorithm" <<std::endl;
 
index cf0645f15afcde53a53e8b3fb70d2da847d2d27a..b2b79aca9c7478bbc86adc1112cde1679af07b5d 100644 (file)
@@ -93,7 +93,11 @@ namespace clitk {
     itkBooleanMacro(LongFlag);
 
     // I dont want to verify inputs information
-    virtual void VerifyInputInformation() { }
+#if ITK_VERSION_MAJOR <= 4
+    virtual void VerifyInputInformation() ITK_OVERRIDE { }
+#else
+    virtual void VerifyInputInformation() const ITK_OVERRIDE { }
+#endif
 
    protected:
     LabelImageOverlapMeasureFilter();
index 5f286b3dd30e0d0a5de23d3fe3af1db4f967d83a..3429ab6681222302a1b124d18ec41a647154ccce 100644 (file)
@@ -18,7 +18,11 @@ namespace clitk
     public itk::PasteImageFilter< TInputImage, TSourceImage, TOutputImage >
   {
   public:
+#if ITK_VERSION_MAJOR <= 4
     virtual void VerifyInputInformation() ITK_OVERRIDE { }
+#else
+    virtual void VerifyInputInformation() const ITK_OVERRIDE { }
+#endif
 
     /** Standard class typedefs. */
     typedef PasteImageFilter                                Self;
index 16571ea7a224df6b17d87425d7cf8bde619a66b0..fc820be5ee44c48d8e37b2ebb2aa887b60e2921b 100644 (file)
@@ -43,7 +43,7 @@ SliceBySliceRelativePositionFilter():
   SetObjectCCLSelectionDirection(1);
   ObjectCCLSelectionIgnoreSingleCCLFlagOff();
   VerboseSlicesFlagOff();
-  this->SetK1(vcl_acos(-1.0)/2);
+  this->SetK1(std::acos(-1.0)/2);
 }
 //--------------------------------------------------------------------
 
index 7031745fec7e19f89eed894fd3ab844c3a3bcebc..90bfa5c012625d54b66f9c71346f430eb142ce52 100644 (file)
@@ -131,7 +131,7 @@ VectorBSplineDecompositionImageFilter<TInputImage, TOutputImage>
   switch (m_SplineOrder) {
   case 3:
     m_NumberOfPoles = 1;
-    m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0;
+    m_SplinePoles[0] = std::sqrt(3.0) - 2.0;
     break;
   case 0:
     m_NumberOfPoles = 0;
@@ -141,18 +141,18 @@ VectorBSplineDecompositionImageFilter<TInputImage, TOutputImage>
     break;
   case 2:
     m_NumberOfPoles = 1;
-    m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0;
+    m_SplinePoles[0] = std::sqrt(8.0) - 3.0;
     break;
   case 4:
     m_NumberOfPoles = 2;
-    m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0;
-    m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0;
+    m_SplinePoles[0] = std::sqrt(664.0 - std::sqrt(438976.0)) + std::sqrt(304.0) - 19.0;
+    m_SplinePoles[1] = std::sqrt(664.0 + std::sqrt(438976.0)) - std::sqrt(304.0) - 19.0;
     break;
   case 5:
     m_NumberOfPoles = 2;
-    m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0)
+    m_SplinePoles[0] = std::sqrt(135.0 / 2.0 - std::sqrt(17745.0 / 4.0)) + std::sqrt(105.0 / 4.0)
                        - 13.0 / 2.0;
-    m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0)
+    m_SplinePoles[1] = std::sqrt(135.0 / 2.0 + std::sqrt(17745.0 / 4.0)) - std::sqrt(105.0 / 4.0)
                        - 13.0 / 2.0;
     break;
   default:
@@ -182,7 +182,7 @@ VectorBSplineDecompositionImageFilter<TInputImage, TOutputImage>
   horizon = m_DataLength[m_IteratorDirection];
   zn = z;
   if (m_Tolerance > 0.0) {
-    horizon = (long)vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z)));
+    horizon = (long)std::ceil(log(m_Tolerance) / std::log(fabs(z)));
   }
   if (horizon < m_DataLength[m_IteratorDirection]) {
     /* accelerated loop */
@@ -195,7 +195,7 @@ VectorBSplineDecompositionImageFilter<TInputImage, TOutputImage>
   } else {
     /* full loop */
     iz = 1.0 / z;
-    z2n = vcl_pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L));
+    z2n = std::pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L));
     sum = m_Scratch[0] + z2n * m_Scratch[m_DataLength[m_IteratorDirection] - 1L];
     z2n *= z2n * iz;
     for (unsigned int n = 1; n <= (m_DataLength[m_IteratorDirection] - 2); n++) {
index 7bc316527ff3c360e840729ecc9cf88bd2c220d2..51e636155290316166c67d8d8dbe9591cda8c0bf 100644 (file)
@@ -138,7 +138,7 @@ VectorBSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
   switch (m_SplineOrder) {
   case 3:
     m_NumberOfPoles = 1;
-    m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0;
+    m_SplinePoles[0] = std::sqrt(3.0) - 2.0;
     break;
   case 0:
     m_NumberOfPoles = 0;
@@ -148,18 +148,18 @@ VectorBSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
     break;
   case 2:
     m_NumberOfPoles = 1;
-    m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0;
+    m_SplinePoles[0] = std::sqrt(8.0) - 3.0;
     break;
   case 4:
     m_NumberOfPoles = 2;
-    m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0;
-    m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0;
+    m_SplinePoles[0] = std::sqrt(664.0 - std::sqrt(438976.0)) + std::sqrt(304.0) - 19.0;
+    m_SplinePoles[1] = std::sqrt(664.0 + std::sqrt(438976.0)) - std::sqrt(304.0) - 19.0;
     break;
   case 5:
     m_NumberOfPoles = 2;
-    m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0)
+    m_SplinePoles[0] = std::sqrt(135.0 / 2.0 - std::sqrt(17745.0 / 4.0)) + std::sqrt(105.0 / 4.0)
                        - 13.0 / 2.0;
-    m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0)
+    m_SplinePoles[1] = std::sqrt(135.0 / 2.0 + std::sqrt(17745.0 / 4.0)) - std::sqrt(105.0 / 4.0)
                        - 13.0 / 2.0;
     break;
   default:
@@ -189,7 +189,7 @@ VectorBSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
   horizon = m_DataLength[m_IteratorDirection];
   zn = z;
   if (m_Tolerance > 0.0) {
-    horizon = (long)vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z)));
+    horizon = (long)std::ceil(log(m_Tolerance) / std::log(fabs(z)));
   }
   if (horizon < m_DataLength[m_IteratorDirection]) {
     /* accelerated loop */
@@ -202,7 +202,7 @@ VectorBSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
   } else {
     /* full loop */
     iz = 1.0 / z;
-    z2n = vcl_pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L));
+    z2n = std::pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L));
     sum = m_Scratch[0] + z2n * m_Scratch[m_DataLength[m_IteratorDirection] - 1L];
     z2n *= z2n * iz;
     for (unsigned int n = 1; n <= (m_DataLength[m_IteratorDirection] - 2); n++) {
index 2599b80a0f68bc3dcbf8f8ec3d4aa0a47af913f1..935f257f13d1b5a30ab05bf6180d1a7121b097d8 100644 (file)
@@ -484,12 +484,12 @@ VectorBSplineInterpolateImageFunction<TImageType,TCoordRep,TCoefficientType>
 // compute the interpolation indexes
   for (unsigned int n = 0; n< ImageDimension; n++) {
     if (splineOrder & 1) {   // Use this index calculation for odd splineOrder
-      indx = (long)vcl_floor((float)x[n]) - splineOrder / 2;
+      indx = (long)std::floor((float)x[n]) - splineOrder / 2;
       for (unsigned int k = 0; k <= splineOrder; k++) {
         evaluateIndex[n][k] = indx++;
       }
     } else {                   // Use this index calculation for even splineOrder
-      indx = (long)vcl_floor((float)(x[n] + 0.5)) - splineOrder / 2;
+      indx = (long)std::floor((float)(x[n] + 0.5)) - splineOrder / 2;
       for (unsigned int k = 0; k <= splineOrder; k++) {
         evaluateIndex[n][k] = indx++;
       }
index a237a35871b8866b2238c61eebea1e5386de4752..7096224daeee13aadb0b505888ce1d152b743dda 100644 (file)
@@ -206,7 +206,7 @@ GetSampleIndexOfPixelPosition(const ContinuousIndexType & x, IndexType & Evaluat
 
   for(int l=0; l<TImageType::ImageDimension; l++) {
     // Compute t1 = distance to floor
-    TCoefficientType t1 = x[l]- vcl_floor(x[l]);
+    TCoefficientType t1 = x[l]- std::floor(x[l]);
 
     // Compute index in precomputed weights table
     TCoefficientType t2 = mSamplingFactors[l]*t1;
@@ -255,12 +255,12 @@ EvaluateAtContinuousIndex(const ContinuousIndexType & x) const
   long indx;
   for (unsigned int l=0; l<d; l++)  {
     if (mSplineOrders[l] & 1) {  // Use this index calculation for odd splineOrder (like cubic)
-      indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
+      indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
       evaluateIndex[l] = indx;
     } else { // Use this index calculation for even splineOrder
       if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round<long, typename ContinuousIndexType::ValueType>(x[l]);
       else {
-        indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
+        indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
         evaluateIndex[l] = indx;
       }
     }
@@ -355,12 +355,12 @@ EvaluateWeightsAtContinuousIndex(const ContinuousIndexType&  x,  const TCoeffici
   long indx;
   for (unsigned int l=0; l<d; l++)  {
     if (mSplineOrders[l] & 1) {  // Use this index calculation for odd splineOrder (like cubic)
-      indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
+      indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
       evaluateIndex[l] = indx;
     } else { // Use this index calculation for even splineOrder
       if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round<long, typename ContinuousIndexType::ValueType>(x[l]);
       else {
-        indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
+        indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
         evaluateIndex[l] = indx;
       }
     }
index 80414092681c333ecf58ee0004c8990b9af85237..46af35997f837db37d912b6977d2c70664ee1aa3 100644 (file)
@@ -146,7 +146,7 @@ BSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
 
   case 3:
     m_NumberOfPoles = 1;
-    m_SplinePoles[0] = vcl_sqrt(3.0) - 2.0;
+    m_SplinePoles[0] = std::sqrt(3.0) - 2.0;
     break;
   case 0:
     m_NumberOfPoles = 0;
@@ -156,18 +156,18 @@ BSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
     break;
   case 2:
     m_NumberOfPoles = 1;
-    m_SplinePoles[0] = vcl_sqrt(8.0) - 3.0;
+    m_SplinePoles[0] = std::sqrt(8.0) - 3.0;
     break;
   case 4:
     m_NumberOfPoles = 2;
-    m_SplinePoles[0] = vcl_sqrt(664.0 - vcl_sqrt(438976.0)) + vcl_sqrt(304.0) - 19.0;
-    m_SplinePoles[1] = vcl_sqrt(664.0 + vcl_sqrt(438976.0)) - vcl_sqrt(304.0) - 19.0;
+    m_SplinePoles[0] = std::sqrt(664.0 - std::sqrt(438976.0)) + std::sqrt(304.0) - 19.0;
+    m_SplinePoles[1] = std::sqrt(664.0 + std::sqrt(438976.0)) - std::sqrt(304.0) - 19.0;
     break;
   case 5:
     m_NumberOfPoles = 2;
-    m_SplinePoles[0] = vcl_sqrt(135.0 / 2.0 - vcl_sqrt(17745.0 / 4.0)) + vcl_sqrt(105.0 / 4.0)
+    m_SplinePoles[0] = std::sqrt(135.0 / 2.0 - std::sqrt(17745.0 / 4.0)) + std::sqrt(105.0 / 4.0)
                        - 13.0 / 2.0;
-    m_SplinePoles[1] = vcl_sqrt(135.0 / 2.0 + vcl_sqrt(17745.0 / 4.0)) - vcl_sqrt(105.0 / 4.0)
+    m_SplinePoles[1] = std::sqrt(135.0 / 2.0 + std::sqrt(17745.0 / 4.0)) - std::sqrt(105.0 / 4.0)
                        - 13.0 / 2.0;
     break;
   default:
@@ -196,7 +196,7 @@ BSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
   horizon = m_DataLength[m_IteratorDirection];
   zn = z;
   if (m_Tolerance > 0.0) {
-    horizon = (long)vcl_ceil(log(m_Tolerance) / vcl_log(fabs(z)));
+    horizon = (long)std::ceil(log(m_Tolerance) / std::log(fabs(z)));
   }
   if (horizon < m_DataLength[m_IteratorDirection]) {
     /* accelerated loop */
@@ -209,7 +209,7 @@ BSplineDecompositionImageFilterWithOBD<TInputImage, TOutputImage>
   } else {
     /* full loop */
     iz = 1.0 / z;
-    z2n = vcl_pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L));
+    z2n = std::pow(z, (double)(m_DataLength[m_IteratorDirection] - 1L));
     sum = m_Scratch[0] + z2n * m_Scratch[m_DataLength[m_IteratorDirection] - 1L];
     z2n *= z2n * iz;
     for (unsigned int n = 1; n <= (m_DataLength[m_IteratorDirection] - 2); n++) {
index b9354a5e13ce2d13762de9a7f5eefef4f7d410e8..58a173a10cea02189c190a61ec9458b226e9d44c 100644 (file)
@@ -187,7 +187,7 @@ namespace itk
     for(int l=0; l<TImageType::ImageDimension; l++) 
       {
        // Compute t1 = distance to floor 
-       TCoefficientType t1 = x[l]- vcl_floor(x[l]);
+       TCoefficientType t1 = x[l]- std::floor(x[l]);
     
        // Compute index in precomputed weights table
        TCoefficientType t2 = mSamplingFactors[l]*t1;
@@ -237,13 +237,13 @@ namespace itk
     long indx;
     for (unsigned int l=0; l<d; l++)  {
       if (mSplineOrders[l] & 1) {  // Use this index calculation for odd splineOrder (like cubic)
-       indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
+       indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
        evaluateIndex[l] = indx;
       }
       else { // Use this index calculation for even splineOrder
        if (mSplineOrders[l] == 0) evaluateIndex[l] = Math::Round<typename ContinuousIndexType::ValueType>(x[l]);
        else {
-         indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
+         indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
          evaluateIndex[l] = indx;
        }
       }
index 3a8744ff6999a55903fabfa547531ab40d6f39a9..877a78494bf33abf6359e2693fa09f5335dd5945 100644 (file)
@@ -259,7 +259,7 @@ GetSampleIndexOfPixelPosition(const ContinuousIndexType & x, IndexType & Evaluat
   // bool mChange = false;
 
   // Compute t1 = distance to floor 
-  TCoefficientType t1 = x[l]- vcl_floor(x[l]);
+  TCoefficientType t1 = x[l]- std::floor(x[l]);
     
   // Compute index in precomputed weights table
   TCoefficientType t2 = mSamplingFactors[l]*t1;
@@ -311,13 +311,13 @@ EvaluateAtContinuousIndex(const ContinuousIndexType & x) const {
   long indx;
   for (unsigned int l=0; l<d; l++)  {
     if (mSplineOrders[l] & 1) {  // Use this index calculation for odd splineOrder (like cubic)
-      indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
+      indx = (long)std::floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2;
       EvaluateIndex[l] = indx;
     }
     else { // Use this index calculation for even splineOrder
       if (mSplineOrders[l] == 0) EvaluateIndex[l] = (long)rint(x[l]);
       else {
-       indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
+       indx = (long)std::floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
        EvaluateIndex[l] = indx;
       }
     }
index ebf73cfc2d363c215b302be2c6cdd66c45bd6802..d173a4850ae58890e4ba21621c9a6f9982f804a6 100644 (file)
@@ -129,7 +129,7 @@ public:
     typename InputImageType::SpacingType spacing=this->m_Image->GetSpacing();
 
     if (m_ValidRay)
-      return vcl_sqrt(m_VoxelIncrement[0]*spacing[0]*m_VoxelIncrement[0]*spacing[0]
+      return std::sqrt(m_VoxelIncrement[0]*spacing[0]*m_VoxelIncrement[0]*spacing[0]
                       + m_VoxelIncrement[1]*spacing[1]*m_VoxelIncrement[1]*spacing[1]
                       + m_VoxelIncrement[2]*spacing[2]*m_VoxelIncrement[2]*spacing[2] );
     else
@@ -470,10 +470,10 @@ RayCastHelper<TInputImage, TCoordRep>
              + C*m_BoundingCorner[c1][2] );
 
     // initialise plane value and normalise
-    m_BoundingPlane[j][0] = A/vcl_sqrt(A*A + B*B + C*C);
-    m_BoundingPlane[j][1] = B/vcl_sqrt(A*A + B*B + C*C);
-    m_BoundingPlane[j][2] = C/vcl_sqrt(A*A + B*B + C*C);
-    m_BoundingPlane[j][3] = D/vcl_sqrt(A*A + B*B + C*C);
+    m_BoundingPlane[j][0] = A/std::sqrt(A*A + B*B + C*C);
+    m_BoundingPlane[j][1] = B/std::sqrt(A*A + B*B + C*C);
+    m_BoundingPlane[j][2] = C/std::sqrt(A*A + B*B + C*C);
+    m_BoundingPlane[j][3] = D/std::sqrt(A*A + B*B + C*C);
 
     if ( (A*A + B*B + C*C) == 0 ) {
       itk::ExceptionObject err(__FILE__, __LINE__);
@@ -799,9 +799,9 @@ RayCastHelper<TInputImage, TCoordRep>
 
   // Calculate the number of voxels in each direction
 
-  xNum = vcl_fabs(m_RayVoxelStartPosition[0] - m_RayVoxelEndPosition[0]);
-  yNum = vcl_fabs(m_RayVoxelStartPosition[1] - m_RayVoxelEndPosition[1]);
-  zNum = vcl_fabs(m_RayVoxelStartPosition[2] - m_RayVoxelEndPosition[2]);
+  xNum = std::fabs(m_RayVoxelStartPosition[0] - m_RayVoxelEndPosition[0]);
+  yNum = std::fabs(m_RayVoxelStartPosition[1] - m_RayVoxelEndPosition[1]);
+  zNum = std::fabs(m_RayVoxelStartPosition[2] - m_RayVoxelEndPosition[2]);
 
   // The direction iterated in is that with the greatest number of voxels
   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -991,9 +991,9 @@ RayCastHelper<TInputImage, TCoordRep>
     startOK = false;
     endOK = false;
 
-    Istart[0] = (int) vcl_floor(m_RayVoxelStartPosition[0]);
-    Istart[1] = (int) vcl_floor(m_RayVoxelStartPosition[1]);
-    Istart[2] = (int) vcl_floor(m_RayVoxelStartPosition[2]);
+    Istart[0] = (int) std::floor(m_RayVoxelStartPosition[0]);
+    Istart[1] = (int) std::floor(m_RayVoxelStartPosition[1]);
+    Istart[2] = (int) std::floor(m_RayVoxelStartPosition[2]);
 
     if( (Istart[0] >= 0) && (Istart[0] + Idirn[0] < m_NumberOfVoxelsInX) &&
         (Istart[1] >= 0) && (Istart[1] + Idirn[1] < m_NumberOfVoxelsInY) &&
@@ -1008,13 +1008,13 @@ RayCastHelper<TInputImage, TCoordRep>
       m_TotalRayVoxelPlanes--;
     }
 
-    Istart[0] = (int) vcl_floor(m_RayVoxelStartPosition[0]
+    Istart[0] = (int) std::floor(m_RayVoxelStartPosition[0]
                                 + m_TotalRayVoxelPlanes*m_VoxelIncrement[0]);
 
-    Istart[1] = (int) vcl_floor(m_RayVoxelStartPosition[1]
+    Istart[1] = (int) std::floor(m_RayVoxelStartPosition[1]
                                 + m_TotalRayVoxelPlanes*m_VoxelIncrement[1]);
 
-    Istart[2] = (int) vcl_floor(m_RayVoxelStartPosition[2]
+    Istart[2] = (int) std::floor(m_RayVoxelStartPosition[2]
                                 + m_TotalRayVoxelPlanes*m_VoxelIncrement[2]);
 
     if( (Istart[0] >= 0) && (Istart[0] + Idirn[0] < m_NumberOfVoxelsInX) &&
@@ -1286,18 +1286,18 @@ RayCastHelper<TInputImage, TCoordRep>
 
   switch( m_TraversalDirection ) {
   case TRANSVERSE_IN_X: {
-    y = m_Position3Dvox[1] - vcl_floor(m_Position3Dvox[1]);
-    z = m_Position3Dvox[2] - vcl_floor(m_Position3Dvox[2]);
+    y = m_Position3Dvox[1] - std::floor(m_Position3Dvox[1]);
+    z = m_Position3Dvox[2] - std::floor(m_Position3Dvox[2]);
     break;
   }
   case TRANSVERSE_IN_Y: {
-    y = m_Position3Dvox[0] - vcl_floor(m_Position3Dvox[0]);
-    z = m_Position3Dvox[2] - vcl_floor(m_Position3Dvox[2]);
+    y = m_Position3Dvox[0] - std::floor(m_Position3Dvox[0]);
+    z = m_Position3Dvox[2] - std::floor(m_Position3Dvox[2]);
     break;
   }
   case TRANSVERSE_IN_Z: {
-    y = m_Position3Dvox[0] - vcl_floor(m_Position3Dvox[0]);
-    z = m_Position3Dvox[1] - vcl_floor(m_Position3Dvox[1]);
+    y = m_Position3Dvox[0] - std::floor(m_Position3Dvox[0]);
+    z = m_Position3Dvox[1] - std::floor(m_Position3Dvox[1]);
     break;
   }
   default: {
@@ -1322,7 +1322,7 @@ void
 RayCastHelper<TInputImage, TCoordRep>
 ::IncrementIntensities(double increment)
 {
-  short inc = (short) vcl_floor(increment + 0.5);
+  short inc = (short) std::floor(increment + 0.5);
 
   if (! m_ValidRay) {
     return;
index d034912f7eea9497942f11d63100bfcde79e2760..2c94379e99e1f8411710e20e968b82c96b3467a5 100644 (file)
 #define CLITKAFFINEREGISTRATIONGENERICFILTER_CXX
 
 #include "clitkAffineRegistrationGenericFilter.h"
+// clitk include
+#include "clitkIO.h"
+#include "clitkCommon.h"
+#include "clitkImageCommon.h"
+#include "clitkAffineRegistration_ggo.h"
+#include "clitkImageArithm_ggo.h"
+#include "clitkCorrelationRatioImageToImageMetric.h"
+#include "clitkTransformUtilities.h"
+#include "clitkGenericMetric.h"
+#include "clitkGenericOptimizer.h"
+#include "clitkGenericInterpolator.h"
+#include "clitkGenericAffineTransform.h"
+#include "clitkImageToImageGenericFilter.h"
+
+
+//itk include
+#include <itkMultiResolutionImageRegistrationMethod.h>
+#include <itkMultiResolutionPyramidImageFilter.h>
+#include <itkImageToImageMetric.h>
+#include <itkEuler2DTransform.h>
+#include <itkCenteredEuler3DTransform.h>
+#include <itkImage.h>
+#include <itkResampleImageFilter.h>
+#include <itkCastImageFilter.h>
+#include <itkNormalizeImageFilter.h>
+#include <itkDiscreteGaussianImageFilter.h>
+#include <itkImageMaskSpatialObject.h>
+#include <itkCommand.h>
+#include <itkCheckerBoardImageFilter.h>
+#include <itkSubtractImageFilter.h>
+#include <itkLightObject.h>
+#include <itkImageMomentsCalculator.h>
+#include <itkThresholdImageFilter.h>
+
+// other includes
+#include <time.h>
+#include <iostream>
+#include <iomanip>
+
 
 namespace clitk
 {
index 22b9f522585c241f99ee48e3a3376e6a861d4a56..94890ddd59a6d63a5ea492a10a3a9b535acc9dce 100644 (file)
 #define CLITKAFFINEREGISTRATIONGENERICFILTER_H
 
 // clitk include
-#include "clitkIO.h"
-#include "clitkCommon.h"
-#include "clitkImageCommon.h"
 #include "clitkAffineRegistration_ggo.h"
-#include "clitkImageArithm_ggo.h"
-#include "clitkCorrelationRatioImageToImageMetric.h"
-#include "clitkTransformUtilities.h"
-#include "clitkGenericMetric.h"
-#include "clitkGenericOptimizer.h"
-#include "clitkGenericInterpolator.h"
-#include "clitkGenericAffineTransform.h"
 #include "clitkImageToImageGenericFilter.h"
 
 
-//itk include
-#include <itkMultiResolutionImageRegistrationMethod.h>
-#include <itkMultiResolutionPyramidImageFilter.h>
-#include <itkImageToImageMetric.h>
-#include <itkEuler2DTransform.h>
-#include <itkCenteredEuler3DTransform.h>
-#include <itkImage.h>
-#include <itkResampleImageFilter.h>
-#include <itkCastImageFilter.h>
-#include <itkNormalizeImageFilter.h>
-#include <itkDiscreteGaussianImageFilter.h>
-#include <itkImageMaskSpatialObject.h>
-#include <itkCommand.h>
-#include <itkCheckerBoardImageFilter.h>
-#include <itkSubtractImageFilter.h>
-#include <itkLightObject.h>
-#include <itkImageMomentsCalculator.h>
-#include <itkThresholdImageFilter.h>
-
-// other includes
-#include <time.h>
-#include <iostream>
-#include <iomanip>
+
 
 namespace clitk
 {
index 60a2136d7160c9bbfce3431e376bd2d9232dd08c..151c25978d222fe6cd14dc65d57e441ca8eac693 100644 (file)
@@ -296,7 +296,7 @@ namespace clitk
        // when spline order is even.
        // The valid interval for evaluation is [start+offset, last-offset)
        // when spline order is odd.
-       // Where offset = vcl_floor(spline / 2 ).
+       // Where offset = std::floor(spline / 2 ).
        // Note that the last pixel is not included in the valid region
        // with odd spline orders.
        typename RegionType::SizeType size = m_GridRegion.GetSize();
index 1454539c8183b24d2d56a8239d027061076732d9..d76f020e586f6471d0d2089f8d4d3d96cb82384e 100644 (file)
@@ -168,7 +168,7 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
 
       //check in which bin the fixed value belongs, get the index
       const double fixedImageBinTerm =        (fixedValue - m_FixedImageMin) / m_FixedImageBinSize;
-      const unsigned int fixedImageBinIndex = static_cast<unsigned int>( vcl_floor(fixedImageBinTerm ) );
+      const unsigned int fixedImageBinIndex = static_cast<unsigned int>( std::floor(fixedImageBinTerm ) );
       //adapt the measures per bin
       this->m_mMSVPB[fixedImageBinIndex]+=movingSquaredValue;
       this->m_mSMVPB[fixedImageBinIndex]+=movingValue;
@@ -289,7 +289,7 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
 
       typename MovingImageType::IndexType mappedIndex;
       for( unsigned int j = 0; j < MovingImageType::ImageDimension; j++ ) {
-        mappedIndex[j] = static_cast<long>( vnl_math_rnd( tempIndex[j] ) );
+        mappedIndex[j] = static_cast<long>( std::round( tempIndex[j] ) );
       }
 
       const GradientPixelType gradient =
@@ -409,7 +409,7 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
 
       typename MovingImageType::IndexType mappedIndex;
       for( unsigned int j = 0; j < MovingImageType::ImageDimension; j++ ) {
-        mappedIndex[j] = static_cast<long>( vnl_math_rnd( tempIndex[j] ) );
+        mappedIndex[j] = static_cast<long>( std::round( tempIndex[j] ) );
       }
 
       const GradientPixelType gradient =
index 1a224ec497989fa92b34529d1e915c9a089508d5..1651094e74937e06507ba42df18001e9e0921d00 100644 (file)
 #include "itkImageRegionIterator.h"
 #include "itkImageRegionIteratorWithIndex.h"
 #include "itkNumericTraits.h"
+#if ITK_VERSION_MAJOR <= 4
 #include "itkSimpleFastMutexLock.h"
+#else
+#include <mutex>
+#endif
 #include "itkImageMaskSpatialObject.h"
 
 namespace clitk
index c8312e6e173085225a1a53181e01897c83123a6c..73cb497f90607af1fdf4f599ac8c16482bb2e347 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "itkRecursiveMultiResolutionPyramidImageFilter.h"
 #include "itkImageRegionIterator.h"
-#include "vnl/vnl_math.h"
 
 namespace clitk {
 
@@ -260,10 +259,10 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
   m_CurrentLevel = 0;
   m_StopRegistrationFlag = false;
 
-  unsigned int movingLevel = vnl_math_min( (int) m_CurrentLevel, 
+  unsigned int movingLevel = std::min( (int) m_CurrentLevel,
                                           (int) m_MovingImagePyramid->GetNumberOfLevels() );
 
-  unsigned int fixedLevel = vnl_math_min( (int) m_CurrentLevel, 
+  unsigned int fixedLevel = std::min( (int) m_CurrentLevel,
                                          (int) m_FixedImagePyramid->GetNumberOfLevels() );
 
   DeformationFieldPointer tempField = ITK_NULLPTR;
@@ -387,9 +386,9 @@ MultiResolutionPDEDeformableRegistration<TFixedImage,TMovingImage,TDeformationFi
 
     // Increment level counter.  
     m_CurrentLevel++;
-    movingLevel = vnl_math_min( (int) m_CurrentLevel, 
+    movingLevel = std::min( (int) m_CurrentLevel,
                                (int) m_MovingImagePyramid->GetNumberOfLevels() );
-    fixedLevel = vnl_math_min( (int) m_CurrentLevel, 
+    fixedLevel = std::min( (int) m_CurrentLevel,
                               (int) m_FixedImagePyramid->GetNumberOfLevels() );
 
     // We can release data from pyramid which are no longer required.
index 17c63d40e642086ef91583ebe39563b1e0c24fe7..eeee6026877e2bf810635ad3298014e0f476c143 100644 (file)
@@ -68,14 +68,14 @@ namespace clitk
            const float scaleFactor = static_cast<float>( m_Schedule[ level ][ dim ] );
            
            size[ dim ] = static_cast<typename SizeType::SizeValueType>(
-               vcl_floor(static_cast<float>( inputSize[ dim ] ) / scaleFactor ) );
+               std::floor(static_cast<float>( inputSize[ dim ] ) / scaleFactor ) );
            if( size[ dim ] < 1 )
              {
                size[ dim ] = 1;
              }
            
            start[ dim ] = static_cast<typename IndexType::IndexValueType>(
-                 vcl_ceil(static_cast<float>( inputStart[ dim ] ) / scaleFactor ) ); 
+                 std::ceil(static_cast<float>( inputStart[ dim ] ) / scaleFactor ) );
          }
        m_RegionPyramid[ level ].SetSize( size );
        m_RegionPyramid[ level ].SetIndex( start );
index 067cd8757132d7e6fd6c1ca8b421a849d7d8c65f..ea0657162a7d642aa8ee2da9e315d4da6fe83878 100644 (file)
@@ -24,8 +24,6 @@
 #include "itkPoint.h"
 #include "itkIndex.h"
 
-#include "itkMultiThreader.h"
-
 namespace clitk
 {
 
index ea2c52a56222a9db07d45d1026f4e4a728d0b2a6..fbb52ca470cecbd3c77a825a426f7e63e2a1ecec 100644 (file)
@@ -310,7 +310,7 @@ NormalizedCorrelationImageToImageMetric<TFixedImage,TMovingImage>
   }
 
 
-  const RealType denom = -1.0 * vcl_sqrt(sff * smm );
+  const RealType denom = -1.0 * std::sqrt(sff * smm );
   MeasureType measure;
   if( this->m_NumberOfPixelsCounted > 0 && denom != 0.0) {
     measure = sfm / denom;
@@ -400,7 +400,7 @@ NormalizedCorrelationImageToImageMetric<TFixedImage,TMovingImage>
   }
 
 
-  m_Denom = -1.0 * vcl_sqrt(m_SFF * m_SMM );
+  m_Denom = -1.0 * std::sqrt(m_SFF * m_SMM );
   MeasureType measure;
   if( this->m_NumberOfPixelsCounted > 0 && m_Denom != 0.0) {
     measure = m_SFM / m_Denom;
index 208cb38023df53f097934773c3f5cd0d6bb2926a..3afd1b6b13dae196a32e53066d2773eb27b603ef 100644 (file)
@@ -24,8 +24,6 @@
 #include "itkPoint.h"
 #include "itkIndex.h"
 
-#include "itkMultiThreader.h"
-
 namespace clitk
 {
 
index 042b4b79863927cbd9d0e4b0e57579a2f7846ec7..494c61a57934d5b89be8a05f3d22ca16ed1160e0 100644 (file)
@@ -310,7 +310,7 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
   }
 
 
-  const RealType denom = -1.0 * vcl_sqrt(sff * smm );
+  const RealType denom = -1.0 * std::sqrt(sff * smm );
   MeasureType measure;
   if( this->m_NumberOfPixelsCounted > 0 && denom != 0.0) {
     measure = sfm / denom;
@@ -400,7 +400,7 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
   }
 
 
-  m_Denom = -1.0 * vcl_sqrt(m_SFF * m_SMM );
+  m_Denom = -1.0 * std::sqrt(m_SFF * m_SMM );
   MeasureType measure;
   if( this->m_NumberOfPixelsCounted > 0 && m_Denom != 0.0) {
     measure = m_SFM / m_Denom;
index c1dd208e338e2ee84c52fcbd4bf25060884dd896..822c4ef7710b9385611f8e9f3969b52569d78886 100644 (file)
@@ -27,8 +27,6 @@
 #include "itkShrinkImageFilter.h"
 #include "itkIdentityTransform.h"
 
-#include "vnl/vnl_math.h"
-
 namespace clitk
 {
 
@@ -147,7 +145,7 @@ RecursiveSpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputIma
         factors[idim] = this->GetSchedule()[ilevel][idim] /
           this->GetSchedule()[ilevel+1][idim];
         }
-      variance[idim] = vnl_math_sqr( 0.5 * 
+      variance[idim] = std::sqr( 0.5 *
                                      static_cast<float>( factors[idim] ) );
       if( factors[idim] != 1 ) 
         { 
@@ -314,7 +312,7 @@ RecursiveSpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputIma
       if( factors[idim] > 1 )
         {
         oper->SetDirection( idim );
-        oper->SetVariance( vnl_math_sqr( 0.5 * 
+        oper->SetVariance( std::sqr( 0.5 *
                                          static_cast<float>( factors[idim] ) ) );
         oper->CreateDirectional();
         radius[idim] = oper->GetRadius()[idim];
@@ -352,7 +350,7 @@ RecursiveSpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputIma
       if( factors[idim] > 1 )
         {
         oper->SetDirection( idim );
-        oper->SetVariance( vnl_math_sqr( 0.5 * 
+        oper->SetVariance( std::sqr( 0.5 *
                                          static_cast<float>( factors[idim] ) ) );
         oper->CreateDirectional();
         radius[idim] = oper->GetRadius()[idim];
@@ -367,14 +365,14 @@ RecursiveSpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputIma
       requestedIndex[idim] += radius[idim];
       
       // take into account shrink component
-      requestedSize[idim] = static_cast<SizeValueType>( vcl_floor(
+      requestedSize[idim] = static_cast<SizeValueType>( std::floor(
                                                           static_cast<double>(requestedSize[idim]) / 
                                                           static_cast<double>(factors[idim]) ) );
       if( requestedSize[idim] < 1 )
         {
         requestedSize[idim] = 1;
         }
-      requestedIndex[idim] = static_cast<IndexValueType>( vcl_ceil(
+      requestedIndex[idim] = static_cast<IndexValueType>( std::ceil(
                                                             static_cast<double>(requestedIndex[idim]) /
                                                             static_cast<double>(factors[idim]) ) );
 
@@ -450,7 +448,7 @@ RecursiveSpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputIma
   for( idim = 0; idim < TInputImage::ImageDimension; idim++ )
     {
     oper->SetDirection(idim);
-    oper->SetVariance( vnl_math_sqr( 0.5 * static_cast<float>(
+    oper->SetVariance( std::sqr( 0.5 * static_cast<float>(
                                        this->GetSchedule()[refLevel][idim] ) ) );
     oper->SetMaximumError( this->GetMaximumError() );
     oper->CreateDirectional();
index 7cc0107ec1a58facfdbe91ef6d72dfb9bbf641dd..a57ead0be2ed89605d29457e8d1ccd976137ea79 100644 (file)
@@ -478,7 +478,7 @@ namespace clitk
        // when spline order is even.
        // The valid interval for evaluation is [start+offset, last-offset)
        // when spline order is odd.
-       // Where offset = vcl_floor(spline / 2 ).
+       // Where offset = std::floor(spline / 2 ).
        // Note that the last pixel is not included in the valid region
        // with odd spline orders.
        typename RegionType::SizeType size = m_PaddedGridRegion.GetSize();
index 4d67bafe17b9e142687a18604304d90d662a13ab..405b2c6b697c69773098c8af1174f6d990b9b62a 100644 (file)
@@ -280,14 +280,14 @@ SpatioTemporalMultiResolutionImageRegistrationMethod<TFixedImage,TMovingImage>
       const float scaleFactor = static_cast<float>( schedule[ level ][ dim ] );
 
       size[ dim ] = static_cast<typename SizeType::SizeValueType>(
-        vcl_floor(static_cast<float>( inputSize[ dim ] ) / scaleFactor ) );
+        std::floor(static_cast<float>( inputSize[ dim ] ) / scaleFactor ) );
       if( size[ dim ] < 1 )
         {
         size[ dim ] = 1;
         }
       
       start[ dim ] = static_cast<typename IndexType::IndexValueType>(
-        vcl_ceil(static_cast<float>( inputStart[ dim ] ) / scaleFactor ) ); 
+        std::ceil(static_cast<float>( inputStart[ dim ] ) / scaleFactor ) );
       }
     m_FixedImageRegionPyramid[ level ].SetSize( size );
     m_FixedImageRegionPyramid[ level ].SetIndex( start );
index 4c01738edcd7ba0ef20e89dc97b0c8616a4b04f6..d6b3c880a47ccdf0643ce53c6585abebb5994655 100644 (file)
@@ -26,8 +26,6 @@
 #include "itkShrinkImageFilter.h"
 #include "itkIdentityTransform.h"
 
-#include "vnl/vnl_math.h"
-
 namespace clitk
 {
 
@@ -218,7 +216,7 @@ SpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputImage>
          //  schedule[level-1] );
          if( level > 0 )
            {
-             m_Schedule[level][dim] = vnl_math_min( m_Schedule[level][dim], m_Schedule[level-1][dim] );
+             m_Schedule[level][dim] = std::min( m_Schedule[level][dim], m_Schedule[level-1][dim] );
            }
          
          if( m_Schedule[level][dim] < 1 )
@@ -331,7 +329,7 @@ SpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputImage>
     for( idim = 0; idim < ImageDimension; idim++ )
       {
       factors[idim] = m_Schedule[ilevel][idim];
-      variance[idim] = vnl_math_sqr( 0.5 *
+      variance[idim] = std::sqr( 0.5 *
                                      static_cast<float>( factors[idim] ) );
       }
 
@@ -433,11 +431,11 @@ SpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputImage>
       outputSpacing[idim] = inputSpacing[idim] * shrinkFactor;
 
       outputSize[idim] = static_cast<SizeValueType>(
-        vcl_floor(static_cast<double>(inputSize[idim]) / shrinkFactor ) );
+        std::floor(static_cast<double>(inputSize[idim]) / shrinkFactor ) );
       if( outputSize[idim] < 1 ) { outputSize[idim] = 1; }
 
       outputStartIndex[idim] = static_cast<IndexValueType>(
-        vcl_ceil(static_cast<double>(inputStartIndex[idim]) / shrinkFactor ) );
+        std::ceil(static_cast<double>(inputStartIndex[idim]) / shrinkFactor ) );
       }
     //Now compute the new shifted origin for the updated levels;
     const typename OutputImageType::PointType::VectorType outputOriginOffset
@@ -528,11 +526,11 @@ SpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputImage>
         double factor = static_cast<double>( m_Schedule[ilevel][idim] );
 
         outputSize[idim] = static_cast<SizeValueType>(
-          vcl_floor(static_cast<double>(baseSize[idim]) / factor ) );
+          std::floor(static_cast<double>(baseSize[idim]) / factor ) );
         if( outputSize[idim] < 1 ) { outputSize[idim] = 1; }
 
         outputIndex[idim] = static_cast<IndexValueType>(
-          vcl_ceil(static_cast<double>(baseIndex[idim]) / factor ) );
+          std::ceil(static_cast<double>(baseIndex[idim]) / factor ) );
 
         }
 
@@ -605,7 +603,7 @@ SpatioTemporalMultiResolutionPyramidImageFilter<TInputImage, TOutputImage>
   for( idim = 0; idim < TInputImage::ImageDimension; idim++ )
     {
     oper->SetDirection(idim);
-    oper->SetVariance( vnl_math_sqr( 0.5 * static_cast<float>(
+    oper->SetVariance( std::sqr( 0.5 * static_cast<float>(
                                        m_Schedule[refLevel][idim] ) ) );
     oper->SetMaximumError( m_MaximumError );
     oper->CreateDirectional();
index c51414ed6d8b6a9e51232a80a0fcc5955acafa7e..79bd1c1796e578ea4038f00b74a8e663c4ccea2f 100644 (file)
@@ -46,8 +46,6 @@
 #include "itkBSplineDeformableTransform.h"
 #include "itkArray2D.h"
 
-#include "itkMultiThreader.h"
-
 namespace itk
 {
 
index ef4257e6c66f0525a8c15806923a0aaead195ae2..9f717668e4d79e068e67099dc7a432aa68847953 100644 (file)
@@ -768,9 +768,9 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
       // check for non-zero bin contribution
       if( jointPDFValue > 1e-16 &&  movingImagePDFValue > 1e-16 ) {
 
-        double pRatio = vcl_log(jointPDFValue / movingImagePDFValue );
+        double pRatio = std::log(jointPDFValue / movingImagePDFValue );
         if( fixedImagePDFValue > 1e-16) {
-          sum += jointPDFValue * ( pRatio - vcl_log(fixedImagePDFValue ) );
+          sum += jointPDFValue * ( pRatio - std::log(fixedImagePDFValue ) );
         }
 
       }  // end if-block to check non-zero bin contribution
@@ -1093,10 +1093,10 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
       // check for non-zero bin contribution
       if( jointPDFValue > 1e-16 &&  movingImagePDFValue > 1e-16 ) {
 
-        double pRatio = vcl_log(jointPDFValue / movingImagePDFValue );
+        double pRatio = std::log(jointPDFValue / movingImagePDFValue );
 
         if( fixedImagePDFValue > 1e-16) {
-          sum += jointPDFValue * ( pRatio - vcl_log(fixedImagePDFValue ) );
+          sum += jointPDFValue * ( pRatio - std::log(fixedImagePDFValue ) );
         }
 
         if( this->m_UseExplicitPDFDerivatives ) {
index e12b42fb52684d325493940bbfd08f644f0e49ae..d23a9cd67134d14fba5a1a92313d1aeb943cf6b1 100644 (file)
@@ -40,8 +40,6 @@
 #include "itkPoint.h"
 #include "itkIndex.h"
 
-#include "itkMultiThreader.h"
-
 namespace itk
 {