]> Creatis software - clitk.git/blobdiff - registration/clitkOptNormalizedCorrelationImageToImageMetric.txx
remove tools (now in tests_dav)
[clitk.git] / registration / clitkOptNormalizedCorrelationImageToImageMetric.txx
index ea5d9a5d048dfb88824865a53700ef3f8a6e39a0..3c0dfab48791b392a2b64087e6ee568eb44e3641 100644 (file)
@@ -219,7 +219,9 @@ NormalizedCorrelationImageToImageMetric<TFixedImage,TMovingImage>
 
   // Set up the parameters in the transform
   this->m_Transform->SetParameters( parameters );
+#if ITK_VERSION_MAJOR < 4
   this->m_Parameters = parameters;
+#endif
 
   // MUST BE CALLED TO INITIATE PROCESSING
   this->GetValueMultiThreadedInitiate();
@@ -294,7 +296,9 @@ NormalizedCorrelationImageToImageMetric<TFixedImage,TMovingImage>
 
   // Set up the parameters in the transform
   this->m_Transform->SetParameters( parameters );
+#if ITK_VERSION_MAJOR < 4
   this->m_Parameters = parameters;
+#endif
 
   // MUST BE CALLED TO INITIATE PROCESSING
   this->GetValueMultiThreadedInitiate();
@@ -381,8 +385,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;
@@ -422,7 +431,9 @@ NormalizedCorrelationImageToImageMetric<TFixedImage,TMovingImage>
 
   // Set up the parameters in the transform
   this->m_Transform->SetParameters( parameters );
+#if ITK_VERSION_MAJOR < 4
   this->m_Parameters = parameters;
+#endif
 
   //We need the sums and the value to be calculated first
   value=this->ComputeSums(parameters);