- if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) )
- {
- //Accumulate calculations for the correlation ratio
- //For each pixel the is in both masks and the buffer we adapt the following measures:
- //movingMeanSquaredValue mMSV; movingSquaredMeanValue mSMV;
- //movingMeanSquaredValuePerBin[i] mSMVPB; movingSquaredMeanValuePerBin[i] mSMVPB
- //NumberOfPixelsCounted, NumberOfPixelsCountedPerBin[i]
-
- //get the value of the moving image
- const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint );
- // for the variance of the overlapping moving image we accumulate the following measures
- const RealType movingSquaredValue=movingValue*movingValue;
- mMSV+=movingSquaredValue;
- mSMV+=movingValue;
-
- //get the fixed value
- const RealType fixedValue = ti.Get();
-
- //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 ) );
- //adapt the measures per bin
- this->m_mMSVPB[fixedImageBinIndex]+=movingSquaredValue;
- this->m_mSMVPB[fixedImageBinIndex]+=movingValue;
- //increase the fixed image bin and the total pixel count
- this->m_NumberOfPixelsCountedPerBin[fixedImageBinIndex]+=1;
- this->m_NumberOfPixelsCounted++;
- }
-
- ++ti;
+ if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) {
+ //Accumulate calculations for the correlation ratio
+ //For each pixel the is in both masks and the buffer we adapt the following measures:
+ //movingMeanSquaredValue mMSV; movingSquaredMeanValue mSMV;
+ //movingMeanSquaredValuePerBin[i] mSMVPB; movingSquaredMeanValuePerBin[i] mSMVPB
+ //NumberOfPixelsCounted, NumberOfPixelsCountedPerBin[i]
+
+ //get the value of the moving image
+ const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint );
+ // for the variance of the overlapping moving image we accumulate the following measures
+ const RealType movingSquaredValue=movingValue*movingValue;
+ mMSV+=movingSquaredValue;
+ mSMV+=movingValue;
+
+ //get the fixed value
+ const RealType fixedValue = ti.Get();
+
+ //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 ) );
+ //adapt the measures per bin
+ this->m_mMSVPB[fixedImageBinIndex]+=movingSquaredValue;
+ this->m_mSMVPB[fixedImageBinIndex]+=movingValue;
+ //increase the fixed image bin and the total pixel count
+ this->m_NumberOfPixelsCountedPerBin[fixedImageBinIndex]+=1;
+ this->m_NumberOfPixelsCounted++;