]> Creatis software - clitk.git/blobdiff - registration/clitkCorrelationRatioImageToImageMetric.txx
Debug RTStruct conversion with empty struc
[clitk.git] / registration / clitkCorrelationRatioImageToImageMetric.txx
index a400e5100c0819fb46bc8c9bd20f93fdbe35666b..d76f020e586f6471d0d2089f8d4d3d96cb82384e 100644 (file)
@@ -51,7 +51,11 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
 template <class TFixedImage, class TMovingImage>
 void
 CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+::Initialize(void)
+#else
 ::Initialize(void) throw ( ExceptionObject )
+#endif
 {
 
   this->Superclass::Initialize();
@@ -164,7 +168,7 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
 
       //check in which bin the fixed value belongs, get the index
       const double fixedImageBinTerm =        (fixedValue - m_FixedImageMin) / m_FixedImageBinSize;
-      const unsigned int fixedImageBinIndex = static_cast<unsigned int>( vcl_floor(fixedImageBinTerm ) );
+      const unsigned int fixedImageBinIndex = static_cast<unsigned int>( std::floor(fixedImageBinTerm ) );
       //adapt the measures per bin
       this->m_mMSVPB[fixedImageBinIndex]+=movingSquaredValue;
       this->m_mSMVPB[fixedImageBinIndex]+=movingValue;
@@ -266,14 +270,8 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
     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++;
@@ -291,7 +289,7 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
 
       typename MovingImageType::IndexType mappedIndex;
       for( unsigned int j = 0; j < MovingImageType::ImageDimension; j++ ) {
-        mappedIndex[j] = static_cast<long>( vnl_math_rnd( tempIndex[j] ) );
+        mappedIndex[j] = static_cast<long>( std::round( tempIndex[j] ) );
       }
 
       const GradientPixelType gradient =
@@ -389,14 +387,8 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
     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++;
@@ -417,7 +409,7 @@ CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
 
       typename MovingImageType::IndexType mappedIndex;
       for( unsigned int j = 0; j < MovingImageType::ImageDimension; j++ ) {
-        mappedIndex[j] = static_cast<long>( vnl_math_rnd( tempIndex[j] ) );
+        mappedIndex[j] = static_cast<long>( std::round( tempIndex[j] ) );
       }
 
       const GradientPixelType gradient =