]> Creatis software - clitk.git/commitdiff
Fixed MSVC issues
authorSimon Rit <simon.rit@creatis.insa-lyon.fr>
Fri, 3 Feb 2012 17:30:06 +0000 (18:30 +0100)
committerSimon Rit <simon.rit@creatis.insa-lyon.fr>
Fri, 3 Feb 2012 17:30:06 +0000 (18:30 +0100)
common/clitkCoeffsToDVF.h
itk/clitkVectorBSplineInterpolateImageFunctionWithLUT.txx
tools/clitkCoeffsToDVF.cxx

index 603ca70a35111e0e1eed09a6bb5f56f9c22afb28..911e8a9f7b7dccb8aa41746ea34617a338be2c5e 100644 (file)
@@ -59,13 +59,13 @@ namespace clitk
     typedef itk::ImageRegionConstIterator<typename TransformType::CoefficientImageType> 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);
index 4c66a2cb85fe0beb2210a25d641caeca364b2dc7..7fbf9baa553cdb26e87e51ef82530a89da4f64d6 100644 (file)
@@ -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<IndexValueType,TCoefficientType>(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<long,ContinuousIndexType::ValueType>(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<long,ContinuousIndexType::ValueType>(x[l]);
       else {
         indx = (long)vcl_floor((x[l]+ 0.5)) - mSplineOrders[l] / 2; //this->m_SplineOrder / 2;
         evaluateIndex[l] = indx;
index 266f8aee817310f3b7f7adc43991ab5aaf891992..f92d03a0b7e517428231cdca9a438c594df0a4d5 100644 (file)
@@ -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<double, dim>  PixelType;
       typedef itk::Image<PixelType, dim> DVFType;
-      typename DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
+      DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
       Write<DVFType>(dvf, args_info.output_arg);
     }
     break;
@@ -42,7 +42,7 @@ int main(int argc, char** argv)
       unsigned const dim = 3;
       typedef itk::Vector<double, dim>  PixelType;
       typedef itk::Image<PixelType, dim> DVFType;
-      typename DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
+      DVFType::Pointer dvf = clitk::BLUTCoeffsToDVF<DVFType>(args_info.input_arg, args_info.like_arg);
       Write<DVFType>(dvf, args_info.output_arg);
     }
     break;