]> Creatis software - clitk.git/blobdiff - registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx
remove tools (now in tests_dav)
[clitk.git] / registration / clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx
index 5fee9e5d540da1ec7055bce99ebe2a033346def6..16ecec4ee09fb9dbe0075ffb11b5d672b2f12cab 100644 (file)
@@ -3,7 +3,7 @@
 
   Authors belong to:
   - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
+  - Léon Bérard cancer center       http://www.centreleonberard.fr
   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
 
   This software is distributed WITHOUT ANY WARRANTY; without even
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+===========================================================================**/
 
 #ifndef _clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD_txx
 #define _clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD_txx
@@ -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
 
@@ -181,13 +181,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
 
   const unsigned int ParametersDimension = this->GetNumberOfParameters();
   derivative = DerivativeType( ParametersDimension );
-  derivative.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+  derivative.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
 
   DerivativeType derivativeF = DerivativeType( ParametersDimension );
-  derivativeF.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+  derivativeF.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
 
   DerivativeType derivativeM = DerivativeType( ParametersDimension );
-  derivativeM.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+  derivativeM.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
 
   ti.GoToBegin();
   // First compute the sums
@@ -251,8 +251,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
       const RealType movingValue  = this->m_Interpolator->Evaluate( transformedPoint );
       const RealType fixedValue   = ti.Get();
 
+#if ITK_VERSION_MAJOR >= 4
+      TransformJacobianType jacobian;
+      this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian );
+#else
       const TransformJacobianType & jacobian =
         this->m_Transform->GetJacobian( inputPoint );
+#endif
 
       // Get the gradient by NearestNeighboorInterpolation:
       // which is equivalent to round up the point components.
@@ -353,16 +358,16 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
 
   const unsigned int ParametersDimension = this->GetNumberOfParameters();
   derivative = DerivativeType( ParametersDimension );
-  derivative.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+  derivative.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
 
   DerivativeType derivativeF = DerivativeType( ParametersDimension );
-  derivativeF.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+  derivativeF.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
 
   DerivativeType derivativeM = DerivativeType( ParametersDimension );
-  derivativeM.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+  derivativeM.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
 
   DerivativeType derivativeM1 = DerivativeType( ParametersDimension );
-  derivativeM1.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+  derivativeM1.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
 
   ti.GoToBegin();
   // First compute the sums
@@ -427,8 +432,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
       const RealType movingValue  = this->m_Interpolator->Evaluate( transformedPoint );
       const RealType fixedValue     = ti.Get();
 
+#if ITK_VERSION_MAJOR >= 4
+      TransformJacobianType jacobian;
+      this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian );
+#else
       const TransformJacobianType & jacobian =
         this->m_Transform->GetJacobian( inputPoint );
+#endif
 
       // Get the gradient by NearestNeighboorInterpolation:
       // which is equivalent to round up the point components.