From: Vivien Delmon Date: Mon, 29 Aug 2011 16:08:01 +0000 (+0200) Subject: itk4 Renaming X-Git-Tag: v1.3.0~239^2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=fa358ee6738c92950cd9e6c45f55dda6e9b4576e;p=clitk.git itk4 Renaming - Rename GetJacobian to ComputeJacobianWithRespectToParameters - Call Transform constructor without OutputDimension parameter - Rename m_Jacobian to m_SharedDataBSplineJacobian and declare it --- diff --git a/registration/clitkBSplineDeformableTransform.h b/registration/clitkBSplineDeformableTransform.h index 5a084c9..bab7f8c 100644 --- a/registration/clitkBSplineDeformableTransform.h +++ b/registration/clitkBSplineDeformableTransform.h @@ -254,7 +254,15 @@ namespace clitk } /** Compute the Jacobian Matrix of the transformation at one point */ +#if ITK_VERSION_MAJOR >= 4 + virtual void ComputeJacobianWithRespectToParameters (const InputPointType &p, JacobianType &jacobian) const; + virtual void ComputeJacobianWithRespectToPosition (const InputPointType &p, JacobianType &jacobian) const + { + itkExceptionMacro( "ComputeJacobianWithRespectToPosition not yet implemented for " << this->GetNameOfClass() ); + } +#else virtual const JacobianType& GetJacobian(const InputPointType &point ) const; +#endif /** Return the number of parameters that completely define the Transfom */ virtual unsigned int GetNumberOfParameters(void) const; @@ -363,6 +371,9 @@ namespace clitk // VD Add MultipleBSplineDeformableTransform as friend to facilitate wrapping friend class MultipleBSplineDeformableTransform; +#if ITK_VERSION_MAJOR >= 4 + mutable JacobianType m_SharedDataBSplineJacobian; +#endif }; //class BSplineDeformableTransform diff --git a/registration/clitkBSplineDeformableTransform.txx b/registration/clitkBSplineDeformableTransform.txx index db47430..1a2dfd3 100644 --- a/registration/clitkBSplineDeformableTransform.txx +++ b/registration/clitkBSplineDeformableTransform.txx @@ -32,7 +32,11 @@ namespace clitk // Constructor with default arguments template BSplineDeformableTransform +#if ITK_VERSION_MAJOR >= 4 + ::BSplineDeformableTransform():Superclass(0) +#else ::BSplineDeformableTransform():Superclass(OutputDimension,0) +#endif { unsigned int i; @@ -576,10 +580,18 @@ namespace clitk m_CoefficientImage = m_WrappedImage; //JV Wrap jacobian into OutputDimension X Vectorial images +#if ITK_VERSION_MAJOR >= 4 + this->m_SharedDataBSplineJacobian.set_size( OutputDimension, this->GetNumberOfParameters() ); +#else this->m_Jacobian.set_size( OutputDimension, this->GetNumberOfParameters() ); +#endif // Use memset to set the memory +#if ITK_VERSION_MAJOR >= 4 + JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_SharedDataBSplineJacobian.data_block()); +#else JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_Jacobian.data_block()); +#endif memset(jacobianDataPointer, 0, OutputDimension*numberOfPixels*sizeof(JacobianPixelType)); m_LastJacobianIndex = m_ValidRegion.GetIndex(); m_NeedResetJacobian = false; @@ -904,6 +916,69 @@ namespace clitk // JV weights are identical as for transformpoint, could be done simultaneously in metric!!!! // Compute the Jacobian in one position +#if ITK_VERSION_MAJOR >= 4 + template + void + BSplineDeformableTransform + ::ComputeJacobianWithRespectToParameters(const InputPointType & point, JacobianType & jacobian) const + { + if (m_NeedResetJacobian) + ResetJacobian(); + + //======================================================== + // For each dimension, copy the weight to the support region + //======================================================== + + // Check if inside mask + if (m_Mask && !(m_Mask->IsInside(point) ) ) + { + // Outside: no (deformable) displacement + jacobian = m_SharedDataBSplineJacobian; + return; + } + + //Get index + this->TransformPointToContinuousIndex( point, m_Index ); + + // NOTE: if the support region does not lie totally within the grid + // we assume zero displacement and return the input point + if ( !this->InsideValidRegion( m_Index ) ) + { + jacobian = m_SharedDataBSplineJacobian; + return; + } + + //Compute interpolation weights + const WeightsDataType *weights = NULL; + m_VectorInterpolator->EvaluateWeightsAtContinuousIndex( m_Index, &weights, m_LastJacobianIndex); + m_SupportRegion.SetIndex( m_LastJacobianIndex ); + + //Reset the iterators + unsigned int j = 0; + for ( j = 0; j < OutputDimension; j++ ) + m_Iterator[j] = IteratorType( m_JacobianImage[j], m_SupportRegion); + + // For each dimension, copy the weight to the support region + while ( ! (m_Iterator[0]).IsAtEnd() ) + { + //copy weight to jacobian image + for ( j = 0; j < OutputDimension; j++ ) + { + m_ZeroVector[j]=*weights; + (m_Iterator[j]).Set( m_ZeroVector); + m_ZeroVector[j]=itk::NumericTraits::Zero; + ++(m_Iterator[j]); + } + // go to next coefficient in the support region + weights++; + } + m_NeedResetJacobian = true; + + // Return the result + jacobian = m_SharedDataBSplineJacobian; + + } +#else template const typename BSplineDeformableTransform @@ -972,6 +1047,7 @@ namespace clitk return this->m_Jacobian; } +#endif template diff --git a/registration/clitkCorrelationRatioImageToImageMetric.txx b/registration/clitkCorrelationRatioImageToImageMetric.txx index e7133ca..aac2a78 100644 --- a/registration/clitkCorrelationRatioImageToImageMetric.txx +++ b/registration/clitkCorrelationRatioImageToImageMetric.txx @@ -266,8 +266,13 @@ CorrelationRatioImageToImageMetric if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) { const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint , jacobian); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); +#endif const RealType fixedValue = ti.Value(); @@ -384,8 +389,13 @@ CorrelationRatioImageToImageMetric if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) { const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian ); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); +#endif const RealType fixedValue = ti.Value(); diff --git a/registration/clitkDeformationFieldTransform.h b/registration/clitkDeformationFieldTransform.h index dd28959..06c5288 100644 --- a/registration/clitkDeformationFieldTransform.h +++ b/registration/clitkDeformationFieldTransform.h @@ -109,11 +109,22 @@ namespace clitk return OutputCovariantVectorType(); } +#if ITK_VERSION_MAJOR >= 4 + virtual void ComputeJacobianWithRespectToParameters (const InputPointType &p, JacobianType &jacobian) const + { + itkExceptionMacro( << "DeformationFieldTransform doesn't declare ComputeJacobianWithRespectToParameters" ); + } + virtual void ComputeJacobianWithRespectToPosition (const InputPointType &p, JacobianType &jacobian) const + { + itkExceptionMacro( << "DeformationFieldTransform doesn't declare ComputeJacobianWithRespectToPosition" ); + } +#else virtual const JacobianType& GetJacobian(const InputPointType &point ) const { itkExceptionMacro( << "DeformationFieldTransform doesn't declare GetJacobian" ); return this->m_Jacobian; } +#endif protected: DeformationFieldTransform(); diff --git a/registration/clitkDeformationFieldTransform.txx b/registration/clitkDeformationFieldTransform.txx index e8349a6..049f270 100644 --- a/registration/clitkDeformationFieldTransform.txx +++ b/registration/clitkDeformationFieldTransform.txx @@ -26,7 +26,11 @@ namespace clitk // Constructor template DeformationFieldTransform +#if ITK_VERSION_MAJOR >= 4 + ::DeformationFieldTransform():Superclass(1) +#else ::DeformationFieldTransform():Superclass(OutputDimension,1) +#endif { m_DeformationField=NULL; m_Interpolator=DefaultInterpolatorType::New(); diff --git a/registration/clitkMultipleBSplineDeformableTransform.h b/registration/clitkMultipleBSplineDeformableTransform.h index 3e8dc3a..09f008f 100644 --- a/registration/clitkMultipleBSplineDeformableTransform.h +++ b/registration/clitkMultipleBSplineDeformableTransform.h @@ -213,7 +213,15 @@ namespace clitk } /** Compute the Jacobian Matrix of the transformation at one point */ +#if ITK_VERSION_MAJOR >= 4 + virtual void ComputeJacobianWithRespectToParameters (const InputPointType &p, JacobianType &jacobian) const; + virtual void ComputeJacobianWithRespectToPosition (const InputPointType &p, JacobianType &jacobian) const + { + itkExceptionMacro( "ComputeJacobianWithRespectToPosition not yet implemented for " << this->GetNameOfClass() ); + } +#else virtual const JacobianType& GetJacobian(const InputPointType &point ) const; +#endif /** Return the number of parameters that completely define the Transfom */ virtual unsigned int GetNumberOfParameters(void) const; @@ -261,6 +269,9 @@ namespace clitk std::vector m_parameters; mutable std::vector m_CoefficientImages; mutable int m_LastJacobian; +#if ITK_VERSION_MAJOR >= 4 + mutable JacobianType m_SharedDataBSplineJacobian; +#endif void InitJacobian(); // FIXME it seems not used diff --git a/registration/clitkMultipleBSplineDeformableTransform.txx b/registration/clitkMultipleBSplineDeformableTransform.txx index 0ec20aa..32ebced 100644 --- a/registration/clitkMultipleBSplineDeformableTransform.txx +++ b/registration/clitkMultipleBSplineDeformableTransform.txx @@ -29,7 +29,11 @@ namespace clitk // Constructor with default arguments template MultipleBSplineDeformableTransform +#if ITK_VERSION_MAJOR >= 4 + ::MultipleBSplineDeformableTransform() : Superclass(0) +#else ::MultipleBSplineDeformableTransform() : Superclass(OutputDimension, 0) +#endif { m_nLabels = 1; m_labels = 0; @@ -425,15 +429,38 @@ namespace clitk return m_trans[lidx]->DeformablyTransformPoint(inputPoint); } +#if ITK_VERSION_MAJOR >= 4 + template + inline void + MultipleBSplineDeformableTransform + ::ComputeJacobianWithRespectToParameters (const InputPointType &point, JacobianType &jacobian) const + { + if (m_LastJacobian != -1) + m_trans[m_LastJacobian]->ResetJacobian(); + + int lidx = 0; + if (m_labels) + lidx = m_labelInterpolator->Evaluate(point) - 1; + if (lidx == -1) + { + m_LastJacobian = lidx; + jacobian = this->m_SharedDataBSplineJacobian; + return; + } + + JacobianType unused; + m_trans[lidx]->ComputeJacobianWithRespectToParameters(point, unused); + m_LastJacobian = lidx; + + jacobian = this->m_SharedDataBSplineJacobian; + } + +#else template inline const typename MultipleBSplineDeformableTransform::JacobianType & MultipleBSplineDeformableTransform ::GetJacobian( const InputPointType & point ) const { - /* - for (unsigned i = 0; i < m_nLabels; ++i) - m_trans[i]->ResetJacobian(); - */ if (m_LastJacobian != -1) m_trans[m_LastJacobian]->ResetJacobian(); @@ -451,6 +478,7 @@ namespace clitk return this->m_Jacobian; } +#endif template inline void @@ -465,8 +493,13 @@ namespace clitk MultipleBSplineDeformableTransform::InitJacobian() { unsigned numberOfParameters = this->GetNumberOfParameters(); +#if ITK_VERSION_MAJOR >= 4 + this->m_SharedDataBSplineJacobian.set_size(OutputDimension, numberOfParameters); + JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_SharedDataBSplineJacobian.data_block()); +#else this->m_Jacobian.set_size(OutputDimension, numberOfParameters); JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_Jacobian.data_block()); +#endif memset(jacobianDataPointer, 0, numberOfParameters * sizeof (JacobianPixelType)); unsigned tot = 0; diff --git a/registration/clitkNormalizedCorrelationImageToImageMetric.txx b/registration/clitkNormalizedCorrelationImageToImageMetric.txx index 3708f10..342549e 100644 --- a/registration/clitkNormalizedCorrelationImageToImageMetric.txx +++ b/registration/clitkNormalizedCorrelationImageToImageMetric.txx @@ -251,8 +251,13 @@ NormalizedCorrelationImageToImageMetric 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. @@ -427,8 +432,13 @@ NormalizedCorrelationImageToImageMetric 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. diff --git a/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx b/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx index 511f973..7290bd4 100644 --- a/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/clitkNormalizedCorrelationImageToImageMetricFor3DBLUTFFD.txx @@ -251,8 +251,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD 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. @@ -427,8 +432,13 @@ NormalizedCorrelationImageToImageMetricFor3DBLUTFFD 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. diff --git a/registration/clitkPointListTransform.h b/registration/clitkPointListTransform.h index 9fbd7d2..d98c525 100644 --- a/registration/clitkPointListTransform.h +++ b/registration/clitkPointListTransform.h @@ -117,11 +117,22 @@ namespace clitk return OutputCovariantVectorType(); } +#if ITK_VERSION_MAJOR >= 4 + virtual void ComputeJacobianWithRespectToParameters (const InputPointType &p, JacobianType &jacobian) const + { + itkExceptionMacro( << "PointListTransform doesn't declare ComputeJacobianWithRespectToParameters" ); + } + virtual void ComputeJacobianWithRespectToPosition (const InputPointType &p, JacobianType &jacobian) const + { + itkExceptionMacro( << "PointListTransform doesn't declare ComputeJacobianWithRespectToPosition" ); + } +#else virtual const JacobianType& GetJacobian(const InputPointType &point ) const { itkExceptionMacro( << "PointListTransform doesn't declare GetJacobian" ); return this->m_Jacobian; } +#endif protected: PointListTransform(); diff --git a/registration/clitkPointListTransform.txx b/registration/clitkPointListTransform.txx index 7a7808a..a93a309 100644 --- a/registration/clitkPointListTransform.txx +++ b/registration/clitkPointListTransform.txx @@ -26,7 +26,11 @@ namespace clitk // Constructor template PointListTransform +#if ITK_VERSION_MAJOR >= 4 + ::PointListTransform():Superclass(1) +#else ::PointListTransform():Superclass(NOutputDimensions,1) +#endif { m_PointLists.resize(0); m_PointList.resize(1); diff --git a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.h b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.h index 835123c..f3071b1 100644 --- a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.h +++ b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.h @@ -263,7 +263,15 @@ namespace clitk } /** Compute the Jacobian Matrix of the transformation at one point */ +#if ITK_VERSION_MAJOR >= 4 + virtual void ComputeJacobianWithRespectToParameters (const InputPointType &p, JacobianType &jacobian) const; + virtual void ComputeJacobianWithRespectToPosition (const InputPointType &p, JacobianType &jacobian) const + { + itkExceptionMacro( "ComputeJacobianWithRespectToPosition not yet implemented for " << this->GetNameOfClass() ); + } +#else virtual const JacobianType& GetJacobian(const InputPointType &point ) const; +#endif /** Return the number of parameters that completely define the Transfom */ virtual unsigned int GetNumberOfParameters(void) const; @@ -430,6 +438,9 @@ namespace clitk // JV Shape unsigned int m_TransformShape; +#if ITK_VERSION_MAJOR >= 4 + mutable JacobianType m_SharedDataBSplineJacobian; +#endif }; //class ShapedBLUTSpatioTemporalDeformableTransform diff --git a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx index ea50aa4..cebdb5b 100644 --- a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx +++ b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx @@ -32,7 +32,11 @@ namespace clitk // Constructor with default arguments template ShapedBLUTSpatioTemporalDeformableTransform +#if ITK_VERSION_MAJOR >= 4 + ::ShapedBLUTSpatioTemporalDeformableTransform():Superclass(0) +#else ::ShapedBLUTSpatioTemporalDeformableTransform():Superclass(OutputDimension,0) +#endif { unsigned int i; @@ -802,11 +806,19 @@ namespace clitk //===================================== //JV Wrap jacobian into OutputDimension X Vectorial images //===================================== +#if ITK_VERSION_MAJOR >= 4 + this->m_SharedDataBSplineJacobian.set_size( OutputDimension, this->GetNumberOfParameters() ); +#else this->m_Jacobian.set_size( OutputDimension, this->GetNumberOfParameters() ); +#endif // Use memset to set the memory // JV four rows of three comps of parameters +#if ITK_VERSION_MAJOR >= 4 + JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_SharedDataBSplineJacobian.data_block()); +#else JacobianPixelType * jacobianDataPointer = reinterpret_cast(this->m_Jacobian.data_block()); +#endif memset(jacobianDataPointer, 0, OutputDimension*numberOfPixels*sizeof(JacobianPixelType)); for (unsigned int j=0; j +#if ITK_VERSION_MAJOR >= 4 + void + ShapedBLUTSpatioTemporalDeformableTransform + ::ComputeJacobianWithRespectToParameters( const InputPointType & point, JacobianType & jacobian) const +#else const typename ShapedBLUTSpatioTemporalDeformableTransform ::JacobianType & ShapedBLUTSpatioTemporalDeformableTransform ::GetJacobian( const InputPointType & point ) const +#endif { //======================================================== @@ -2475,7 +2493,12 @@ namespace clitk if(m_Mask && !(m_Mask->IsInside(point) ) ) { // Outside: no (deformable) displacement +#if ITK_VERSION_MAJOR >= 4 + jacobian = m_SharedDataBSplineJacobian; + return; +#else return this->m_Jacobian; +#endif } // Get index @@ -2485,7 +2508,12 @@ namespace clitk // we assume zero displacement and return the input point if ( !this->InsideValidRegion( m_Index ) ) { +#if ITK_VERSION_MAJOR >= 4 + jacobian = m_SharedDataBSplineJacobian; + return; +#else return this->m_Jacobian; +#endif } // Compute interpolation weights @@ -2653,7 +2681,11 @@ namespace clitk } // Return the result +#if ITK_VERSION_MAJOR >= 4 + jacobian = m_SharedDataBSplineJacobian; +#else return this->m_Jacobian; +#endif } diff --git a/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx b/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx index 852583b..1b38cae 100644 --- a/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkMattesMutualInformationImageToImageMetricFor3DBLUTFFD.txx @@ -1445,9 +1445,13 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD // 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; @@ -1480,8 +1484,13 @@ MattesMutualInformationImageToImageMetricFor3DBLUTFFD 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++ ) { diff --git a/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx b/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx index 88a71c5..ec4b7ba 100644 --- a/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx +++ b/registration/itkMeanSquaresImageToImageMetricFor3DBLUTFFD.txx @@ -197,9 +197,13 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) { const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian ); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); - +#endif const RealType fixedValue = ti.Value(); this->m_NumberOfPixelsCounted++; @@ -311,9 +315,13 @@ MeanSquaresImageToImageMetricFor3DBLUTFFD if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) { const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint ); +#if ITK_VERSION_MAJOR >= 4 + TransformJacobianType jacobian; + this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian ); +#else const TransformJacobianType & jacobian = this->m_Transform->GetJacobian( inputPoint ); - +#endif const RealType fixedValue = ti.Value(); this->m_NumberOfPixelsCounted++;