]> Creatis software - clitk.git/commitdiff
itk4 Remove ITK_USE_OPTIMIZED_REGISTRATION_METHODS
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 12 Sep 2011 14:45:03 +0000 (16:45 +0200)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Mon, 12 Sep 2011 14:45:03 +0000 (16:45 +0200)
- Bypass all ITK_USE_OPTIMIZED_REGISTRATION_METHODS with ITK 4. All
optimized version are now the normal version in itk4.
- Include itkImageToImageMetric.h instead of itkOptImageToImageMetric.h
- Rename GetJacobian to ComputeJacobianWithRespectToParameters.

21 files changed:
registration/clitkAffineRegistrationGenericFilter.cxx
registration/clitkBLUTDIRGenericFilter.cxx
registration/clitkGenericMetric.h
registration/clitkGenericMetric.txx
registration/clitkNormalizedCorrelationImageToImageMetric.h
registration/clitkNormalizedCorrelationImageToImageMetric.txx
registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h
registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx
registration/clitkOptNormalizedCorrelationImageToImageMetric.h
registration/clitkOptNormalizedCorrelationImageToImageMetric.txx
registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h
registration/clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx
registration/clitkShapedBLUTSpatioTemporalDIRGenericFilter.txx
registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h
registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx
registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.h
registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx
registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h
registration/itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx
registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h
registration/itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.txx

index 0c93f78e624716eb218987557382489769c0eeab..3f0145eca9d10064044db55d8908f4aebc458633 100644 (file)
@@ -176,7 +176,7 @@ void AffineRegistrationGenericFilter::UpdateWithInputImageType()
 //typedef typename InputImageType::ImageDimension Dimension;
 
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
   bool threadsGiven=m_ArgsInfo.threads_given;
   int threads=m_ArgsInfo.threads_arg;
 #endif
@@ -396,7 +396,7 @@ void AffineRegistrationGenericFilter::UpdateWithInputImageType()
   typename  MetricType::Pointer metric=genericMetric->GetMetricPointer();
   if (movingMask) metric->SetMovingImageMask(movingMask);
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
   if (threadsGiven) metric->SetNumberOfThreads( threads );
 #else
   if (m_Verbose) std::cout<<"Not setting the number of threads (not compiled with USE_OPTIMIZED_REGISTRATION_METHODS)..."<<std::endl;
