// 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
#include "itkImageRegionIterator.h"
#include "itkImageIterator.h"
#include "vnl/vnl_math.h"
-#if ITK_VERSION_MAJOR >= 4
- #include "itkBSplineTransform.h"
-#else
- #include "itkBSplineDeformableTransform.h"
-#endif
+#include "itkBSplineDeformableTransform.h"
namespace itk
{
// Compute the transform Jacobian.
typedef typename TransformType::JacobianType JacobianType;
- const JacobianType& jacobian =
- this->m_Transform->GetJacobian(
- m_FixedImageSamples[sampleNumber].FixedImagePointValue );
+#if ITK_VERSION_MAJOR >= 4
+ JacobianType jacobian;
+ this->m_Transform->ComputeJacobianWithRespectToParameters( m_FixedImageSamples[sampleNumber].FixedImagePointValue, jacobian );
+#else
+ const JacobianType & jacobian =
+ this->m_Transform->GetJacobian( m_FixedImageSamples[sampleNumber].FixedImagePointValue );
+#endif
for ( unsigned int mu = 0; mu < m_NumberOfParameters; mu++ ) {
double innerProduct = 0.0;
weights = m_BSplineTransformWeightsArray[sampleNumber];
indices = m_BSplineTransformIndicesArray[sampleNumber];
} else {
+#if ITK_VERSION_MAJOR >= 4
+ m_BSplineTransform->ComputeJacobianFromBSplineWeightsWithRespectToPosition(
+ m_FixedImageSamples[sampleNumber].FixedImagePointValue, m_Weights, m_Indices );
+#else
m_BSplineTransform->GetJacobian(
m_FixedImageSamples[sampleNumber].FixedImagePointValue, m_Weights, m_Indices );
+#endif
}
for( unsigned int dim = 0; dim < FixedImageDimension; dim++ ) {