diff --git a/cmd/dwirecon.cpp b/cmd/dwirecon.cpp index 0893aad72a..58f76abeef 100644 --- a/cmd/dwirecon.cpp +++ b/cmd/dwirecon.cpp @@ -266,7 +266,7 @@ void run() { y.setZero(); ssize_t j = 0; for (auto lv = Loop("loading image data", {0, 1, 2, 3})(dwisub); lv; lv++, j++) { - float const w = Wsub(size_t(dwisub.index(2)), size_t(dwisub.index(3))) * Wvox[j]; + float const w = Wsub(dwisub.index(2), dwisub.index(3)) * Wvox[j]; y[j] = std::sqrt(w) * dwisub.value(); } @@ -361,7 +361,7 @@ void run() { } // Output source prediction - bool complete = !get_options("complete").empty(); + bool const complete = !get_options("complete").empty(); opt = get_options("spred"); if (!opt.empty()) { srchdr.size(3) = (complete) ? dwi.size(3) : dwisub.size(3); diff --git a/cmd/dwisliceoutliergmm.cpp b/cmd/dwisliceoutliergmm.cpp index a771eb9ed9..c47fa47f23 100644 --- a/cmd/dwisliceoutliergmm.cpp +++ b/cmd/dwisliceoutliergmm.cpp @@ -76,11 +76,11 @@ class RMSErrorFunctor { } void operator()(Image &data, Image &pred) { - size_t v = data.get_index(3); - size_t z = data.get_index(2); + ssize_t const v = data.get_index(3); + ssize_t const z = data.get_index(2); // Get transformation for masking. Note that the MB-factor of the motion table and the OR settings can be different. - size_t ne_mot = motion.rows() / nv; - transform_type T{DWI::SVR::se3exp(motion.row(v * ne_mot + z % ne_mot)).cast()}; + ssize_t const ne_mot = motion.rows() / nv; + transform_type const T{DWI::SVR::se3exp(motion.row(v * ne_mot + z % ne_mot)).cast()}; // Calculate slice error value_type e = 0.0; int n = 0; @@ -92,7 +92,7 @@ class RMSErrorFunctor { if (!mask.value()) continue; } - value_type d = data.value() - pred.value(); + value_type const d = data.value() - pred.value(); e += d * d; n++; } @@ -105,16 +105,16 @@ class RMSErrorFunctor { Emb.setZero(); Eigen::MatrixXi Nmb(ne, nv); Nmb.setZero(); - for (size_t b = 0; b < nz / ne; b++) { + for (ssize_t b = 0; b < nz / ne; b++) { Emb += E->block(b * ne, 0, ne, nv); Nmb += N->block(b * ne, 0, ne, nv); } - Eigen::MatrixXf R = (Nmb.array() > 0).select(Emb.cwiseQuotient(Nmb.cast()), Eigen::MatrixXf::Zero(ne, nv)); + Eigen::MatrixXf const R = (Nmb.array() > 0).select(Emb.cwiseQuotient(Nmb.cast()), Eigen::MatrixXf::Zero(ne, nv)); return R.cwiseSqrt(); } private: - const size_t nv, nz, ne; + const ssize_t nv, nz, ne; const Transform T0; Interp::Nearest> mask; const Eigen::MatrixXf motion; @@ -140,7 +140,8 @@ template class GMModel { void fit(const VecType &x) { // initialise init(x); - float_t ll, ll0 = -std::numeric_limits::infinity(); + float_t ll; + float_t ll0 = -std::numeric_limits::infinity(); // Expectation-Maximization for (int n = 0; n < niter; n++) { ll = e_step(x);