index 39c1d3d53b529d263947edeca5715f2bcc66326c..4de20a5856729ffb94190bf96bb8931b785c7670 100644 (file)
@@ -627,7 +627,7 @@ namespace clitk
       typename  MetricType::Pointer metric=genericMetric->GetMetricPointer();
       if (movingMask) metric->SetMovingImageMask(movingMask);
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
       if (threadsGiven) {
         metric->SetNumberOfThreads( threads );
         if (m_Verbose) std::cout<< "Using " << threads << " threads." << std::endl;
index 5f6eb5175bbbdd595894bc3b3a0a275ca3b82e1a..ad03c7144f5611ac493007b2d2242eb2f278798e 100644 (file)
@@ -143,7 +143,7 @@ private:
   typename FixedImageType::Pointer m_FixedImage;
   typename FixedImageMaskType::ConstPointer m_FixedImageMask;
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
   FixedImagePixelType m_FixedImageSamplesIntensityThreshold;
   bool m_UseFixedImageSamplesIntensityThreshold;
 #endif
index e73644c5dc80f496861710400c526a2228ca4579..cbbcaa04a81ed6a02e088a4f364a7f7c0292c36f 100644 (file)
@@ -35,7 +35,7 @@ GenericMetric<args_info_type, FixedImageType, MovingImageType>::GenericMetric()
   m_Maximize=false;
   m_Verbose=false;
   m_FixedImageRegionGiven=false;
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
   m_FixedImageSamplesIntensityThreshold=0;
   m_UseFixedImageSamplesIntensityThreshold=false;
 #endif
@@ -274,7 +274,7 @@ GenericMetric<args_info_type,FixedImageType, MovingImageType>::GetMetricPointer(
   //m_Metric->SetFixedImageRegion(mask_region);
 
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 
   //============================================================================
   // Set the lower intensity threshold
index 053a4976518ddcbc1a123273bdf8908bd0b5b21f..e6b704b39967fa9744e26e12b5fe1211226c164c 100644 (file)
@@ -24,7 +24,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "clitkOptNormalizedCorrelationImageToImageMetric.h"
 #else
 
index d87bd0bed08b28adb8f69bd5595e1b5490c8f183..69aa81fc2a1e282e4ed0e261905cd9c0e7ec0376 100644 (file)
@@ -24,7 +24,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "clitkOptNormalizedCorrelationImageToImageMetric.txx"
 #else
 
index f7a40df8f528d42f1e6b86852055544aceed56eb..7a7d2b18e99d276f76dabf5d08dc61b8a0e109c4 100644 (file)
@@ -24,7 +24,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.h"
 #else
 
index 8aa553fd2bf14aca714bd29ecb56b1a502e1d00d..16ecec4ee09fb9dbe0075ffb11b5d672b2f12cab 100644 (file)
@@ -24,7 +24,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx"
 #else
 
index 6ea6572ff3931414946e8b4cbc34540d8deaa974..83448afee1ea403bda7ba1dbe83553f5272d89c5 100644 (file)
 #ifndef __clitkOptNormalizedCorrelationImageToImageMetric_h
 #define __clitkOptNormalizedCorrelationImageToImageMetric_h
 
-#include "itkOptImageToImageMetric.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkImageToImageMetric.h"
+#else
+  #include "itkOptImageToImageMetric.h"
+#endif
 #include "itkCovariantVector.h"
 #include "itkPoint.h"
 #include "itkIndex.h"
index ea5d9a5d048dfb88824865a53700ef3f8a6e39a0..e8d4c271316e9b735b1657cfec59203a65222fe8 100644 (file)
@@ -381,8 +381,13 @@ NormalizedCorrelationImageToImageMetric<TFixedImage,TMovingImage>
   }
 
   // Jacobian should be evaluated at the unmapped (fixed image) point.
+#if ITK_VERSION_MAJOR >= 4
+  TransformJacobianType jacobian;
+  transform->ComputeJacobianWithRespectToParameters(fixedImagePoint, jacobian);
+#else
   const TransformJacobianType & jacobian = transform
       ->GetJacobian( fixedImagePoint );
+#endif
 
   for(unsigned int par=0; par<this->m_NumberOfParameters; par++) {
     RealType sumF = itk::NumericTraits< RealType >::Zero;
index 69ac6f1ef17049811f6f0a2f061527c0f337002b..65559c2fcbb9d94b705ed7eb5c87c1bc234875df 100644 (file)
 #ifndef __clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD_h
 #define __clitkOptNormalizedCorrelationImageToImageMetricFor3DBLUTFFD_h
 
-#include "itkOptImageToImageMetric.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkImageToImageMetric.h"
+#else
+  #include "itkOptImageToImageMetric.h"
+#endif
 #include "itkCovariantVector.h"
 #include "itkPoint.h"
 #include "itkIndex.h"
index de0366e1d998baadc051fafa9d89051dec7f1947..643b8020f751979f3a6abd5ebf5e4d2cbe2d8fca 100644 (file)
@@ -381,7 +381,12 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
   }
 
   // Jacobian should be evaluated at the unmapped (fixed image) point.
+#if ITK_VERSION_MAJOR >= 4
+  TransformJacobianType jacobian;
+  transform->ComputeJacobianWithRespectToParameters( fixedImagePoint, jacobian );
+#else
   const TransformJacobianType & jacobian = transform->GetJacobian( fixedImagePoint );
+#endif
 
 //          for(unsigned int par=0; par<this->m_NumberOfParameters; par++)
 //            {
index 963fb7811cbc5f0d24d5298c6478ec01aac4d218..0ef06ab69267e988f01b9821dc44ee6e31485a14 100644 (file)
@@ -623,7 +623,7 @@ namespace clitk
     typename  MetricType::Pointer metric=genericMetric->GetMetricPointer();
     if (movingMask) metric->SetMovingImageMask(movingMask);
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
     if (threadsGiven) metric->SetNumberOfThreads( threads );
 #else
     if (m_Verbose) std::cout<<"Not setting the number of threads (not compiled with USE_OPTIMIZED_REGISTRATION_METHODS)..."<<std::endl;
index 091e36cb57f5eac7a56e58a381475806e97a88e2..c941b05d37e366de82e192eead7dfc4ccc323963 100644 (file)
@@ -40,7 +40,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.h"
 #else
 
index 7e50dc9cdd7a452ca3dc6f5d148668362d202bc6..9391dc23898a7045fec8c1c55475695c9399dc6e 100644 (file)
@@ -41,7 +41,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx"
 #else
 
index e2cfdbddb0ec65e444185cc0025806b72dc51760..f6d745dec64d4cc96ec18440f34d7649026ffc06 100644 (file)
@@ -40,7 +40,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.h"
 #else
 
index 89343e922e86b9f3940bb0be4a91fe9152cc698f..d6793e58e18fe1a9106f3ad3b4633058266462f3 100644 (file)
@@ -40,7 +40,7 @@
 // gets integrated into the main directories.
 #include "itkConfigure.h"
 
-#ifdef ITK_USE_OPTIMIZED_REGISTRATION_METHODS
+#if defined(ITK_USE_OPTIMIZED_REGISTRATION_METHODS) || ITK_VERSION_MAJOR >= 4
 #include "itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD.txx"
 #else
 
index d29260a2988ee865283ba82f1121cd32482fb91f..7cfe51e203aa30af2ef6c6c65c8bc2a3e03369e6 100644 (file)
 #ifndef __itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD_h
 #define __itkOptMattesMutualInformationImageToImageMetricFor3DBLUTFFD_h
 
-#include "itkOptImageToImageMetric.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkImageToImageMetric.h"
+#else
+  #include "itkOptImageToImageMetric.h"
+#endif
 #include "itkCovariantVector.h"
 #include "itkPoint.h"
 #include "itkIndex.h"
index 724f2bfd4c5d19bc57146e0954316ef1639bb0fc..9099ca46fb72876dc3e4a120f71d65ed6ea2e82c 100644 (file)
@@ -1152,8 +1152,13 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
       transform = this->m_Transform;
     }
 
