]> Creatis software - clitk.git/blobdiff - vv/vvSlicer.cxx
Use nan of std lib instead of sqrt(-1)
[clitk.git] / vv / vvSlicer.cxx
index abed78cc58b9fdf8444ff039f8c466762455fdc6..42f83034b7fb78ed38f96ceba186be1d89998bc4 100644 (file)
@@ -3,7 +3,7 @@
 
   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
@@ -14,7 +14,7 @@
 
   - BSD        See included LICENSE.txt file
   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ======================================================================-====*/
+  ===========================================================================**/
 
 #include "vvSlicer.h"
 #include "vvImage.h"
@@ -748,7 +748,7 @@ void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice)
   origin[this->SliceOrientation] -= mImageReslice->GetOutput()->GetOrigin()[this->SliceOrientation];
   origin[this->SliceOrientation] /= mImageReslice->GetOutput()->GetSpacing()[this->SliceOrientation];
   // Step 2: round to superior grid positionInc
-  origin[this->SliceOrientation] = itk::Math::Ceil(origin[this->SliceOrientation]);
+  origin[this->SliceOrientation] = itk::Math::Ceil<double>(origin[this->SliceOrientation]);
   // Step 3: back to world coordinates
   origin[this->SliceOrientation] *= mImageReslice->GetOutput()->GetSpacing()[this->SliceOrientation];
   origin[this->SliceOrientation] += mImageReslice->GetOutput()->GetOrigin()[this->SliceOrientation];
@@ -896,7 +896,7 @@ void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const
     dExtents[i] = (dExtents[i]- targetImage->GetOrigin()[i/2]) / targetImage->GetSpacing()[i/2];
     
     // Round to nearest
-    targetExtent[i] = itk::Math::Round(dExtents[i]);
+    targetExtent[i] = itk::Math::Round<double>(dExtents[i]);
   }
 }
 //----------------------------------------------------------------------------
@@ -1161,7 +1161,7 @@ double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, int X, double Y
       iy > image->GetWholeExtent()[3] ||
       iz < image->GetWholeExtent()[4] ||
       iz > image->GetWholeExtent()[5] )
-    return sqrt(-1.);
+    return std::numeric_limits<double>::quiet_NaN();
 
   image->SetUpdateExtent(ix, ix, iy, iy, iz, iz);
   image->Update();