Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
This software is distributed WITHOUT ANY WARRANTY; without even
- BSD See included LICENSE.txt file
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-======================================================================-====*/
+===========================================================================**/
#ifndef _clitkCorrelationRatioImageToImageMetric_txx
#define _clitkCorrelationRatioImageToImageMetric_txx
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();
//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;
FixedImageType> FixedIteratorType;
typedef itk::ImageRegionConstIteratorWithIndex<
- ITK_TYPENAME Superclass::GradientImageType> GradientIteratorType;
+ typename Superclass::GradientImageType> GradientIteratorType;
FixedIteratorType ti( fixedImage, this->GetFixedImageRegion() );
const unsigned int ParametersDimension = this->GetNumberOfParameters();
derivative = DerivativeType( ParametersDimension );
- derivative.Fill( itk::NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+ derivative.Fill( itk::NumericTraits<typename DerivativeType::ValueType>::Zero );
ti.GoToBegin();
if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) {
const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint );
- const TransformJacobianType & jacobian =
- this->m_Transform->GetJacobian( inputPoint );
-
+ TransformJacobianType jacobian;
+ this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint , jacobian);
const RealType fixedValue = ti.Value();
this->m_NumberOfPixelsCounted++;
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 =
FixedImageType> FixedIteratorType;
typedef itk::ImageRegionConstIteratorWithIndex<
- ITK_TYPENAME Superclass::GradientImageType> GradientIteratorType;
+ typename Superclass::GradientImageType> GradientIteratorType;
FixedIteratorType ti( fixedImage, this->GetFixedImageRegion() );
const unsigned int ParametersDimension = this->GetNumberOfParameters();
derivative = DerivativeType( ParametersDimension );
- derivative.Fill( NumericTraits<ITK_TYPENAME DerivativeType::ValueType>::Zero );
+ derivative.Fill( NumericTraits<typename DerivativeType::ValueType>::Zero );
ti.GoToBegin();
if( this->m_Interpolator->IsInsideBuffer( transformedPoint ) ) {
const RealType movingValue = this->m_Interpolator->Evaluate( transformedPoint );
- const TransformJacobianType & jacobian =
- this->m_Transform->GetJacobian( inputPoint );
-
+ TransformJacobianType jacobian;
+ this->m_Transform->ComputeJacobianWithRespectToParameters( inputPoint, jacobian );
const RealType fixedValue = ti.Value();
this->m_NumberOfPixelsCounted++;
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 =