From 1d70c4971d5dd20b399252a4ea339b7c878d9b74 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Fri, 3 Feb 2012 18:30:06 +0100 Subject: [PATCH] Fixed MSVC issues --- common/clitkCoeffsToDVF.h | 6 +++--- itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx | 6 +++--- tools/clitkCoeffsToDVF.cxx | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/clitkCoeffsToDVF.h b/common/clitkCoeffsToDVF.h index 603ca70..911e8a9 100644 --- a/common/clitkCoeffsToDVF.h +++ b/common/clitkCoeffsToDVF.h @@ -59,13 +59,13 @@ namespace clitk typedef itk::ImageRegionConstIterator Iterator; Iterator it (coefficientImage, coefficientImage->GetLargestPossibleRegion() ); it.GoToBegin(); - unsigned int i = 0; + unsigned int k = 0; while (! it.IsAtEnd()) { for (unsigned int j = 0; j < dim; j++) - params[i+j]=it.Get()[j]; + params[k+j]=it.Get()[j]; ++it; - i += dim; + k += dim; } transform->SetParameters(params); diff --git a/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx b/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx index 4c66a2c..7fbf9ba 100644 --- a/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx +++ b/itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx @@ -210,7 +210,7 @@ GetSampleIndexOfPixelPosition(const ContinuousIndexType & x, IndexType & Evaluat // Compute index in precomputed weights table TCoefficientType t2 = mSamplingFactors[l]*t1; - index[l] = (IndexValueType)lrint(t2); + index[l] = (IndexValueType)itk::Math::Floor(t2); // For even order : test if too close to 0.5 (but lower). In this // case : take the next coefficient @@ -258,7 +258,7 @@ EvaluateAtContinuousIndex(const ContinuousIndexType & x) const indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } else { // Use this index calculation for even splineOrder - if (mSplineOrders[l] == 0) evaluateIndex[l] = (long)rint(x[l]); + if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round(x[l]); else { indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; @@ -358,7 +358,7 @@ EvaluateWeightsAtContinuousIndex(const ContinuousIndexType& x, const TCoeffici indx = (long)vcl_floor(x[l]) - mSplineOrders[l] / 2 ; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; } else { // Use this index calculation for even splineOrder - if (mSplineOrders[l] == 0) evaluateIndex[l] = (long)rint(x[l]); + if (mSplineOrders[l] == 0) evaluateIndex[l] = itk::Math::Round(x[l]); else { indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2; evaluateIndex[l] = indx; diff --git a/tools/clitkCoeffsToDVF.cxx b/tools/clitkCoeffsToDVF.cxx index 266f8ae..f92d03a 100644 --- a/tools/clitkCoeffsToDVF.cxx +++ b/tools/clitkCoeffsToDVF.cxx @@ -21,7 +21,7 @@ int main(int argc, char** argv) GGO(clitkCoeffsToDVF, args_info); CLITK_INIT; - typename itk::ImageIOBase::Pointer image_io = itk::ImageIOFactory::CreateImageIO(args_info.input_arg, itk::ImageIOFactory::ReadMode); + itk::ImageIOBase::Pointer image_io = itk::ImageIOFactory::CreateImageIO(args_info.input_arg, itk::ImageIOFactory::ReadMode); image_io->SetFileName(args_info.input_arg); image_io->ReadImageInformation(); @@ -32,7 +32,7 @@ int main(int argc, char** argv) unsigned const dim = 2; typedef itk::Vector PixelType; typedef itk::Image DVFType; - typename DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF(args_info.input_arg, args_info.like_arg); + DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF(args_info.input_arg, args_info.like_arg); Write(dvf, args_info.output_arg); } break; @@ -42,7 +42,7 @@ int main(int argc, char** argv) unsigned const dim = 3; typedef itk::Vector PixelType; typedef itk::Image DVFType; - typename DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF(args_info.input_arg, args_info.like_arg); + DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF(args_info.input_arg, args_info.like_arg); Write(dvf, args_info.output_arg); } break; -- 2.47.1