# HG changeset patch # User Sebastien Jodogne # Date 1520351628 -3600 # Node ID 316324f42848f059adab82d6425d4a0ac2688668 # Parent 01e32beee56c5a28efcccf6d337c9173f3d37a39 fix diff -r 01e32beee56c -r 316324f42848 Framework/Toolbox/GeometryToolbox.h --- a/Framework/Toolbox/GeometryToolbox.h Tue Mar 06 15:43:57 2018 +0100 +++ b/Framework/Toolbox/GeometryToolbox.h Tue Mar 06 16:53:48 2018 +0100 @@ -148,10 +148,9 @@ { assert(x >= 0 && y >= 0); - // Compute the fractional part of (x,y) (this is the "floor()" - // operation on positive integers) - float xx = x - static_cast(static_cast(x)); - float yy = y - static_cast(static_cast(y)); + // Compute the fractional part of (x,y) + float xx = x - std::floor(x); + float yy = y - std::floor(y); return ComputeBilinearInterpolationInternal(xx, yy, f00, f01, f10, f11); } @@ -171,9 +170,9 @@ { assert(x >= 0 && y >= 0 && z >= 0); - float xx = x - static_cast(static_cast(x)); - float yy = y - static_cast(static_cast(y)); - float zz = z - static_cast(static_cast(z)); + float xx = x - std::floor(x); + float yy = y - std::floor(y); + float zz = z - std::floor(z); // "In practice, a trilinear interpolation is identical to two // bilinear interpolation combined with a linear interpolation" diff -r 01e32beee56c -r 316324f42848 Framework/Volumes/VolumeReslicer.cpp --- a/Framework/Volumes/VolumeReslicer.cpp Tue Mar 06 15:43:57 2018 +0100 +++ b/Framework/Volumes/VolumeReslicer.cpp Tue Mar 06 16:53:48 2018 +0100 @@ -1129,8 +1129,8 @@ // Secondly, the extent together with the voxel size gives the // size of the output image - unsigned int width = boost::math::round(extent_.GetWidth() / voxelSize); - unsigned int height = boost::math::round(extent_.GetHeight() / voxelSize); + unsigned int width = boost::math::iround(extent_.GetWidth() / voxelSize); + unsigned int height = boost::math::iround(extent_.GetHeight() / voxelSize); slice_.reset(new Orthanc::Image(outputFormat_, width, height, false));