+#if ITK_VERSION_MAJOR >= 4
+    JacobianType jacobian;
+    transform->ComputeJacobianWithRespectToParameters(this->m_FixedImageSamples[sampleNumber].point, jacobian);
+#else
     const JacobianType& jacobian =
       transform->GetJacobian( this->m_FixedImageSamples[sampleNumber].point );
+#endif
 
     //     for ( unsigned int mu = 0; mu < this->m_NumberOfParameters; mu++ )
     //       {
@@ -1221,9 +1226,15 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
         indicesHelper = &(this->m_BSplineTransformIndices);
       }
 
+#if ITK_VERSION_MAJOR >= 4
+      this->m_BSplineTransform->ComputeJacobianFromBSplineWeightsWithRespectToPosition(
+        this->m_FixedImageSamples[sampleNumber].point,
+        *weightsHelper, *indicesHelper );
+#else
       this->m_BSplineTransform->GetJacobian(
         this->m_FixedImageSamples[sampleNumber].point,
         *weightsHelper, *indicesHelper );
+#endif
     }
 
     for( unsigned int dim = 0; dim < Superclass::FixedImageDimension; dim++ ) {
index 4e8208537db3dc720c70d11d07a639c257a6b7ca..acb0b1b3aa4065be0e402fda51a3ecc0dabea788 100644 (file)
 #ifndef __itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD_h
 #define __itkOptMeanSquaresImageToImageMetricFor3DBLUTFFD_h
 
-#include "itkOptImageToImageMetric.h"
+#if ITK_VERSION_MAJOR >= 4
+  #include "itkImageToImageMetric.h"
+#else
+  #include "itkOptImageToImageMetric.h"
+#endif
 #include "itkCovariantVector.h"
 #include "itkPoint.h"
 #include "itkIndex.h"
index dcc98f6bdb07bb797180306bee54974dd9a6fd47..feaeaaff1f0370ad233ac40c18e79daccbe3c1f2 100644 (file)
@@ -213,7 +213,12 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
   }
 
   // Jacobian should be evaluated at the unmapped (fixed image) point.
+#if ITK_VERSION_MAJOR >= 4
+  TransformJacobianType jacobian;
+  transform->ComputeJacobianWithRespectToParameters(this->m_FixedImageSamples[fixedImageSample].point, jacobian);
+#else
   const TransformJacobianType & jacobian = transform ->GetJacobian( this->m_FixedImageSamples[fixedImageSample].point );
+#endif
   //double sum;
   unsigned int par, dim;
   for( par=0; par<this->m_NumberOfParameters; par+=3) {