From c3fddd29b49cc6a38cf49d91bd9d6a4dc1b22fb1 Mon Sep 17 00:00:00 2001 From: Max Pietsch Date: Fri, 30 Oct 2020 11:25:24 +0100 Subject: [PATCH] mrpeek: focus: round instead of truncate to integer --- cmd/mrpeek.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/mrpeek.cpp b/cmd/mrpeek.cpp index 53e2e73..ab2d9de 100644 --- a/cmd/mrpeek.cpp +++ b/cmd/mrpeek.cpp @@ -941,6 +941,7 @@ void run () throw Exception ("number of indices passed to -focus option exceeds image dimensions"); for (unsigned int n = 0; n < p.size(); ++n) { if (std::isfinite (p[n])) { + p[n] = Math::round(p[n]); if (p[n] < 0 || p[n] > image.size(n)-1) throw Exception ("position passed to -focus option is out of bounds for axis "+str(n)); if (n < 3)