diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index d4f9b20eaf..1243880dae 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -54,10 +54,10 @@ jobs: run: cmake --build build - name: unit tests - run: cd build && ctest -R unit + run: cd build && ctest -R unit --output-on-failure - name: binary tests - run: cd build && ctest -R bin + run: cd build && ctest -R bin --output-on-failure linux-gcc-build: @@ -103,10 +103,10 @@ jobs: run: cmake --build build - name: unit tests - run: cd build && ctest -R unit + run: cd build && ctest -R unit --output-on-failure - name: binary tests - run: cd build && ctest -R bin + run: cd build && ctest -R bin --output-on-failure macos-build: @@ -154,10 +154,10 @@ jobs: run: cmake --build build - name: unit tests - run: cd build && ctest -R unit + run: cd build && ctest -R unit --output-on-failure - name: binary tests - run: cd build && ctest -R bin + run: cd build && ctest -R bin --output-on-failure - name: check command documentation run: ./docs/generate_user_docs.sh --build-dir ./build && git diff --exit-code docs/ @@ -224,10 +224,10 @@ jobs: run: cmake --build build - name: unit tests - run: cd build && ctest -R unit + run: cd build && ctest -R unit --output-on-failure - name: binary tests - run: cd build && ctest -R bin + run: cd build && ctest -R bin --output-on-failure secondary-checks: runs-on: ubuntu-latest diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 72da091ec2..cfb8fdc67e 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -8,11 +8,12 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ZedThree/clang-tidy-review@v0.14.0 + - uses: ZedThree/clang-tidy-review@v0.17.0 id: review with: apt_packages: g++,libqt5opengl5-dev,libqt5svg5-dev,libglvnd-dev,libeigen3-dev,zlib1g-dev,libfftw3-dev,ninja-build cmake_command: cmake . -DCMAKE_EXPORT_COMPILE_COMMANDS=on + config_file: ${{ github.workspace }}/.clang-tidy - - uses: ZedThree/clang-tidy-review/upload@v0.14.0 + - uses: ZedThree/clang-tidy-review/upload@v0.17.0 id: upload-review diff --git a/check_syntax b/check_syntax index c85d937123..a60fffc9a2 100755 --- a/check_syntax +++ b/check_syntax @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright (c) 2008-2023 the MRtrix3 contributors. +# Copyright (c) 2008-2024 the MRtrix3 contributors. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this @@ -64,20 +64,6 @@ for f in $(find cmd core src -type f -name '*.h' -o -name '*.cpp' | $grep -v '_m # remove quoted strings: cat .check_syntax2.tmp | perl -pe 's/(")(\\"|.)*?"//g' > .check_syntax.tmp -# detect any instances of std::vector: - res="$res"$( - cat .check_syntax.tmp | \ -# match for the parts we're interested in and output just the bits that match: - $grep -Po '(?> $LOG echo "Please check the following syntax requirements: - Add MEMALIGN() or NOMEMALIGN macro to any class declarations identified above; - - Replace all occurrences of std::vector<> with MR::vector<> (or just vector<>); - - Avoid use of std::make_shared(); - Replace all instances of std::abs() with MR::abs() (or just abs()); - Replace all instances of %zu in print() calls with PRI_SIZET." >> $LOG exit 1 diff --git a/clang-format-all b/clang-format-all index 2d6231b278..62be97164c 100755 --- a/clang-format-all +++ b/clang-format-all @@ -1,6 +1,6 @@ #!/usr/env/python3 -# Copyright (c) 2008-2023 the MRtrix3 contributors. +# Copyright (c) 2008-2024 the MRtrix3 contributors. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/5tt2gmwmi.cpp b/cmd/5tt2gmwmi.cpp index b486ec385d..f096fc9a3f 100644 --- a/cmd/5tt2gmwmi.cpp +++ b/cmd/5tt2gmwmi.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/5tt2vis.cpp b/cmd/5tt2vis.cpp index 0e43c5c4e4..c3ae2ebba0 100644 --- a/cmd/5tt2vis.cpp +++ b/cmd/5tt2vis.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/5ttcheck.cpp b/cmd/5ttcheck.cpp index ae7d7c44a6..dc1e8ed9eb 100644 --- a/cmd/5ttcheck.cpp +++ b/cmd/5ttcheck.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/5ttedit.cpp b/cmd/5ttedit.cpp index 0b757fd308..15f31852ec 100644 --- a/cmd/5ttedit.cpp +++ b/cmd/5ttedit.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/afdconnectivity.cpp b/cmd/afdconnectivity.cpp index 0c36c7ac24..471d414ff1 100644 --- a/cmd/afdconnectivity.cpp +++ b/cmd/afdconnectivity.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -215,7 +215,7 @@ value_type AFDConnectivity::get(const std::string &path) { if (all_fixels) { // All fixels contribute to the result - for (vector::const_iterator i = fixels.begin(); i != fixels.end(); ++i) { + for (std::vector::const_iterator i = fixels.begin(); i != fixels.end(); ++i) { if (i->is_selected()) sum_volumes += i->get_FOD(); } diff --git a/cmd/amp2response.cpp b/cmd/amp2response.cpp index 54a1cf4810..57eb4aab46 100644 --- a/cmd/amp2response.cpp +++ b/cmd/amp2response.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -101,8 +101,8 @@ Eigen::Matrix gen_rotation_matrix(const Eigen::Vector3d &dir return R; } -vector all_volumes(const size_t num) { - vector result(num); +std::vector all_volumes(const size_t num) { + std::vector result(num); for (size_t i = 0; i != num; ++i) result[i] = i; return result; @@ -112,7 +112,7 @@ class Accumulator { public: class Shared { public: - Shared(int lmax, const vector &volumes, const Eigen::MatrixXd &dirs) + Shared(int lmax, const std::vector &volumes, const Eigen::MatrixXd &dirs) : lmax(lmax), dirs(dirs), volumes(volumes), @@ -122,7 +122,7 @@ class Accumulator { const int lmax; const Eigen::MatrixXd &dirs; - const vector &volumes; + const std::vector &volumes; Eigen::MatrixXd M; Eigen::VectorXd b; size_t count; @@ -196,8 +196,8 @@ void run() { auto header = Header::open(argument[0]); // May be dealing with multiple shells - vector dirs_azel; - vector> volumes; + std::vector dirs_azel; + std::vector> volumes; std::unique_ptr shells; auto opt = get_options("directions"); @@ -207,7 +207,7 @@ void run() { } else { auto hit = header.keyval().find("directions"); if (hit != header.keyval().end()) { - vector dir_vector; + std::vector dir_vector; for (auto line : split_lines(hit->second)) { auto v = parse_floats(line); dir_vector.insert(dir_vector.end(), v.begin(), v.end()); @@ -230,7 +230,7 @@ void run() { } } - vector lmax; + std::vector lmax; uint32_t max_lmax = 0; opt = get_options("lmax"); if (get_options("isotropic").size()) { diff --git a/cmd/amp2sh.cpp b/cmd/amp2sh.cpp index 0c7f37634c..9f8024a320 100644 --- a/cmd/amp2sh.cpp +++ b/cmd/amp2sh.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -81,14 +81,14 @@ class Amp2SHCommon { public: template Amp2SHCommon(const MatrixType &sh2amp, - const vector &bzeros, - const vector &dwis, + const std::vector &bzeros, + const std::vector &dwis, bool normalise_to_bzero) : sh2amp(sh2amp), amp2sh(Math::pinv(sh2amp)), bzeros(bzeros), dwis(dwis), normalise(normalise_to_bzero) {} Eigen::MatrixXd sh2amp, amp2sh; - const vector &bzeros; - const vector &dwis; + const std::vector &bzeros; + const std::vector &dwis; bool normalise; }; @@ -175,7 +175,7 @@ void run() { auto amp = Image::open(argument[0]).with_direct_io(3); Header header(amp); - vector bzeros, dwis; + std::vector bzeros, dwis; Eigen::MatrixXd dirs; auto opt = get_options("directions"); if (opt.size()) { @@ -185,7 +185,7 @@ void run() { } else { auto hit = header.keyval().find("directions"); if (hit != header.keyval().end()) { - vector dir_vector; + std::vector dir_vector; for (auto line : split_lines(hit->second)) { auto v = parse_floats(line); dir_vector.insert(dir_vector.end(), v.begin(), v.end()); diff --git a/cmd/connectome2tck.cpp b/cmd/connectome2tck.cpp index c3ebee7b10..f9df163022 100644 --- a/cmd/connectome2tck.cpp +++ b/cmd/connectome2tck.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -158,9 +158,9 @@ void run() { Tractography::Properties properties; Tractography::Reader reader(argument[0], properties); - vector> assignments_lists; + std::vector> assignments_lists; assignments_lists.reserve(to(properties["count"])); - vector assignments_pairs; + std::vector assignments_pairs; bool nonpair_found = false; node_t max_node_index = 0; { @@ -172,7 +172,7 @@ void run() { if (line.empty()) continue; std::stringstream line_stream(line); - vector nodes; + std::vector nodes; while (1) { node_t n; line_stream >> n; @@ -216,7 +216,7 @@ void run() { const bool keep_self = get_options("keep_self").size(); // Get the list of nodes of interest - vector nodes; + std::vector nodes; opt = get_options("nodes"); bool manual_node_list = false; if (opt.size()) { @@ -256,8 +256,8 @@ void run() { // Load the node image, get the centres of mass // Generate exemplars - these can _only_ be done per edge, and requires a mutex per edge to multi-thread auto image = Image::open(opt[0][0]); - vector COMs(max_node_index + 1, Eigen::Vector3f(0.0f, 0.0f, 0.0f)); - vector volumes(max_node_index + 1, 0); + std::vector COMs(max_node_index + 1, Eigen::Vector3f(0.0f, 0.0f, 0.0f)); + std::vector volumes(max_node_index + 1, 0); for (auto i = Loop()(image); i; ++i) { const node_t index = image.value(); if (index) { @@ -344,7 +344,7 @@ void run() { } else { // For each node in the list, write one file for an exemplar to every other node ProgressBar progress("writing exemplars to files", nodes.size() * COMs.size()); - for (vector::const_iterator n = nodes.begin(); n != nodes.end(); ++n) { + for (std::vector::const_iterator n = nodes.begin(); n != nodes.end(); ++n) { for (size_t i = first_node; i != COMs.size(); ++i) { generator.write(*n, i, @@ -356,7 +356,7 @@ void run() { } } else if (file_format == 1) { // One file per node ProgressBar progress("writing exemplars to files", nodes.size()); - for (vector::const_iterator n = nodes.begin(); n != nodes.end(); ++n) { + for (std::vector::const_iterator n = nodes.begin(); n != nodes.end(); ++n) { generator.write( *n, prefix + str(*n) + ".tck", weights_prefix.size() ? (weights_prefix + str(*n) + ".csv") : ""); ++progress; @@ -399,7 +399,7 @@ void run() { INFO("A total of " + str(writer.file_count()) + " output track files will be generated (one for each edge)"); break; case 1: // One file per node - for (vector::const_iterator i = nodes.begin(); i != nodes.end(); ++i) + for (std::vector::const_iterator i = nodes.begin(); i != nodes.end(); ++i) writer.add(*i, prefix + str(*i) + ".tck", weights_prefix.size() ? (weights_prefix + str(*i) + ".csv") : ""); INFO("A total of " + str(writer.file_count()) + " output track files will be generated (one for each node)"); break; diff --git a/cmd/connectomeedit.cpp b/cmd/connectomeedit.cpp index bdb5f9e759..fe57dead31 100644 --- a/cmd/connectomeedit.cpp +++ b/cmd/connectomeedit.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/connectomestats.cpp b/cmd/connectomestats.cpp index ab81f9eaa0..d6315061aa 100644 --- a/cmd/connectomestats.cpp +++ b/cmd/connectomestats.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -210,7 +210,7 @@ void run() { // Before validating the contrast matrix, we first need to see if there are any // additional design matrix columns coming from edge-wise subject data - vector extra_columns; + std::vector extra_columns; bool nans_in_columns = false; auto opt = get_options("column"); for (size_t i = 0; i != opt.size(); ++i) { @@ -236,7 +236,7 @@ void run() { CONSOLE("Number of variance groups: " + str(num_vgs)); // Load hypotheses - const vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[3]); + const std::vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[3]); const index_type num_hypotheses = hypotheses.size(); if (hypotheses[0].cols() != num_factors) throw Exception( diff --git a/cmd/dcmedit.cpp b/cmd/dcmedit.cpp index 2c6143bf79..ef433af6cc 100644 --- a/cmd/dcmedit.cpp +++ b/cmd/dcmedit.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -82,8 +82,8 @@ inline uint16_t read_hex(const std::string &m) { } void run() { - vector tags; - vector VRs; + std::vector tags; + std::vector VRs; auto opt = get_options("anonymise"); if (opt.size()) { diff --git a/cmd/dcminfo.cpp b/cmd/dcminfo.cpp index 9f04617530..4326d11cd9 100644 --- a/cmd/dcminfo.cpp +++ b/cmd/dcminfo.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -62,7 +62,7 @@ void run() { if (opt.size()) { std::istringstream hex; - vector tags(opt.size()); + std::vector tags(opt.size()); for (size_t n = 0; n < opt.size(); ++n) { tags[n].group = read_hex(opt[n][0]); tags[n].element = read_hex(opt[n][1]); diff --git a/cmd/dirflip.cpp b/cmd/dirflip.cpp index 76177c6c3e..924136be5c 100644 --- a/cmd/dirflip.cpp +++ b/cmd/dirflip.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -61,7 +61,7 @@ class Shared { best_signs(directions.rows(), 1), best_eddy(std::numeric_limits::max()) {} - bool update(value_type eddy, const vector &signs) { + bool update(value_type eddy, const std::vector &signs) { std::lock_guard lock(mutex); if (eddy < best_eddy) { best_eddy = eddy; @@ -74,7 +74,7 @@ class Shared { return num_permutations < target_num_permutations; } - value_type eddy(size_t i, size_t j, const vector &signs) const { + value_type eddy(size_t i, size_t j, const std::vector &signs) const { vector3_type a = {directions(i, 0), directions(i, 1), directions(i, 2)}; vector3_type b = {directions(j, 0), directions(j, 1), directions(j, 2)}; if (signs[i] < 0) @@ -84,15 +84,15 @@ class Shared { return 1.0 / (a - b).norm(); } - vector get_init_signs() const { return vector(directions.rows(), 1); } - const vector &get_best_signs() const { return best_signs; } + std::vector get_init_signs() const { return std::vector(directions.rows(), 1); } + const std::vector &get_best_signs() const { return best_signs; } protected: const Eigen::MatrixXd &directions; const size_t target_num_permutations; size_t num_permutations; ProgressBar progress; - vector best_signs; + std::vector best_signs; value_type best_eddy; std::mutex mutex; }; @@ -121,7 +121,7 @@ class Processor { protected: Shared &shared; - vector signs; + std::vector signs; Math::RNG rng; std::uniform_int_distribution uniform; }; @@ -131,7 +131,7 @@ void run() { size_t num_permutations = get_option_value("permutations", default_permutations); - vector signs; + std::vector signs; { Shared eddy_shared(directions, num_permutations); Thread::run(Thread::multi(Processor(eddy_shared)), "eval thread"); diff --git a/cmd/dirgen.cpp b/cmd/dirgen.cpp index 445582b7a5..fbbcc8dfdc 100644 --- a/cmd/dirgen.cpp +++ b/cmd/dirgen.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/dirmerge.cpp b/cmd/dirmerge.cpp index 67b723b512..c00bfebcfb 100644 --- a/cmd/dirmerge.cpp +++ b/cmd/dirmerge.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -50,7 +50,7 @@ void usage() { using value_type = double; using Direction = Eigen::Matrix; -using DirectionSet = vector; +using DirectionSet = std::vector; struct OutDir { Direction d; @@ -68,8 +68,8 @@ void run() { value_type unipolar_weight = App::get_option_value("unipolar_weight", 0.2); value_type bipolar_weight = 1.0 - unipolar_weight; - vector> dirs; - vector bvalue((argument.size() - 2) / (1 + num_subsets)); + std::vector> dirs; + std::vector bvalue((argument.size() - 2) / (1 + num_subsets)); INFO("expecting " + str(bvalue.size()) + " b-values"); if (bvalue.size() * (1 + num_subsets) + 2 != argument.size()) throw Exception("inconsistent number of arguments"); @@ -78,7 +78,7 @@ void run() { size_t current = 1, nb = 0; while (current < argument.size() - 1) { bvalue[nb] = to(argument[current++]); - vector d; + std::vector d; for (size_t i = 0; i < num_subsets; ++i) { auto m = DWI::Directions::load_cartesian(argument[current++]); DirectionSet set; @@ -87,7 +87,7 @@ void run() { d.push_back(set); } INFO("found b = " + str(bvalue[nb]) + ", " + str([&] { - vector s; + std::vector s; for (auto &n : d) s.push_back(n.size()); return s; @@ -112,7 +112,7 @@ void run() { std::mt19937 rng(rd()); size_t first = std::uniform_int_distribution(0, dirs[0][0].size() - 1)(rng); - vector merged; + std::vector merged; auto push = [&](size_t b, size_t p, size_t n) { merged.push_back({Direction(dirs[b][p][n][0], dirs[b][p][n][1], dirs[b][p][n][2]), b, p}); @@ -149,7 +149,7 @@ void run() { return best; }; - vector fraction; + std::vector fraction; for (auto &d : dirs) { size_t n = 0; for (auto &m : d) @@ -159,7 +159,7 @@ void run() { push(0, 0, first); - vector counts(bvalue.size(), 0); + std::vector counts(bvalue.size(), 0); ++counts[0]; auto num_for_b = [&](size_t b) { diff --git a/cmd/dirorder.cpp b/cmd/dirorder.cpp index 2fab3cdb37..99405bd1ae 100644 --- a/cmd/dirorder.cpp +++ b/cmd/dirorder.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -47,9 +47,9 @@ void usage() { using value_type = double; -vector optimise(const Eigen::MatrixXd &directions, const size_t first_volume) { - vector indices(1, first_volume); - vector remaining; +std::vector optimise(const Eigen::MatrixXd &directions, const size_t first_volume) { + std::vector indices(1, first_volume); + std::vector remaining; for (size_t n = 0; n < size_t(directions.rows()); ++n) if (n != indices[0]) remaining.push_back(n); @@ -79,7 +79,7 @@ vector optimise(const Eigen::MatrixXd &directions, const size_t first_vo return indices; } -value_type calc_cost(const Eigen::MatrixXd &directions, const vector &order) { +value_type calc_cost(const Eigen::MatrixXd &directions, const std::vector &order) { const size_t start = Math::SH::NforL(2); if (size_t(directions.rows()) <= start) return value_type(0); @@ -112,10 +112,10 @@ void run() { } value_type min_cost = std::numeric_limits::infinity(); - vector best_order; + std::vector best_order; ProgressBar progress("Determining best reordering", directions.rows()); for (size_t first_volume = 0; first_volume != last_candidate_first_volume; ++first_volume) { - const vector order = optimise(directions, first_volume); + const std::vector order = optimise(directions, first_volume); const value_type cost = calc_cost(directions, order); if (cost < min_cost) { min_cost = cost; diff --git a/cmd/dirsplit.cpp b/cmd/dirsplit.cpp index 1b96d475f9..c84afc034a 100644 --- a/cmd/dirsplit.cpp +++ b/cmd/dirsplit.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -60,7 +60,7 @@ class Shared { s = 0; } INFO("split " + str(directions.rows()) + " directions into subsets with " + str([&] { - vector c; + std::vector c; for (auto &x : subset) c.push_back(x.size()); return c; @@ -68,7 +68,7 @@ class Shared { " volumes"); } - bool update(value_type energy, const vector> &set) { + bool update(value_type energy, const std::vector> &set) { std::lock_guard lock(mutex); if (!progress) progress.reset(new ProgressBar("distributing directions", target_num_permutations)); @@ -88,13 +88,13 @@ class Shared { return 1.0 / (a - b).norm() + 1.0 / (a + b).norm(); } - const vector> &get_init_subset() const { return subset; } - const vector> &get_best_subset() const { return best_subset; } + const std::vector> &get_init_subset() const { return subset; } + const std::vector> &get_best_subset() const { return best_subset; } protected: const Eigen::MatrixXd &directions; std::mutex mutex; - vector> subset, best_subset; + std::vector> subset, best_subset; value_type best_energy; const size_t target_num_permutations; size_t num_permutations; @@ -141,7 +141,7 @@ class EnergyCalculator { protected: Shared &shared; - vector> subset; + std::vector> subset; Math::RNG rng; }; @@ -154,7 +154,7 @@ void run() { const size_t num_permutations = get_option_value("permutations", default_permutations); - vector> best; + std::vector> best; { Shared shared(directions, num_subsets, num_permutations); Thread::run(Thread::multi(EnergyCalculator(shared)), "energy eval thread"); diff --git a/cmd/dirstat.cpp b/cmd/dirstat.cpp index 0190a0bc71..712b58cbd5 100644 --- a/cmd/dirstat.cpp +++ b/cmd/dirstat.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -127,7 +127,7 @@ void run() { report(argument[0], directions); } -vector summarise_NN(const vector &NN) { +std::vector summarise_NN(const std::vector &NN) { double NN_min = std::numeric_limits::max(); double NN_mean = 0.0; double NN_max = 0.0; @@ -142,7 +142,7 @@ vector summarise_NN(const vector &NN) { return {NN_mean, NN_min, NN_max}; } -vector summarise_E(const vector &E) { +std::vector summarise_E(const std::vector &E) { double E_min = std::numeric_limits::max(); double E_total = 0.0; double E_max = 0.0; @@ -157,7 +157,7 @@ vector summarise_E(const vector &E) { class Metrics { public: - vector BN, UN, BE, UE, SH; + std::vector BN, UN, BE, UE, SH; default_type ASYM; size_t ndirs; }; @@ -167,11 +167,11 @@ Metrics compute(Eigen::MatrixXd &directions) { throw Exception("unexpected matrix size for scheme \"" + str(argument[0]) + "\""); Math::Sphere::normalise_cartesian(directions); - vector NN_bipolar(directions.rows(), -1.0); - vector NN_unipolar(directions.rows(), -1.0); + std::vector NN_bipolar(directions.rows(), -1.0); + std::vector NN_unipolar(directions.rows(), -1.0); - vector E_bipolar(directions.rows(), 0.0); - vector E_unipolar(directions.rows(), 0.0); + std::vector E_bipolar(directions.rows(), 0.0); + std::vector E_unipolar(directions.rows(), 0.0); for (ssize_t i = 0; i < directions.rows() - 1; ++i) { for (ssize_t j = i + 1; j < directions.rows(); ++j) { diff --git a/cmd/dwi2adc.cpp b/cmd/dwi2adc.cpp index 9a3e0d84ea..8c024b3992 100644 --- a/cmd/dwi2adc.cpp +++ b/cmd/dwi2adc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/dwi2fod.cpp b/cmd/dwi2fod.cpp index ffa3757a20..8d6581ee95 100644 --- a/cmd/dwi2fod.cpp +++ b/cmd/dwi2fod.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -163,7 +163,7 @@ class MSMT_Processor { public: MSMT_Processor(const DWI::SDeconv::MSMT_CSD::Shared &shared, Image &mask_image, - vector> odf_images, + std::vector> odf_images, Image dwi_modelled = Image()) : sdeconv(shared), mask_image(mask_image), @@ -204,7 +204,7 @@ class MSMT_Processor { private: DWI::SDeconv::MSMT_CSD sdeconv; Image mask_image; - vector> odf_images; + std::vector> odf_images; Image modelled_image; Eigen::VectorXd dwi_data; Eigen::VectorXd output_data; @@ -262,8 +262,8 @@ void run() { shared.parse_cmdline_options(); const size_t num_tissues = (argument.size() - 2) / 2; - vector response_paths; - vector odf_paths; + std::vector response_paths; + std::vector odf_paths; for (size_t i = 0; i < num_tissues; ++i) { response_paths.push_back(argument[i * 2 + 2]); odf_paths.push_back(argument[i * 2 + 3]); @@ -280,7 +280,7 @@ void run() { DWI::stash_DW_scheme(header_out, shared.grad); - vector> odfs; + std::vector> odfs; for (size_t i = 0; i < num_tissues; ++i) { header_out.size(3) = Math::SH::NforL(shared.lmax[i]); odfs.push_back(Image(Image::create(odf_paths[i], header_out))); diff --git a/cmd/dwi2tensor.cpp b/cmd/dwi2tensor.cpp index 9cbedfd74c..78994042d6 100644 --- a/cmd/dwi2tensor.cpp +++ b/cmd/dwi2tensor.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/dwidenoise.cpp b/cmd/dwidenoise.cpp index a3ef3d615e..1ba660f2aa 100644 --- a/cmd/dwidenoise.cpp +++ b/cmd/dwidenoise.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -134,7 +134,7 @@ template class DenoisingFunctor { using SValsType = Eigen::VectorXd; DenoisingFunctor(int ndwi, - const vector &extent, + const std::vector &extent, Image &mask, Image &noise, Image &rank, @@ -273,7 +273,7 @@ void process_image(Header &data, Image &noise, Image &rank, const std::string &output_name, - const vector &extent, + const std::vector &extent, bool exp1) { auto input = data.get_image().with_direct_io(3); // create output @@ -299,7 +299,7 @@ void run() { } opt = get_options("extent"); - vector extent; + std::vector extent; if (opt.size()) { extent = parse_ints(opt[0][0]); if (extent.size() == 1) diff --git a/cmd/dwiextract.cpp b/cmd/dwiextract.cpp index c87d398608..d1c15478b3 100644 --- a/cmd/dwiextract.cpp +++ b/cmd/dwiextract.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -65,7 +65,7 @@ void run() { // Want to support non-shell-like data if it's just a straight extraction // of all dwis or all bzeros i.e. don't initialise the Shells class - vector volumes; + std::vector volumes; bool bzero = get_options("bzero").size(); if (get_options("shells").size() || get_options("singleshell").size()) { DWI::Shells shells(grad); @@ -101,7 +101,7 @@ void run() { const auto filter = parse_floats(opt[0][0]); if (!(filter.size() == 3 || filter.size() == 4)) throw Exception("Phase encoding filter must be a comma-separated list of either 3 or 4 numbers"); - vector new_volumes; + std::vector new_volumes; for (const auto i : volumes) { bool keep = true; for (size_t axis = 0; axis != 3; ++axis) { diff --git a/cmd/fixel2peaks.cpp b/cmd/fixel2peaks.cpp index 3fa92a1af5..9665f76af8 100644 --- a/cmd/fixel2peaks.cpp +++ b/cmd/fixel2peaks.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/fixel2sh.cpp b/cmd/fixel2sh.cpp index d0005afba9..741a7c149b 100644 --- a/cmd/fixel2sh.cpp +++ b/cmd/fixel2sh.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -77,7 +77,7 @@ void run() { out_header.size(3) = n_sh_coeff; auto sh_image = Image::create(argument[1], out_header); - vector sh_values; + std::vector sh_values; Eigen::Matrix apsf_values; for (auto l1 = Loop("converting fixel image to spherical harmonic image", in_index_image)(in_index_image, sh_image); diff --git a/cmd/fixel2tsf.cpp b/cmd/fixel2tsf.cpp index 876c87e6aa..b502f7abef 100644 --- a/cmd/fixel2tsf.cpp +++ b/cmd/fixel2tsf.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/fixel2voxel.cpp b/cmd/fixel2voxel.cpp index ec15a95093..1ed01e2886 100644 --- a/cmd/fixel2voxel.cpp +++ b/cmd/fixel2voxel.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/fixelcfestats.cpp b/cmd/fixelcfestats.cpp index bac8b278ba..f88212acb9 100644 --- a/cmd/fixelcfestats.cpp +++ b/cmd/fixelcfestats.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -251,7 +251,7 @@ void run() { // Before validating the contrast matrix, we first need to see if there are any // additional design matrix columns coming from fixel-wise subject data - vector extra_columns; + std::vector extra_columns; bool nans_in_columns = false; opt = get_options("column"); for (size_t i = 0; i != opt.size(); ++i) { @@ -292,7 +292,7 @@ void run() { CONSOLE("Number of variance groups: " + str(num_vgs)); // Load hypotheses - const vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[3]); + const std::vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[3]); const Math::Stats::index_type num_hypotheses = hypotheses.size(); if (hypotheses[0].cols() != num_factors) throw Exception( diff --git a/cmd/fixelconnectivity.cpp b/cmd/fixelconnectivity.cpp index a2ceea94b4..0ca8689feb 100644 --- a/cmd/fixelconnectivity.cpp +++ b/cmd/fixelconnectivity.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/fixelconvert.cpp b/cmd/fixelconvert.cpp index e14f34156b..ebb1e7d79d 100644 --- a/cmd/fixelconvert.cpp +++ b/cmd/fixelconvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -204,7 +204,7 @@ void convert_new2old() { Header H_index = Fixel::find_index_header(input_fixel_directory); Header H_dirs = Fixel::find_directions_header(input_fixel_directory); - vector
H_data = Fixel::find_data_headers(input_fixel_directory, H_index, false); + std::vector
H_data = Fixel::find_data_headers(input_fixel_directory, H_index, false); size_t size_index = H_data.size(), value_index = H_data.size(); for (size_t i = 0; i != H_data.size(); ++i) { diff --git a/cmd/fixelcorrespondence.cpp b/cmd/fixelcorrespondence.cpp index 87280eeb5a..11d7e4ac4a 100644 --- a/cmd/fixelcorrespondence.cpp +++ b/cmd/fixelcorrespondence.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/fixelcrop.cpp b/cmd/fixelcrop.cpp index f99d4d7d98..09d75344b1 100644 --- a/cmd/fixelcrop.cpp +++ b/cmd/fixelcrop.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -77,9 +77,9 @@ void run() { Image::create(Path::join(out_fixel_directory, Path::basename(in_index_image.name())), out_header); // Open all data images and create output date images with size equal to expected number of fixels - vector
in_headers = Fixel::find_data_headers(in_directory, in_index_header, true); - vector> in_data_images; - vector> out_data_images; + std::vector
in_headers = Fixel::find_data_headers(in_directory, in_index_header, true); + std::vector> in_data_images; + std::vector> out_data_images; for (auto &in_data_header : in_headers) { in_data_images.push_back(in_data_header.get_image().with_direct_io()); check_dimensions(in_data_images.back(), mask_image, {0, 2}); diff --git a/cmd/fixelfilter.cpp b/cmd/fixelfilter.cpp index e16e0c6366..3b442c5a96 100644 --- a/cmd/fixelfilter.cpp +++ b/cmd/fixelfilter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -91,7 +91,7 @@ void run() { std::set option_list{"threhsold_value", "threshold_connectivity", "fwhm", "minweight", "mask"}; Image single_file; - vector
multiple_files; + std::vector
multiple_files; std::unique_ptr filter; { diff --git a/cmd/fixelreorient.cpp b/cmd/fixelreorient.cpp index 25c624e888..8d202abfa7 100644 --- a/cmd/fixelreorient.cpp +++ b/cmd/fixelreorient.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/fod2dec.cpp b/cmd/fod2dec.cpp index 2607c7cc15..405d340fa7 100644 --- a/cmd/fod2dec.cpp +++ b/cmd/fod2dec.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/fod2fixel.cpp b/cmd/fod2fixel.cpp index 38869ccdcf..26919b0201 100644 --- a/cmd/fod2fixel.cpp +++ b/cmd/fod2fixel.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -125,7 +125,7 @@ class Segmented_FOD_receiver { : dir(dir), integral(integral), max_peak_amp(max_peak_amp) {} }; - class Primitive_FOD_lobes : public vector { + class Primitive_FOD_lobes : public std::vector { public: Primitive_FOD_lobes(const FOD_lobes &in, const index_type maxcount, bool dir_from_peak) : vox(in.vox) { const index_type N = maxcount ? std::min(index_type(in.size()), maxcount) : in.size(); @@ -142,7 +142,7 @@ class Segmented_FOD_receiver { Header H; std::string fixel_directory_path, index_path, dir_path, afd_path, peak_amp_path, disp_path; - vector lobes; + std::vector lobes; index_type fixel_count; index_type max_per_voxel; bool dir_from_peak; @@ -177,7 +177,7 @@ void Segmented_FOD_receiver::commit() { index_header.size(3) = 2; index_header.datatype() = DataType::from(); index_header.datatype().set_byte_order_native(); - index_image = make_unique(IndexImage::create(index_filepath, index_header)); + index_image = std::make_unique(IndexImage::create(index_filepath, index_header)); auto fixel_data_header(H); fixel_data_header.ndim() = 3; @@ -191,7 +191,7 @@ void Segmented_FOD_receiver::commit() { if (dir_path.size()) { auto dir_header(fixel_data_header); dir_header.size(1) = 3; - dir_image = make_unique(DataImage::create(Path::join(fixel_directory_path, dir_path), dir_header)); + dir_image = std::make_unique(DataImage::create(Path::join(fixel_directory_path, dir_path), dir_header)); dir_image->index(1) = 0; Fixel::check_fixel_size(*index_image, *dir_image); } @@ -199,7 +199,7 @@ void Segmented_FOD_receiver::commit() { if (afd_path.size()) { auto afd_header(fixel_data_header); afd_header.size(1) = 1; - afd_image = make_unique(DataImage::create(Path::join(fixel_directory_path, afd_path), afd_header)); + afd_image = std::make_unique(DataImage::create(Path::join(fixel_directory_path, afd_path), afd_header)); afd_image->index(1) = 0; Fixel::check_fixel_size(*index_image, *afd_image); } @@ -207,8 +207,8 @@ void Segmented_FOD_receiver::commit() { if (peak_amp_path.size()) { auto peak_amp_header(fixel_data_header); peak_amp_header.size(1) = 1; - peak_amp_image = - make_unique(DataImage::create(Path::join(fixel_directory_path, peak_amp_path), peak_amp_header)); + peak_amp_image = std::make_unique( + DataImage::create(Path::join(fixel_directory_path, peak_amp_path), peak_amp_header)); peak_amp_image->index(1) = 0; Fixel::check_fixel_size(*index_image, *peak_amp_image); } @@ -216,7 +216,8 @@ void Segmented_FOD_receiver::commit() { if (disp_path.size()) { auto disp_header(fixel_data_header); disp_header.size(1) = 1; - disp_image = make_unique(DataImage::create(Path::join(fixel_directory_path, disp_path), disp_header)); + disp_image = + std::make_unique(DataImage::create(Path::join(fixel_directory_path, disp_path), disp_header)); disp_image->index(1) = 0; Fixel::check_fixel_size(*index_image, *disp_image); } diff --git a/cmd/label2colour.cpp b/cmd/label2colour.cpp index 8181ac203c..59fc1ff12c 100644 --- a/cmd/label2colour.cpp +++ b/cmd/label2colour.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/label2mesh.cpp b/cmd/label2mesh.cpp index b8bbf38447..a843ecc132 100644 --- a/cmd/label2mesh.cpp +++ b/cmd/label2mesh.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -60,7 +60,7 @@ void run() { using voxel_corner_t = Eigen::Array; - vector lower_corners, upper_corners; + std::vector lower_corners, upper_corners; { for (auto i = Loop("Importing label image", labels)(labels); i; ++i) { const uint32_t index = labels.value(); @@ -83,7 +83,7 @@ void run() { meshes[0].set_name("none"); const bool blocky = get_options("blocky").size(); - vector missing_nodes; + std::vector missing_nodes; for (uint32_t i = 1; i != upper_corners.size(); ++i) { if (upper_corners[i][0] < 0) missing_nodes.push_back(i); @@ -105,7 +105,7 @@ void run() { auto worker = [&](const size_t &in) { meshes[in].set_name(str(in)); - vector from, dimensions; + std::vector from, dimensions; for (size_t axis = 0; axis != 3; ++axis) { from.push_back(lower_corners[in][axis]); dimensions.push_back(upper_corners[in][axis] - lower_corners[in][axis] + 1); diff --git a/cmd/labelconvert.cpp b/cmd/labelconvert.cpp index bc078ab595..ad6f16f375 100644 --- a/cmd/labelconvert.cpp +++ b/cmd/labelconvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/labelstats.cpp b/cmd/labelstats.cpp index 5c1c8988f9..c552976799 100644 --- a/cmd/labelstats.cpp +++ b/cmd/labelstats.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -96,7 +96,7 @@ void run() { Eigen::IOFormat fmt(Eigen::StreamPrecision, 0, ", ", "\n", "[ ", " ]", "", ""); std::stringstream com_stringstream; com_stringstream << coms.format(fmt); - const vector com_strings = split(com_stringstream.str(), "\n"); + const std::vector com_strings = split(com_stringstream.str(), "\n"); assert(com_strings.size() == size_t(masses.size())); // Find width of first non-empty string, in order to centralise header label diff --git a/cmd/maskdump.cpp b/cmd/maskdump.cpp index 0677eee5b8..4ca47bac04 100644 --- a/cmd/maskdump.cpp +++ b/cmd/maskdump.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -41,7 +41,7 @@ void run() { if (H.datatype() != DataType::Bit) WARN("Input is not a genuine boolean mask image"); auto in = H.get_image(); - vector locations; + std::vector locations; for (auto l = Loop(in)(in); l; ++l) { if (in.value()) { Eigen::ArrayXi this_voxel(in.ndim()); diff --git a/cmd/maskfilter.cpp b/cmd/maskfilter.cpp index 768a8b62b2..d090a70f43 100644 --- a/cmd/maskfilter.cpp +++ b/cmd/maskfilter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -125,7 +125,7 @@ void run() { input_image, std::string("applying connected-component filter to image ") + Path::basename(argument[0])); auto opt = get_options("axes"); if (opt.size()) { - const vector axes = opt[0][0]; + const std::vector axes = opt[0][0]; filter.set_axes(axes); } bool largest_only = false; @@ -188,7 +188,7 @@ void run() { Filter::Fill filter(input_image, std::string("filling interior of image ") + Path::basename(argument[0])); auto opt = get_options("axes"); if (opt.size()) { - const vector axes = opt[0][0]; + const std::vector axes = opt[0][0]; filter.set_axes(axes); } opt = get_options("connectivity"); diff --git a/cmd/mesh2voxel.cpp b/cmd/mesh2voxel.cpp index 2c11f0b1d1..3dbc874544 100644 --- a/cmd/mesh2voxel.cpp +++ b/cmd/mesh2voxel.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/meshconvert.cpp b/cmd/meshconvert.cpp index 38a09d522d..8f7102a0e9 100644 --- a/cmd/meshconvert.cpp +++ b/cmd/meshconvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -63,7 +63,7 @@ void run() { auto opt = get_options("transform"); if (opt.size()) { auto H = Header::open(opt[0][1]); - auto transform = make_unique(H); + auto transform = std::make_unique(H); switch (int(opt[0][0])) { case 0: transform->set_first2real(); diff --git a/cmd/meshfilter.cpp b/cmd/meshfilter.cpp index 763ac06356..75805fdd34 100644 --- a/cmd/meshfilter.cpp +++ b/cmd/meshfilter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/mraverageheader.cpp b/cmd/mraverageheader.cpp index af64c4db36..c184ac00cb 100644 --- a/cmd/mraverageheader.cpp +++ b/cmd/mraverageheader.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -66,7 +66,7 @@ void run() { bool fill = get_options("fill").size(); - vector
headers_in; + std::vector
headers_in; size_t dim(Header::open(argument[0]).ndim()); if (dim < 3 or dim > 4) throw Exception("Please provide 3D or 4D images"); @@ -82,7 +82,7 @@ void run() { } } - vector> transform_header_with; + std::vector> transform_header_with; auto H = compute_minimum_average_header(headers_in, transform_header_with, resolution, padding); H.datatype() = DataType::Bit; if (fill) { diff --git a/cmd/mrcalc.cpp b/cmd/mrcalc.cpp index 5dac20f812..d6c19aeb59 100644 --- a/cmd/mrcalc.cpp +++ b/cmd/mrcalc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -406,7 +406,7 @@ void usage() { class Evaluator; -class Chunk : public vector { +class Chunk : public std::vector { public: complex_type value; }; @@ -417,7 +417,7 @@ class ThreadLocalStorageItem { copy_ptr> image; }; -class ThreadLocalStorage : public vector { +class ThreadLocalStorage : public std::vector { public: void load(Chunk &chunk, Image &image) { for (size_t n = 0; n < image.ndim(); ++n) @@ -451,7 +451,7 @@ class ThreadLocalStorage : public vector { } const Iterator *iter; - vector axes, size; + std::vector axes, size; private: size_t current; @@ -547,7 +547,7 @@ class Evaluator { const std::string id; const char *format; bool ZtoR, RtoZ; - vector operands; + std::vector operands; Chunk &evaluate(ThreadLocalStorage &storage) const { Chunk &in1(operands[0].evaluate(storage)); @@ -717,7 +717,7 @@ template class TernaryEvaluator : public Evaluator { }; template -void unary_operation(const std::string &operation_name, vector &stack, Operation operation) { +void unary_operation(const std::string &operation_name, std::vector &stack, Operation operation) { if (stack.empty()) throw Exception("no operand in stack for operation \"" + operation_name + "\"!"); StackEntry &a(stack[stack.size() - 1]); @@ -735,7 +735,7 @@ void unary_operation(const std::string &operation_name, vector &stac } template -void binary_operation(const std::string &operation_name, vector &stack, Operation operation) { +void binary_operation(const std::string &operation_name, std::vector &stack, Operation operation) { if (stack.size() < 2) throw Exception("not enough operands in stack for operation \"" + operation_name + "\""); StackEntry &a(stack[stack.size() - 2]); @@ -754,7 +754,7 @@ void binary_operation(const std::string &operation_name, vector &sta } template -void ternary_operation(const std::string &operation_name, vector &stack, Operation operation) { +void ternary_operation(const std::string &operation_name, std::vector &stack, Operation operation) { if (stack.size() < 3) throw Exception("not enough operands in stack for operation \"" + operation_name + "\""); StackEntry &a(stack[stack.size() - 3]); @@ -815,7 +815,9 @@ void get_header(const StackEntry &entry, Header &header) { class ThreadFunctor { public: - ThreadFunctor(const vector &inner_axes, const StackEntry &top_of_stack, Image &output_image) + ThreadFunctor(const std::vector &inner_axes, + const StackEntry &top_of_stack, + Image &output_image) : top_entry(top_of_stack), image(output_image), loop(Loop(inner_axes)) { storage.axes = loop.axes; storage.size.push_back(image.size(storage.axes[0])); @@ -855,12 +857,12 @@ class ThreadFunctor { const StackEntry &top_entry; Image image; - decltype(Loop(vector())) loop; + decltype(Loop(std::vector())) loop; ThreadLocalStorage storage; size_t chunk_size; }; -void run_operations(const vector &stack) { +void run_operations(const std::vector &stack) { Header header; get_header(stack[0], header); @@ -966,7 +968,7 @@ class OpTernary : public OpBase { **********************************************************************/ void run() { - vector stack; + std::vector stack; for (int n = 1; n < App::argc; ++n) { diff --git a/cmd/mrcat.cpp b/cmd/mrcat.cpp index 2c34fbcba3..da8d7348ce 100644 --- a/cmd/mrcat.cpp +++ b/cmd/mrcat.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -55,7 +55,7 @@ void usage() { + DataType::options(); } -template void write(vector
&in, const size_t axis, Header &header_out) { +template void write(std::vector
&in, const size_t axis, Header &header_out) { auto image_out = Image::create(header_out.name(), header_out); size_t axis_offset = 0; @@ -81,7 +81,7 @@ template void write(vector
&in, const size_t axis, void run() { size_t num_images = argument.size() - 1; - vector
headers; + std::vector
headers; ssize_t max_axis_nonunity = 0; for (size_t i = 0; i != num_images; ++i) { Header H = Header::open(argument[i]); diff --git a/cmd/mrcentroid.cpp b/cmd/mrcentroid.cpp index a1d1148850..34baa97329 100644 --- a/cmd/mrcentroid.cpp +++ b/cmd/mrcentroid.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/mrcheckerboardmask.cpp b/cmd/mrcheckerboardmask.cpp index 13b8c09369..158de22520 100644 --- a/cmd/mrcheckerboardmask.cpp +++ b/cmd/mrcheckerboardmask.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/mrclusterstats.cpp b/cmd/mrclusterstats.cpp index 6ee2be9498..1232016c98 100644 --- a/cmd/mrclusterstats.cpp +++ b/cmd/mrclusterstats.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -175,7 +175,7 @@ void run() { auto mask_header = Header::open(argument[3]); check_effective_dimensionality(mask_header, 3); auto mask_image = mask_header.get_image(); - std::shared_ptr v2v = make_shared(mask_image, mask_header); + std::shared_ptr v2v = std::make_shared(mask_image, mask_header); SubjectVoxelImport::set_mapping(v2v); Filter::Connector connector; connector.adjacency.set_26_adjacency(do_26_connectivity); @@ -199,7 +199,7 @@ void run() { // Before validating the contrast matrix, we first need to see if there are any // additional design matrix columns coming from voxel-wise subject data // TODO Functionalise this - vector extra_columns; + std::vector extra_columns; bool nans_in_columns = false; auto opt = get_options("column"); for (size_t i = 0; i != opt.size(); ++i) { @@ -225,7 +225,7 @@ void run() { CONSOLE("Number of variance groups: " + str(num_vgs)); // Load hypotheses - const vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[2]); + const std::vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[2]); const index_type num_hypotheses = hypotheses.size(); if (hypotheses[0].cols() != num_factors) throw Exception( diff --git a/cmd/mrcolour.cpp b/cmd/mrcolour.cpp index a9143f6d12..1b3dc5ee3f 100644 --- a/cmd/mrcolour.cpp +++ b/cmd/mrcolour.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -29,8 +29,8 @@ using namespace MR; using namespace App; -vector colourmap_choices_std; -vector colourmap_choices_cstr; +std::vector colourmap_choices_std; +std::vector colourmap_choices_cstr; void usage() { diff --git a/cmd/mrconvert.cpp b/cmd/mrconvert.cpp index 50f20236f5..c8bbd84306 100644 --- a/cmd/mrconvert.cpp +++ b/cmd/mrconvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -211,7 +211,7 @@ void usage() { + PhaseEncoding::ImportOptions + PhaseEncoding::ExportOptions; } -void permute_DW_scheme(Header &H, const vector &axes) { +void permute_DW_scheme(Header &H, const std::vector &axes) { auto in = DWI::parse_DW_scheme(H); if (!in.rows()) return; @@ -231,7 +231,7 @@ void permute_DW_scheme(Header &H, const vector &axes) { DWI::set_DW_scheme(H, out); } -void permute_PE_scheme(Header &H, const vector &axes) { +void permute_PE_scheme(Header &H, const std::vector &axes) { auto in = PhaseEncoding::parse_scheme(H); if (!in.rows()) return; @@ -249,7 +249,7 @@ void permute_PE_scheme(Header &H, const vector &axes) { PhaseEncoding::set_scheme(H, out); } -void permute_slice_direction(Header &H, const vector &axes) { +void permute_slice_direction(Header &H, const std::vector &axes) { auto it = H.keyval().find("SliceEncodingDirection"); if (it == H.keyval().end()) return; @@ -258,7 +258,7 @@ void permute_slice_direction(Header &H, const vector &axes) { it->second = Axes::dir2id(new_dir); } -template inline vector set_header(Header &header, const ImageType &input) { +template inline std::vector set_header(Header &header, const ImageType &input) { header.ndim() = input.ndim(); for (size_t n = 0; n < header.ndim(); ++n) { header.size(n) = input.size(n); @@ -268,7 +268,7 @@ template inline vector set_header(Header &header, const I header.transform() = input.transform(); auto opt = get_options("axes"); - vector axes; + std::vector axes; if (opt.size()) { axes = parse_ints(opt[0][0]); header.ndim() = axes.size(); @@ -292,7 +292,7 @@ template inline vector set_header(Header &header, const I opt = get_options("vox"); if (opt.size()) { - vector vox = parse_floats(opt[0][0]); + std::vector vox = parse_floats(opt[0][0]); if (vox.size() > header.ndim()) throw Exception("too many axes supplied to -vox option"); if (vox.size() == 1) @@ -321,7 +321,7 @@ void copy_permute(const InputType &in, Header &header_out, const std::string &ou template void extract(Header &header_in, Header &header_out, - const vector> &pos, + const std::vector> &pos, const std::string &output_filename) { auto in = header_in.get_image(); if (pos.empty()) { @@ -402,9 +402,9 @@ void run() { } opt = get_options("coord"); - vector> pos; + std::vector> pos; if (opt.size()) { - pos.assign(header_in.ndim(), vector()); + pos.assign(header_in.ndim(), std::vector()); for (size_t n = 0; n < opt.size(); n++) { size_t axis = opt[n][0]; if (axis >= header_in.ndim()) @@ -466,7 +466,7 @@ void run() { opt = get_options("scaling"); if (opt.size()) { if (header_out.datatype().is_integer()) { - vector scaling = opt[0][0]; + std::vector scaling = opt[0][0]; if (scaling.size() != 2) throw Exception("-scaling option expects comma-separated 2-vector of floating-point values"); header_out.intensity_offset() = scaling[0]; diff --git a/cmd/mrdegibbs.cpp b/cmd/mrdegibbs.cpp index c528d30e0a..ab4f82c3f9 100644 --- a/cmd/mrdegibbs.cpp +++ b/cmd/mrdegibbs.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -102,12 +102,12 @@ void run() { int mode = get_option_value("mode", 0); - vector slice_axes = {0, 1}; + std::vector slice_axes = {0, 1}; auto opt = get_options("axes"); const bool axes_set_manually = opt.size(); if (opt.size()) { - vector axes = parse_ints(opt[0][0]); - if (axes == vector({0, 1, 2})) { + std::vector axes = parse_ints(opt[0][0]); + if (axes == std::vector({0, 1, 2})) { mode = 1; } else { if (axes.size() != 2) @@ -128,7 +128,7 @@ void run() { } else { try { const Eigen::Vector3d slice_encoding_axis_onehot = Axes::id2dir(slice_encoding_it->second); - vector auto_slice_axes = {0, 0}; + std::vector auto_slice_axes = {0, 0}; if (slice_encoding_axis_onehot[0]) auto_slice_axes = {1, 2}; else if (slice_encoding_axis_onehot[1]) @@ -170,7 +170,7 @@ void run() { } // build vector of outer axes: - vector outer_axes(header.ndim()); + std::vector outer_axes(header.ndim()); std::iota(outer_axes.begin(), outer_axes.end(), 0); for (const auto axis : slice_axes) { auto it = std::find(outer_axes.begin(), outer_axes.end(), axis); diff --git a/cmd/mrdump.cpp b/cmd/mrdump.cpp index 7a19936ee6..dec4b7cb59 100644 --- a/cmd/mrdump.cpp +++ b/cmd/mrdump.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/mredit.cpp b/cmd/mredit.cpp index c7b98dc168..f392428b5d 100644 --- a/cmd/mredit.cpp +++ b/cmd/mredit.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -136,7 +136,7 @@ void run() { else centre_scannerspace = transform.voxel2scanner * centre_voxelspace; std::set processed; - vector to_expand; + std::vector to_expand; const Vox seed_voxel(centre_voxelspace); processed.insert(seed_voxel); to_expand.push_back(seed_voxel); diff --git a/cmd/mrfilter.cpp b/cmd/mrfilter.cpp index 3b4f43dddb..a6ba0b8627 100644 --- a/cmd/mrfilter.cpp +++ b/cmd/mrfilter.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -154,7 +154,7 @@ void run() { // convert between cfloat and cdouble... auto input = Image::open(argument[0]); - vector axes = {0, 1, 2}; + std::vector axes = {0, 1, 2}; auto opt = get_options("axes"); if (opt.size()) { axes = parse_ints(opt[0][0]); @@ -204,7 +204,7 @@ void run() { auto input = Image::open(argument[0]); Filter::Gradient filter(input, get_options("magnitude").size()); - vector stdev; + std::vector stdev; auto opt = get_options("stdev"); if (opt.size()) { stdev = parse_floats(opt[0][0]); @@ -258,7 +258,7 @@ void run() { if (opt.size()) { if (stdev_supplied) throw Exception("the stdev and FWHM options are mutually exclusive."); - vector stdevs = parse_floats((opt[0][0])); + std::vector stdevs = parse_floats((opt[0][0])); for (size_t d = 0; d < stdevs.size(); ++d) stdevs[d] = stdevs[d] / 2.3548; // convert FWHM to stdev filter.set_stdev(stdevs); diff --git a/cmd/mrgrid.cpp b/cmd/mrgrid.cpp index 23b4364d19..d6912c8e13 100644 --- a/cmd/mrgrid.cpp +++ b/cmd/mrgrid.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -198,7 +198,7 @@ void run() { } // over-sampling - vector oversample = Adapter::AutoOverSample; + std::vector oversample = Adapter::AutoOverSample; opt = get_options("oversample"); if (opt.size()) { oversample = parse_ints(opt[0][0]); @@ -223,7 +223,7 @@ void run() { regrid_filter.set_interp_type(interp); regrid_filter.set_oversample(oversample); - vector scale; + std::vector scale; opt = get_options("scale"); if (opt.size()) { scale = parse_floats(opt[0][0]); @@ -233,7 +233,7 @@ void run() { ++resize_option_count; } - vector image_size; + std::vector image_size; opt = get_options("size"); if (opt.size()) { image_size = parse_ints(opt[0][0]); @@ -241,7 +241,7 @@ void run() { ++resize_option_count; } - vector voxel_size; + std::vector voxel_size; opt = get_options("voxel"); if (opt.size()) { voxel_size = parse_floats(opt[0][0]); @@ -278,7 +278,7 @@ void run() { const size_t nd = get_options("nd").size() ? input_header.ndim() : 3; - vector> bounds(input_header.ndim(), vector(2)); + std::vector> bounds(input_header.ndim(), std::vector(2)); for (size_t axis = 0; axis < input_header.ndim(); axis++) { bounds[axis][0] = 0; bounds[axis][1] = input_header.size(axis) - 1; @@ -301,9 +301,10 @@ void run() { } struct BoundsCheck { - vector> &overall_bounds; - vector> bounds; - BoundsCheck(vector> &overall_bounds) : overall_bounds(overall_bounds), bounds(overall_bounds) {} + std::vector> &overall_bounds; + std::vector> bounds; + BoundsCheck(std::vector> &overall_bounds) + : overall_bounds(overall_bounds), bounds(overall_bounds) {} ~BoundsCheck() { for (size_t axis = 0; axis != 3; ++axis) { overall_bounds[axis][0] = std::min(bounds[axis][0], overall_bounds[axis][0]); @@ -395,7 +396,7 @@ void run() { std::string::size_type start = 0, end; end = spec.find_first_of(":", start); if (end == std::string::npos) { // spec = delta_lower,delta_upper - vector delta; // 0: not changed, > 0: pad, < 0: crop + std::vector delta; // 0: not changed, > 0: pad, < 0: crop try { delta = parse_ints(opt[i][1]); } catch (Exception &E) { @@ -433,8 +434,8 @@ void run() { if (crop_pad_option_count == 0) throw Exception("no crop or pad option supplied"); - vector from(input_header.ndim()); - vector size(input_header.ndim()); + std::vector from(input_header.ndim()); + std::vector size(input_header.ndim()); for (size_t axis = 0; axis < input_header.ndim(); axis++) { from[axis] = bounds[axis][0]; size[axis] = bounds[axis][1] - from[axis] + 1; diff --git a/cmd/mrhistmatch.cpp b/cmd/mrhistmatch.cpp index c0bb882b1e..9f18e75505 100644 --- a/cmd/mrhistmatch.cpp +++ b/cmd/mrhistmatch.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -66,12 +66,12 @@ void match_linear(Image &input, Image &mask_input, Image &mask_target, const bool estimate_intercept) { - vector input_data, target_data; + std::vector input_data, target_data; { ProgressBar progress("Loading & sorting image data", 4); auto fill = [](Image &image, Image &mask) { - vector data; + std::vector data; if (mask.valid()) { Adapter::Replicate> mask_replicate(mask, image); for (auto l = Loop(image)(image, mask_replicate); l; ++l) { diff --git a/cmd/mrhistogram.cpp b/cmd/mrhistogram.cpp index 8c5147660f..0e7dcdc8e1 100644 --- a/cmd/mrhistogram.cpp +++ b/cmd/mrhistogram.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/mrinfo.cpp b/cmd/mrinfo.cpp index 2592043b86..88368dd018 100644 --- a/cmd/mrinfo.cpp +++ b/cmd/mrinfo.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -124,7 +124,7 @@ void print_spacing(const Header &header) { void print_strides(const Header &header) { std::string buffer; - vector strides(Stride::get(header)); + std::vector strides(Stride::get(header)); Stride::symbolise(strides); for (size_t i = 0; i < header.ndim(); ++i) { if (i) @@ -189,15 +189,15 @@ void print_properties(const Header &header, const std::string &key, const size_t void header2json(const Header &header, nlohmann::json &json) { // Capture _all_ header fields, not just the optional key-value pairs json["name"] = header.name(); - vector size(header.ndim()); - vector spacing(header.ndim()); + std::vector size(header.ndim()); + std::vector spacing(header.ndim()); for (size_t axis = 0; axis != header.ndim(); ++axis) { size[axis] = header.size(axis); spacing[axis] = header.spacing(axis); } json["size"] = size; json["spacing"] = spacing; - vector strides(Stride::get(header)); + std::vector strides(Stride::get(header)); Stride::symbolise(strides); json["strides"] = strides; json["format"] = header.format(); diff --git a/cmd/mrmath.cpp b/cmd/mrmath.cpp index baaeb3230f..bdcf5c9aeb 100644 --- a/cmd/mrmath.cpp +++ b/cmd/mrmath.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -121,7 +121,7 @@ class Median { values.push_back(val); } value_type result() { return Math::median(values); } - vector values; + std::vector values; }; class Sum { @@ -400,7 +400,7 @@ void run() { throw Exception("mrmath requires either multiple input images, or the -axis option to be provided"); // Pre-load all image headers - vector
headers_in(num_inputs); + std::vector
headers_in(num_inputs); // Header of first input image is the template to which all other input images are compared headers_in[0] = Header::open(argument[0]); diff --git a/cmd/mrmetric.cpp b/cmd/mrmetric.cpp index 28b95c1ac5..dccf8c4028 100644 --- a/cmd/mrmetric.cpp +++ b/cmd/mrmetric.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/mrregister.cpp b/cmd/mrregister.cpp index 6a5d4b9934..dfe49c0cb0 100644 --- a/cmd/mrregister.cpp +++ b/cmd/mrregister.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -149,7 +149,7 @@ using value_type = double; void run() { - vector
input1, input2; + std::vector
input1, input2; const size_t n_images = argument.size() / 2; { // parse arguments and load input headers if (n_images * 2 != argument.size()) { @@ -244,7 +244,7 @@ void run() { } // multi-contrast settings - vector mc_params(n_images); + std::vector mc_params(n_images); for (auto &mc : mc_params) { mc.do_reorientation = do_reorientation; } @@ -308,7 +308,7 @@ void run() { INFO("maximum input lmax: " + str(max_mc_image_lmax)); opt = get_options("transformed"); - vector im1_transformed_paths; + std::vector im1_transformed_paths; if (opt.size()) { if (opt.size() > n_images) throw Exception("number of -transformed images exceeds number of contrasts"); @@ -321,8 +321,8 @@ void run() { } } - vector input1_midway_transformed_paths; - vector input2_midway_transformed_paths; + std::vector input1_midway_transformed_paths; + std::vector input2_midway_transformed_paths; opt = get_options("transformed_midway"); if (opt.size()) { if (opt.size() > n_images) @@ -481,7 +481,7 @@ void run() { } opt = get_options("rigid_lmax"); - vector rigid_lmax; + std::vector rigid_lmax; if (opt.size()) { if (!do_rigid) throw Exception("the -rigid_lmax option has been set when no rigid registration is requested"); @@ -632,7 +632,7 @@ void run() { } opt = get_options("affine_lmax"); - vector affine_lmax; + std::vector affine_lmax; if (opt.size()) { if (!do_affine) throw Exception("the -affine_lmax option has been set when no affine registration is requested"); @@ -746,7 +746,7 @@ void run() { if (!do_nonlinear) throw Exception( "the non-linear multi-resolution scale factors were input when no non-linear registration is requested"); - vector scale_factors = parse_floats(opt[0][0]); + std::vector scale_factors = parse_floats(opt[0][0]); if (nonlinear_init) { WARN("-nl_scale option ignored since only the full resolution will be performed when initialising with " "non-linear warp"); @@ -760,7 +760,7 @@ void run() { if (!do_nonlinear) throw Exception( "the number of non-linear iterations have been input when no non-linear registration is requested"); - vector iterations_per_level = parse_ints(opt[0][0]); + std::vector iterations_per_level = parse_ints(opt[0][0]); if (nonlinear_init && iterations_per_level.size() > 1) throw Exception("when initialising the non-linear registration the max number of iterations can only be defined " "for a single level"); @@ -792,7 +792,7 @@ void run() { } opt = get_options("nl_lmax"); - vector nl_lmax; + std::vector nl_lmax; if (opt.size()) { if (!do_nonlinear) throw Exception("the -nl_lmax option has been set when no non-linear registration is requested"); @@ -810,7 +810,7 @@ void run() { opt = get_options("mc_weights"); if (opt.size()) { - vector mc_weights = parse_floats(opt[0][0]); + std::vector mc_weights = parse_floats(opt[0][0]); if (mc_weights.size() == 1) mc_weights.resize(n_images, mc_weights[0]); else if (mc_weights.size() != n_images) @@ -914,7 +914,7 @@ void run() { } else { // 3D if (rigid_metric == Registration::NCC) { Registration::Metric::LocalCrossCorrelation metric; - vector extent(3, 3); + std::vector extent(3, 3); rigid_registration.set_extent(extent); rigid_registration.run_masked(metric, rigid, images1, images2, im1_mask, im2_mask); } else if (rigid_metric == Registration::Diff) { @@ -989,7 +989,7 @@ void run() { } else { // 3D if (affine_metric == Registration::NCC) { Registration::Metric::LocalCrossCorrelation metric; - vector extent(3, 3); + std::vector extent(3, 3); affine_registration.set_extent(extent); affine_registration.run_masked(metric, affine, images1, images2, im1_mask, im2_mask); } else if (affine_metric == Registration::Diff) { diff --git a/cmd/mrstats.cpp b/cmd/mrstats.cpp index 92aabe5403..7e9daefb41 100644 --- a/cmd/mrstats.cpp +++ b/cmd/mrstats.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -106,7 +106,7 @@ void run() { check_dimensions(mask, header, 0, 3); } - vector fields; + std::vector fields; opt = get_options("output"); for (size_t n = 0; n < opt.size(); ++n) fields.push_back(opt[n][0]); diff --git a/cmd/mrthreshold.cpp b/cmd/mrthreshold.cpp index fe9a63dfdf..82bdb9b989 100644 --- a/cmd/mrthreshold.cpp +++ b/cmd/mrthreshold.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -141,8 +141,9 @@ Image get_mask(const Image &in) { return mask; } -vector get_data(Image &in, Image &mask, const size_t max_axis, const bool ignore_zero) { - vector data; +std::vector +get_data(Image &in, Image &mask, const size_t max_axis, const bool ignore_zero) { + std::vector data; data.reserve(voxel_count(in, 0, max_axis)); if (mask.valid()) { Adapter::Replicate> mask_replicate(mask, in); @@ -232,7 +233,7 @@ default_type calculate(Image &in, if (max_axis < in.ndim()) { // Need to extract just the current 3D volume - vector in_from(in.ndim()), in_size(in.ndim()); + std::vector in_from(in.ndim()), in_size(in.ndim()); size_t axis; for (axis = 0; axis != 3; ++axis) { in_from[axis] = 0; @@ -244,7 +245,7 @@ default_type calculate(Image &in, } Adapter::Subset> in_subset(in, in_from, in_size); if (mask.valid()) { - vector mask_from(mask.ndim()), mask_size(mask.ndim()); + std::vector mask_from(mask.ndim()), mask_size(mask.ndim()); for (axis = 0; axis != 3; ++axis) { mask_from[axis] = 0; mask_size[axis] = mask.size(axis); diff --git a/cmd/mrtransform.cpp b/cmd/mrtransform.cpp index 073d03e5fd..63fe703b9e 100644 --- a/cmd/mrtransform.cpp +++ b/cmd/mrtransform.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -225,7 +225,7 @@ void apply_warp(Image &input, Image &warp, const int interp, const float out_of_bounds_value, - const vector &oversample, + const std::vector &oversample, const bool jacobian_modulate = false) { switch (interp) { case 0: @@ -373,7 +373,7 @@ void run() { // Flip opt = get_options("flip"); - vector axes; + std::vector axes; if (opt.size()) { axes = parse_ints(opt[0][0]); transform_type flip; @@ -550,7 +550,7 @@ void run() { } // over-sampling - vector oversample = Adapter::AutoOverSample; + std::vector oversample = Adapter::AutoOverSample; opt = get_options("oversample"); if (opt.size()) { if (!template_header.valid() && !warp) diff --git a/cmd/mrview.cpp b/cmd/mrview.cpp index 4baba86cb2..2d7fb0f94e 100644 --- a/cmd/mrview.cpp +++ b/cmd/mrview.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -82,9 +82,9 @@ void run() { GUI::App::setEventHandler([](QEvent *event) { if (event->type() == QEvent::FileOpen) { QFileOpenEvent *openEvent = static_cast(event); - vector> list; + std::vector> list; try { - list.push_back(make_unique(MR::Header::open(openEvent->file().toUtf8().data()))); + list.push_back(std::make_unique(MR::Header::open(openEvent->file().toUtf8().data()))); } catch (Exception &E) { E.display(); } diff --git a/cmd/mtnormalise.cpp b/cmd/mtnormalise.cpp index f25b57ac4f..4c10bfd6d8 100644 --- a/cmd/mtnormalise.cpp +++ b/cmd/mtnormalise.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -473,7 +473,7 @@ void run() { size_t max_balance_iter = DEFAULT_BALANCE_MAXITER_VALUE; auto opt = get_options("niter"); if (opt.size()) { - vector num = parse_ints(opt[0][0]); + std::vector num = parse_ints(opt[0][0]); if (num.size() < 1 && num.size() > 2) throw Exception("unexpected number of entries provided to option \"-niter\""); for (auto n : num) diff --git a/cmd/peaks2amp.cpp b/cmd/peaks2amp.cpp index 2b91b825a6..b986fcfcf1 100644 --- a/cmd/peaks2amp.cpp +++ b/cmd/peaks2amp.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/peaks2fixel.cpp b/cmd/peaks2fixel.cpp index c3383b44da..4849d7467c 100644 --- a/cmd/peaks2fixel.cpp +++ b/cmd/peaks2fixel.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -43,9 +43,9 @@ void usage() { +Option("dataname", "the name of the output fixel data file encoding peak amplitudes") + Argument("path").type_text(); } -vector get(Image &data) { +std::vector get(Image &data) { data.index(3) = 0; - vector result; + std::vector result; while (data.index(3) < data.size(3)) { Eigen::Vector3d direction; for (size_t axis = 0; axis != 3; ++axis) { diff --git a/cmd/sh2amp.cpp b/cmd/sh2amp.cpp index f5bc927677..b6cbc1045c 100644 --- a/cmd/sh2amp.cpp +++ b/cmd/sh2amp.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -100,7 +100,7 @@ class SH2Amp { class SH2AmpMultiShell { public: - SH2AmpMultiShell(const vector &dirs, const DWI::Shells &shells, bool nonneg) + SH2AmpMultiShell(const std::vector &dirs, const DWI::Shells &shells, bool nonneg) : transforms(dirs), shells(shells), nonnegative(nonneg) {} void operator()(Image &in, Image &out) { @@ -122,7 +122,7 @@ class SH2AmpMultiShell { } private: - const vector &transforms; + const std::vector &transforms; const DWI::Shells &shells; const bool nonnegative; Eigen::VectorXd sh, amp; @@ -194,7 +194,7 @@ void run() { } else if (!(sh_data.ndim() == 4 || (sh_data.ndim() > 4 && (sh_data.size(4) != 1)))) throw Exception("number of shells differs between gradient scheme and input data"); - vector transforms; + std::vector transforms; for (size_t n = 0; n < shells.count(); ++n) { Eigen::MatrixXd dirs(shells[n].count(), 2); diff --git a/cmd/sh2peaks.cpp b/cmd/sh2peaks.cpp index ed28267904..29b9d3653f 100644 --- a/cmd/sh2peaks.cpp +++ b/cmd/sh2peaks.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -145,7 +145,7 @@ class Processor { Eigen::Matrix &directions, int lmax, int npeaks, - vector true_peaks, + std::vector true_peaks, value_type threshold, Image ipeaks_data, bool use_precomputer) @@ -157,7 +157,7 @@ class Processor { threshold(threshold), peaks_out(npeaks), ipeaks_vox(ipeaks_data), - precomputer(use_precomputer ? new Math::SH::PrecomputedAL(lmax) : nullptr) {} + precomputer(use_precomputer ? std::make_shared>(lmax) : nullptr) {} bool operator()(const Item &item) { @@ -171,11 +171,11 @@ class Processor { return true; } - vector all_peaks; + std::vector all_peaks; for (size_t i = 0; i < size_t(dirs.rows()); i++) { Direction p(dirs(i, 0), dirs(i, 1)); - p.a = Math::SH::get_peak(item.data, lmax, p.v, precomputer); + p.a = Math::SH::get_peak(item.data, lmax, p.v, precomputer.get()); if (std::isfinite(p.a)) { for (size_t j = 0; j < all_peaks.size(); j++) { if (abs(p.v.dot(all_peaks[j].v)) > DOT_THRESHOLD) { @@ -245,11 +245,11 @@ class Processor { Image dirs_vox; Eigen::Matrix dirs; int lmax, npeaks; - vector true_peaks; + std::vector true_peaks; value_type threshold; - vector peaks_out; + std::vector peaks_out; Image ipeaks_vox; - Math::SH::PrecomputedAL *precomputer; + std::shared_ptr> precomputer; bool check_input(const Item &item) { if (ipeaks_vox.valid()) { @@ -299,7 +299,7 @@ void run() { int npeaks = get_option_value("num", DEFAULT_NPEAKS); opt = get_options("direction"); - vector true_peaks; + std::vector true_peaks; for (size_t n = 0; n < opt.size(); ++n) { Direction p(Math::pi * to(opt[n][0]) / 180.0, Math::pi * float(opt[n][1]) / 180.0); true_peaks.push_back(p); diff --git a/cmd/sh2power.cpp b/cmd/sh2power.cpp index f07b8c8263..d4e3e57b05 100644 --- a/cmd/sh2power.cpp +++ b/cmd/sh2power.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/sh2response.cpp b/cmd/sh2response.cpp index 4bd977759a..614de96c96 100644 --- a/cmd/sh2response.cpp +++ b/cmd/sh2response.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/shbasis.cpp b/cmd/shbasis.cpp index 1522adb459..90ca33c268 100644 --- a/cmd/shbasis.cpp +++ b/cmd/shbasis.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -69,7 +69,7 @@ void usage() { // Perform a linear regression on the power ratio in each order // Omit l=2 - tends to be abnormally small due to non-isotropic brain-wide fibre distribution -std::pair get_regression(const vector &ratios) { +std::pair get_regression(const std::vector &ratios) { const size_t n = ratios.size() - 1; Eigen::VectorXf Y(n), b(2); Eigen::MatrixXf A(n, 2); @@ -120,7 +120,7 @@ template void check_and_update(Header &H, const conv_t con if (App::log_level > 0 && App::log_level < 2) progress.reset(new ProgressBar("Evaluating SH basis of image \"" + H.name() + "\"", N - 1)); - vector ratios; + std::vector ratios; for (size_t l = 2; l <= lmax; l += 2) { @@ -317,7 +317,7 @@ void run() { } } - for (vector::const_iterator i = argument.begin(); i != argument.end(); ++i) { + for (std::vector::const_iterator i = argument.begin(); i != argument.end(); ++i) { const std::string path = *i; Header H = Header::open(path); diff --git a/cmd/shconv.cpp b/cmd/shconv.cpp index 04fefe6793..f1a888b319 100644 --- a/cmd/shconv.cpp +++ b/cmd/shconv.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -58,7 +58,7 @@ using value_type = float; class SConvFunctor { public: - SConvFunctor(const vector &responses, vector> &inputs) + SConvFunctor(const std::vector &responses, std::vector> &inputs) : responses(responses), inputs(inputs) {} void operator()(Image &output) { @@ -78,8 +78,8 @@ class SConvFunctor { } protected: - const vector &responses; - vector> inputs; + const std::vector &responses; + std::vector> inputs; Eigen::VectorXd in, out; }; @@ -87,8 +87,8 @@ void run() { if (!(argument.size() & size_t(1U))) throw Exception("unexpected number of arguments"); - vector> inputs((argument.size() - 1) / 2); - vector responses(inputs.size()); + std::vector> inputs((argument.size() - 1) / 2); + std::vector responses(inputs.size()); size_t lmax = 0; for (size_t n = 0; n < inputs.size(); ++n) { diff --git a/cmd/shview.cpp b/cmd/shview.cpp index 7b481ff7e1..97479a4c4d 100644 --- a/cmd/shview.cpp +++ b/cmd/shview.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tck2connectome.cpp b/cmd/tck2connectome.cpp index 1c33fdad28..dc9a91f845 100644 --- a/cmd/tck2connectome.cpp +++ b/cmd/tck2connectome.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -182,7 +182,7 @@ void run() { // First, find out how many segmented nodes there are, so the matrix can be pre-allocated // Also check for node volume for all nodes - vector node_volumes(1, 0); + std::vector node_volumes(1, 0); node_t max_node_index = 0; for (auto i = Loop(node_image, 0, 3)(node_image); i; ++i) { if (node_image.value() > max_node_index) { diff --git a/cmd/tck2fixel.cpp b/cmd/tck2fixel.cpp index 0aaf473370..df7e70ea7a 100644 --- a/cmd/tck2fixel.cpp +++ b/cmd/tck2fixel.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -40,8 +40,8 @@ class TrackProcessor { using SetVoxelDir = DWI::Tractography::Mapping::SetVoxelDir; TrackProcessor(Image &fixel_indexer, - const vector &fixel_directions, - vector &fixel_TDI, + const std::vector &fixel_directions, + std::vector &fixel_TDI, const float angular_threshold) : fixel_indexer(fixel_indexer), fixel_directions(fixel_directions), @@ -50,7 +50,7 @@ class TrackProcessor { bool operator()(const SetVoxelDir &in) { // For each voxel tract tangent, assign to a fixel - vector tract_fixel_indices; + std::vector tract_fixel_indices; for (SetVoxelDir::const_iterator i = in.begin(); i != in.end(); ++i) { assign_pos_of(*i).to(fixel_indexer); fixel_indexer.index(3) = 0; @@ -80,8 +80,8 @@ class TrackProcessor { private: Image fixel_indexer; - const vector &fixel_directions; - vector &fixel_TDI; + const std::vector &fixel_directions; + std::vector &fixel_TDI; const float angular_threshold_dp; }; @@ -128,8 +128,8 @@ void run() { const float angular_threshold = get_option_value("angle", DEFAULT_ANGLE_THRESHOLD); - vector positions(num_fixels); - vector directions(num_fixels); + std::vector positions(num_fixels); + std::vector directions(num_fixels); const std::string output_fixel_folder = argument[2]; Fixel::copy_index_and_directions_file(input_fixel_folder, output_fixel_folder); @@ -151,7 +151,7 @@ void run() { } } - vector fixel_TDI(num_fixels, 0.0); + std::vector fixel_TDI(num_fixels, 0.0); const std::string track_filename = argument[0]; DWI::Tractography::Properties properties; DWI::Tractography::Reader track_file(track_filename, properties); diff --git a/cmd/tckconvert.cpp b/cmd/tckconvert.cpp index 5260cfbef3..24c86f821a 100644 --- a/cmd/tckconvert.cpp +++ b/cmd/tckconvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -186,12 +186,12 @@ class VTKWriter : public WriterInterface { File::OFStream VTKout; const bool write_ascii; size_t offset_num_points; - vector> track_list; + std::vector> track_list; size_t current_index = 0; }; -template void loadLines(vector &lines, std::ifstream &input, int number_of_line_indices) { - vector buffer(number_of_line_indices); +template void loadLines(std::vector &lines, std::ifstream &input, int number_of_line_indices) { + std::vector buffer(number_of_line_indices); input.read((char *)&buffer[0], number_of_line_indices * sizeof(T)); lines.resize(number_of_line_indices); // swap from big endian @@ -254,8 +254,8 @@ class VTKReader : public ReaderInterface { } private: - vector points; - vector lines; + std::vector points; + std::vector lines; int lineIdx; int number_of_lines; int number_of_line_indices; @@ -308,7 +308,7 @@ class ASCIIWriter : public WriterInterface { private: File::NameParser parser; - vector count; + std::vector count; }; class PLYWriter : public WriterInterface { diff --git a/cmd/tckdfc.cpp b/cmd/tckdfc.cpp index 45753be78e..03851397a7 100644 --- a/cmd/tckdfc.cpp +++ b/cmd/tckdfc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -212,7 +212,7 @@ class Count_receiver { void run() { bool is_static = get_options("static").size(); - vector window; + std::vector window; auto opt = get_options("dynamic"); if (opt.size()) { @@ -281,7 +281,7 @@ void run() { Image fmri_image(Image::open(argument[1]).with_direct_io(3)); - vector voxel_size; + std::vector voxel_size; opt = get_options("vox"); if (opt.size()) voxel_size = parse_floats(opt[0][0]); diff --git a/cmd/tckedit.cpp b/cmd/tckedit.cpp index afc3963636..317111f454 100644 --- a/cmd/tckedit.cpp +++ b/cmd/tckedit.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -126,7 +126,7 @@ void run() { // Get the consensus streamline properties from among the multiple input files Tractography::Properties properties; size_t count = 0; - vector input_file_list; + std::vector input_file_list; for (size_t file_index = 0; file_index != num_inputs; ++file_index) { diff --git a/cmd/tckgen.cpp b/cmd/tckgen.cpp index 78df6cbf48..fa8bcd79e1 100644 --- a/cmd/tckgen.cpp +++ b/cmd/tckgen.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tckglobal.cpp b/cmd/tckglobal.cpp index cb05faaefe..a9b0ad7199 100644 --- a/cmd/tckglobal.cpp +++ b/cmd/tckglobal.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tckinfo.cpp b/cmd/tckinfo.cpp index 064aad286f..e894d2ed41 100644 --- a/cmd/tckinfo.cpp +++ b/cmd/tckinfo.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -57,7 +57,7 @@ void run() { if (properties.comments.size()) { std::cout << " Comments: "; - for (vector::iterator i = properties.comments.begin(); i != properties.comments.end(); ++i) + for (std::vector::iterator i = properties.comments.begin(); i != properties.comments.end(); ++i) std::cout << (i == properties.comments.begin() ? "" : " ") << *i << "\n"; } diff --git a/cmd/tckmap.cpp b/cmd/tckmap.cpp index d3332b03c5..f831c4fe59 100644 --- a/cmd/tckmap.cpp +++ b/cmd/tckmap.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -255,7 +255,7 @@ void run() { const size_t num_tracks = properties["count"].empty() ? 0 : to(properties["count"]); - vector voxel_size = get_option_value("vox", vector()); + std::vector voxel_size = get_option_value("vox", std::vector()); if (voxel_size.size() == 1) { auto v = voxel_size.front(); diff --git a/cmd/tckresample.cpp b/cmd/tckresample.cpp index 66d9ac874c..c6cbee05a1 100644 --- a/cmd/tckresample.cpp +++ b/cmd/tckresample.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tcksample.cpp b/cmd/tcksample.cpp index 5ceee29381..2f50903222 100644 --- a/cmd/tcksample.cpp +++ b/cmd/tcksample.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -148,7 +148,7 @@ template class SamplerNonPrecise { } else { if (statistic == MEDIAN) { // Don't bother with a weighted median here - vector data; + std::vector data; data.assign(values.data(), values.data() + values.size()); out.second = Math::median(data); } else if (statistic == MIN) { @@ -234,7 +234,7 @@ class SamplerPrecise { bool operator<(const WeightSort &that) const { return value < that.value; } value_type value, length; }; - vector data; + std::vector data; for (const auto &v : voxels) { assign_pos_of(v).to(image); data.push_back(WeightSort(v, (image.value() * get_tdi_multiplier(v)))); diff --git a/cmd/tcksift.cpp b/cmd/tcksift.cpp index 40c8cf9886..50397ed7f5 100644 --- a/cmd/tcksift.cpp +++ b/cmd/tcksift.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -114,7 +114,7 @@ void run() { sifter.set_csv_path(opt[0][0]); opt = get_options("output_at_counts"); if (opt.size()) { - vector counts = parse_ints(opt[0][0]); + std::vector counts = parse_ints(opt[0][0]); sifter.set_regular_outputs(counts, debug_path); } diff --git a/cmd/tcksift2.cpp b/cmd/tcksift2.cpp index a8746e71e4..54627b8e23 100644 --- a/cmd/tcksift2.cpp +++ b/cmd/tcksift2.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tckstats.cpp b/cmd/tckstats.cpp index 6584389fef..3a614eabbf 100644 --- a/cmd/tckstats.cpp +++ b/cmd/tckstats.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -96,8 +96,8 @@ void run() { float max_length = -std::numeric_limits::infinity(); size_t empty_streamlines = 0, zero_length_streamlines = 0; default_type sum_lengths = 0.0, sum_weights = 0.0; - vector histogram; - vector all_lengths; + std::vector histogram; + std::vector all_lengths; all_lengths.reserve(header_count); { @@ -113,7 +113,7 @@ void run() { "widths"); } - vector dump; + std::vector dump; dump.reserve(header_count); ProgressBar progress("Reading track file", header_count); @@ -184,11 +184,11 @@ void run() { } default_type ssd = 0.0; - for (vector::const_iterator i = all_lengths.begin(); i != all_lengths.end(); ++i) + for (std::vector::const_iterator i = all_lengths.begin(); i != all_lengths.end(); ++i) ssd += i->get_weight() * Math::pow2(i->get_length() - mean_length); const float stdev = sum_weights ? (std::sqrt(ssd / (((count - 1) / default_type(count)) * sum_weights))) : NaN; - vector fields; + std::vector fields; auto opt = get_options("output"); for (size_t n = 0; n < opt.size(); ++n) fields.push_back(opt[n][0]); diff --git a/cmd/tcktransform.cpp b/cmd/tcktransform.cpp index ed4b7a4145..5a0ba9dfb8 100644 --- a/cmd/tcktransform.cpp +++ b/cmd/tcktransform.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tensor2metric.cpp b/cmd/tensor2metric.cpp index 4b8a27812b..340027f94f 100644 --- a/cmd/tensor2metric.cpp +++ b/cmd/tensor2metric.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -143,7 +143,7 @@ class Processor { Image &mk_img, Image &ak_img, Image &rk_img, - vector &vals, + std::vector &vals, int modulate, Eigen::MatrixXd mk_dirs, int rk_ndirs) @@ -352,7 +352,7 @@ class Processor { Image mk_img; Image ak_img; Image rk_img; - vector vals; + std::vector vals; const int modulate; Eigen::MatrixXd mk_dirs; Eigen::MatrixXd mk_bmat, rk_bmat; @@ -443,7 +443,7 @@ void run() { metric_count++; } - vector vals = {1}; + std::vector vals = {1}; opt = get_options("num"); if (opt.size()) { vals = parse_ints(opt[0][0]); diff --git a/cmd/transformcalc.cpp b/cmd/transformcalc.cpp index c6989862b5..43bdffad9e 100644 --- a/cmd/transformcalc.cpp +++ b/cmd/transformcalc.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -213,7 +213,7 @@ void run() { transform_type transform_out; Eigen::Transform Tin; Eigen::MatrixXd Min; - vector matrices; + std::vector matrices; for (size_t i = 0; i < num_inputs; i++) { DEBUG(str(argument[i])); Tin = File::Matrix::load_transform(argument[i]); diff --git a/cmd/transformcompose.cpp b/cmd/transformcompose.cpp index 033e126c1b..b2163f81e3 100644 --- a/cmd/transformcompose.cpp +++ b/cmd/transformcompose.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -91,7 +91,7 @@ void usage() { using value_type = float; void run() { - vector> transform_list; + std::vector> transform_list; std::unique_ptr
template_header; for (size_t i = 0; i < argument.size() - 1; ++i) { diff --git a/cmd/transformconvert.cpp b/cmd/transformconvert.cpp index 46eb813be3..47ea0b605e 100644 --- a/cmd/transformconvert.cpp +++ b/cmd/transformconvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -56,7 +56,7 @@ void usage() { } transform_type get_flirt_transform(const Header &header) { - vector axes; + std::vector axes; transform_type nifti_transform = File::NIfTI::adjust_transform(header, axes); if (nifti_transform.matrix().topLeftCorner<3, 3>().determinant() < 0.0) return nifti_transform; @@ -76,7 +76,7 @@ transform_type get_flirt_transform(const Header &header) { // template // transform_type parse_surfer_transform (const std::string& filename) { // std::ifstream stream (filename, std::ios_base::in | std::ios_base::binary); -// vector> V; +// std::vector> V; // std::string sbuf; // std::string file_version; // while (getline (stream, sbuf)) { @@ -97,7 +97,7 @@ transform_type get_flirt_transform(const Header &header) { // for (auto i = 0; i<4 && getline (stream, sbuf); ++i){ // // sbuf = strip (sbuf.substr (0, sbuf.find_first_of ('type'))); -// V.push_back (vector()); +// V.push_back (std::vector()); // const auto elements = MR::split (sbuf, " ,;\t", true); // for (const auto& entry : elements) // V.back().push_back (to (entry)); @@ -126,10 +126,10 @@ void parse_itk_trafo(const std::string &itk_file, TransformationType &transformation, Eigen::Vector3d ¢re_of_rotation) { const std::string first_line = "#Insight Transform File V1.0"; - vector supported_transformations = {"MatrixOffsetTransformBase_double_3_3", - "MatrixOffsetTransformBase_float_3_3", - "AffineTransform_double_3_3", - "AffineTransform_float_3_3"}; + std::vector supported_transformations = {"MatrixOffsetTransformBase_double_3_3", + "MatrixOffsetTransformBase_float_3_3", + "AffineTransform_double_3_3", + "AffineTransform_float_3_3"}; // TODO, support derived classes that are compatible // FixedCenterOfRotationAffineTransform_float_3_3? // QuaternionRigidTransform_double_3_3? @@ -146,7 +146,7 @@ void parse_itk_trafo(const std::string &itk_file, } else if (file.key() == "Parameters") { line = file.value(); std::replace(line.begin(), line.end(), ' ', ','); - vector parameters(parse_floats(line)); + std::vector parameters(parse_floats(line)); if (parameters.size() != 12) throw Exception("Expected itk file with 12 parameters but has " + str(parameters.size()) + " parameters."); transformation.linear().row(0) << parameters[0], parameters[1], parameters[2]; @@ -157,7 +157,7 @@ void parse_itk_trafo(const std::string &itk_file, } else if (file.key() == "FixedParameters") { line = file.value(); std::replace(line.begin(), line.end(), ' ', ','); - vector fixed_parameters(parse_floats(line)); + std::vector fixed_parameters(parse_floats(line)); centre_of_rotation << fixed_parameters[0], fixed_parameters[1], fixed_parameters[2]; invalid--; } diff --git a/cmd/tsfdivide.cpp b/cmd/tsfdivide.cpp index 7a68a08e21..53f472cb5a 100644 --- a/cmd/tsfdivide.cpp +++ b/cmd/tsfdivide.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tsfinfo.cpp b/cmd/tsfinfo.cpp index fed18c7737..170462f3a7 100644 --- a/cmd/tsfinfo.cpp +++ b/cmd/tsfinfo.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -62,7 +62,7 @@ void run() { if (properties.comments.size()) { std::cout << " Comments: "; - for (vector::iterator i = properties.comments.begin(); i != properties.comments.end(); ++i) + for (std::vector::iterator i = properties.comments.begin(); i != properties.comments.end(); ++i) std::cout << (i == properties.comments.begin() ? "" : " ") << *i << "\n"; } @@ -94,7 +94,7 @@ void run() { filename.replace(filename.size() - 4 - num.size(), num.size(), num); File::OFStream out(filename); - for (vector::iterator i = tck.begin(); i != tck.end(); ++i) + for (std::vector::iterator i = tck.begin(); i != tck.end(); ++i) out << (*i) << "\n"; out.close(); diff --git a/cmd/tsfmult.cpp b/cmd/tsfmult.cpp index fb814e7164..a6e45a41ab 100644 --- a/cmd/tsfmult.cpp +++ b/cmd/tsfmult.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tsfsmooth.cpp b/cmd/tsfsmooth.cpp index 07615f87ac..af50752ff6 100644 --- a/cmd/tsfsmooth.cpp +++ b/cmd/tsfsmooth.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -51,7 +51,7 @@ void run() { float stdev = get_option_value("stdev", DEFAULT_SMOOTHING); - vector kernel(2 * ceil(2.5 * stdev) + 1, 0); + std::vector kernel(2 * ceil(2.5 * stdev) + 1, 0); float norm_factor = 0.0; float radius = (kernel.size() - 1.0) / 2.0; for (size_t c = 0; c < kernel.size(); ++c) { diff --git a/cmd/tsfthreshold.cpp b/cmd/tsfthreshold.cpp index 89e530ef5a..a23841ee55 100644 --- a/cmd/tsfthreshold.cpp +++ b/cmd/tsfthreshold.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/tsfvalidate.cpp b/cmd/tsfvalidate.cpp index 4ce974103b..22d70db608 100644 --- a/cmd/tsfvalidate.cpp +++ b/cmd/tsfvalidate.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/vectorstats.cpp b/cmd/vectorstats.cpp index a2b3567382..a341ecef20 100644 --- a/cmd/vectorstats.cpp +++ b/cmd/vectorstats.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -142,7 +142,7 @@ void run() { // Before validating the contrast matrix, we first need to see if there are any // additional design matrix columns coming from element-wise subject data - vector extra_columns; + std::vector extra_columns; bool nans_in_columns = false; auto opt = get_options("column"); for (size_t i = 0; i != opt.size(); ++i) { @@ -168,7 +168,7 @@ void run() { CONSOLE("Number of variance groups: " + str(num_vgs)); // Load hypotheses - const vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[2]); + const std::vector hypotheses = Math::Stats::GLM::load_hypotheses(argument[2]); const index_type num_hypotheses = hypotheses.size(); if (hypotheses[0].cols() != num_factors) throw Exception( diff --git a/cmd/voxel2fixel.cpp b/cmd/voxel2fixel.cpp index 9e1abf6269..0083955379 100644 --- a/cmd/voxel2fixel.cpp +++ b/cmd/voxel2fixel.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/voxel2mesh.cpp b/cmd/voxel2mesh.cpp index fc2c7e6d38..ca7922c3ab 100644 --- a/cmd/voxel2mesh.cpp +++ b/cmd/voxel2mesh.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/warp2metric.cpp b/cmd/warp2metric.cpp index ead251bf51..185de61ca8 100644 --- a/cmd/warp2metric.cpp +++ b/cmd/warp2metric.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/warpconvert.cpp b/cmd/warpconvert.cpp index e1d5e81d14..d69e90dfa5 100644 --- a/cmd/warpconvert.cpp +++ b/cmd/warpconvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/warpcorrect.cpp b/cmd/warpcorrect.cpp index 6abba6e11e..9a9eb01584 100644 --- a/cmd/warpcorrect.cpp +++ b/cmd/warpcorrect.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/warpinit.cpp b/cmd/warpinit.cpp index 25148a8476..67e864c6d3 100644 --- a/cmd/warpinit.cpp +++ b/cmd/warpinit.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/cmd/warpinvert.cpp b/cmd/warpinvert.cpp index e0d37fec9e..9b2997ae07 100644 --- a/cmd/warpinvert.cpp +++ b/cmd/warpinvert.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/adapter/base.h b/core/adapter/base.h index 931ea0bf06..36e0f6eb10 100644 --- a/core/adapter/base.h +++ b/core/adapter/base.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/adapter/extract.h b/core/adapter/extract.h index 0b3c63f916..4ec4c60a9d 100644 --- a/core/adapter/extract.h +++ b/core/adapter/extract.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -31,7 +31,7 @@ template class Extract1D : public Base, I using base_type::parent; using base_type::spacing; - Extract1D(const ImageType &original, const size_t axis, const vector &indices) + Extract1D(const ImageType &original, const size_t axis, const std::vector &indices) : base_type(original), extract_axis(axis), indices(indices), nsize(indices.size()), trans(original.transform()) { reset(); @@ -77,7 +77,7 @@ template class Extract1D : public Base, I private: const size_t extract_axis; - vector indices; + std::vector indices; const ssize_t nsize; transform_type trans; ssize_t current_pos; @@ -92,7 +92,7 @@ template class Extract : public Base, Image using base_type::parent; using base_type::spacing; - Extract(const ImageType &original, const vector> &indices) + Extract(const ImageType &original, const std::vector> &indices) : base_type(original), current_pos(ndim()), indices(indices), trans(original.transform()) { reset(); trans.translation() = @@ -125,9 +125,9 @@ template class Extract : public Base, Image } private: - vector current_pos; - vector> indices; - vector sizes; + std::vector current_pos; + std::vector> indices; + std::vector sizes; transform_type trans; }; diff --git a/core/adapter/gaussian1D.h b/core/adapter/gaussian1D.h index 4408a4b8a6..e53ce90c23 100644 --- a/core/adapter/gaussian1D.h +++ b/core/adapter/gaussian1D.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -95,7 +95,7 @@ template class Gaussian1D : public Base, default_type stdev; ssize_t radius; size_t axis; - vector kernel; + std::vector kernel; const bool zero_boundary; }; } // namespace Adapter diff --git a/core/adapter/gradient1D.h b/core/adapter/gradient1D.h index 5630edad87..639d941c87 100644 --- a/core/adapter/gradient1D.h +++ b/core/adapter/gradient1D.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -79,8 +79,8 @@ template class Gradient1D : public Base, size_t axis; value_type result; const bool wrt_spacing; - vector derivative_weights; - vector half_derivative_weights; + std::vector derivative_weights; + std::vector half_derivative_weights; }; } // namespace Adapter } // namespace MR diff --git a/core/adapter/gradient3D.h b/core/adapter/gradient3D.h index 15b22a19c0..94ed3cd270 100644 --- a/core/adapter/gradient3D.h +++ b/core/adapter/gradient3D.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/adapter/jacobian.h b/core/adapter/jacobian.h index 4387e0645e..a456e13b9c 100644 --- a/core/adapter/jacobian.h +++ b/core/adapter/jacobian.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/adapter/median.h b/core/adapter/median.h index e63d67fe51..9a75d2f4d5 100644 --- a/core/adapter/median.h +++ b/core/adapter/median.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -33,18 +33,18 @@ template class Median : public Base, ImageTy using base_type::name; using base_type::size; - Median(const ImageType &parent) : base_type(parent) { set_extent(vector(1, 3)); } + Median(const ImageType &parent) : base_type(parent) { set_extent(std::vector(1, 3)); } - Median(const ImageType &parent, const vector &extent) : base_type(parent) { set_extent(extent); } + Median(const ImageType &parent, const std::vector &extent) : base_type(parent) { set_extent(extent); } - void set_extent(const vector &ext) { + void set_extent(const std::vector &ext) { for (size_t i = 0; i < ext.size(); ++i) if (!(ext[i] & uint32_t(1))) throw Exception("expected odd number for extent"); if (ext.size() != 1 && ext.size() != 3) throw Exception("unexpected number of elements specified in extent"); if (ext.size() == 1) - extent = vector(3, ext[0]); + extent = std::vector(3, ext[0]); else extent = ext; @@ -78,8 +78,8 @@ template class Median : public Base, ImageTy } protected: - vector extent; - vector values; + std::vector extent; + std::vector values; }; } // namespace Adapter diff --git a/core/adapter/neighbourhood3D.h b/core/adapter/neighbourhood3D.h index 3cbf6c1cf2..88fc7236d8 100644 --- a/core/adapter/neighbourhood3D.h +++ b/core/adapter/neighbourhood3D.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -67,7 +67,7 @@ template class NeighbourhoodCoord : public Base from_, size_; + std::vector from_, size_; Iterator iter_; transform_type transform_; }; diff --git a/core/adapter/normalise3D.h b/core/adapter/normalise3D.h index 853410c6da..95d5891562 100644 --- a/core/adapter/normalise3D.h +++ b/core/adapter/normalise3D.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -32,18 +32,18 @@ template class Normalise3D : public Base(1, 3)); } + Normalise3D(const ImageType &parent) : base_type(parent) { set_extent(std::vector(1, 3)); } - Normalise3D(const ImageType &parent, const vector &extent) : base_type(parent) { set_extent(extent); } + Normalise3D(const ImageType &parent, const std::vector &extent) : base_type(parent) { set_extent(extent); } - void set_extent(const vector &ext) { + void set_extent(const std::vector &ext) { for (size_t i = 0; i < ext.size(); ++i) if (!(ext[i] & uint32_t(1))) throw Exception("expected odd number for extent"); if (ext.size() != 1 && ext.size() != 3) throw Exception("unexpected number of elements specified in extent"); if (ext.size() == 1) - extent = vector(3, ext[0]); + extent = std::vector(3, ext[0]); else extent = ext; @@ -83,7 +83,7 @@ template class Normalise3D : public Base extent; + std::vector extent; value_type mean; value_type pos_value; size_t nelements; diff --git a/core/adapter/permute_axes.h b/core/adapter/permute_axes.h index 3ca845f61e..e3738dec97 100644 --- a/core/adapter/permute_axes.h +++ b/core/adapter/permute_axes.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -30,7 +30,7 @@ template class PermuteAxes : public Base &axes) : base_type(original), axes_(axes) { + PermuteAxes(const ImageType &original, const std::vector &axes) : base_type(original), axes_(axes) { for (int i = 0; i < static_cast(parent().ndim()); ++i) { for (size_t a = 0; a < axes_.size(); ++a) { if (axes_[a] >= int(parent().ndim())) @@ -75,8 +75,8 @@ template class PermuteAxes : public Base axes_; - vector non_existent_axes; + std::vector axes_; + std::vector non_existent_axes; }; } // namespace Adapter diff --git a/core/adapter/regrid.h b/core/adapter/regrid.h index f3b610d454..02a13ced74 100644 --- a/core/adapter/regrid.h +++ b/core/adapter/regrid.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -37,14 +37,14 @@ template class Regrid : public Base, ImageTy from_(container_cast(from)), size_(container_cast(size)), index_invalid_lower_upper([&] { - vector> v; + std::vector> v; for (size_t d = 0; d < from_.size(); ++d) { - v.push_back(vector{from_[d] < 0 ? -(ssize_t)from_[d] - 1 : -1, original.size(d) - from_[d]}); + v.push_back(std::vector{from_[d] < 0 ? -(ssize_t)from_[d] - 1 : -1, original.size(d) - from_[d]}); } return v; }()), index_requires_bound_check([&] { - vector v; + std::vector v; for (size_t d = 0; d < from_.size(); ++d) { v.push_back(from_[d] < 0 || size_[d] > original.size(d) - from_[d]); } @@ -101,12 +101,12 @@ template class Regrid : public Base, ImageTy protected: using base_type::parent; - const vector from_, size_; - const vector> index_invalid_lower_upper; - const vector index_requires_bound_check; + const std::vector from_, size_; + const std::vector> index_invalid_lower_upper; + const std::vector index_requires_bound_check; const value_type fill_; transform_type transform_; - vector index_; + std::vector index_; }; } // namespace Adapter diff --git a/core/adapter/replicate.h b/core/adapter/replicate.h index 1c29e9e2a2..7bf40ae7af 100644 --- a/core/adapter/replicate.h +++ b/core/adapter/replicate.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -59,7 +59,7 @@ template class Replicate : public Base, I protected: using base_type::parent; Header header_; - vector pos_; + std::vector pos_; }; } // namespace Adapter diff --git a/core/adapter/reslice.cpp b/core/adapter/reslice.cpp index 725756df94..5c79470c0c 100644 --- a/core/adapter/reslice.cpp +++ b/core/adapter/reslice.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -19,6 +19,6 @@ namespace MR { namespace Adapter { const transform_type NoTransform = transform_type::Identity(); -const vector AutoOverSample; +const std::vector AutoOverSample; } // namespace Adapter } // namespace MR diff --git a/core/adapter/reslice.h b/core/adapter/reslice.h index 7b791023fb..22f1dd91ad 100644 --- a/core/adapter/reslice.h +++ b/core/adapter/reslice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -52,7 +52,7 @@ typename std::enable_if::value, value_type>:: } // namespace extern const transform_type NoTransform; -extern const vector AutoOverSample; +extern const std::vector AutoOverSample; //! \addtogroup interp // @{ @@ -105,7 +105,7 @@ class Reslice : public ImageBase, typename Imag Reslice(const ImageType &original, const HeaderType &reference, const transform_type &transform = NoTransform, - const vector &oversample = AutoOverSample, + const std::vector &oversample = AutoOverSample, const value_type value_when_out_of_bounds = Interp::Base::default_out_of_bounds_value()) : interp(original, value_when_out_of_bounds), x{0, 0, 0}, diff --git a/core/adapter/subset.h b/core/adapter/subset.h index d4695df66f..13dc59c619 100644 --- a/core/adapter/subset.h +++ b/core/adapter/subset.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -64,7 +64,7 @@ template class Subset : public Base, ImageTy protected: using base_type::parent; - const vector from_, size_; + const std::vector from_, size_; transform_type transform_; }; diff --git a/core/adapter/warp.h b/core/adapter/warp.h index 0565f78bcb..a61a3f960d 100644 --- a/core/adapter/warp.h +++ b/core/adapter/warp.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/algo/copy.h b/core/algo/copy.h index c186354454..de3e0a7f31 100644 --- a/core/algo/copy.h +++ b/core/algo/copy.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/algo/histogram.cpp b/core/algo/histogram.cpp index e767ab2ae8..cac0137592 100644 --- a/core/algo/histogram.cpp +++ b/core/algo/histogram.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -42,7 +42,7 @@ void Calibrator::from_file(const std::string &path) { M = File::Matrix::load_matrix(path); if (M.cols() == 1) throw Exception("Histogram template must have at least 2 columns"); - vector().swap(data); + std::vector().swap(data); auto V = M.row(0); num_bins = V.size(); bin_width = (V[num_bins - 1] - V[0]) / default_type(num_bins - 1); @@ -68,7 +68,7 @@ void Calibrator::finalize(const size_t num_volumes, const bool is_integer) { // Need to adjust the bin width accordingly... kinda ugly hack // Will need to revisit if mrstats gets capability to compute statistics across all volumes rather than splitting bin_width = 2.0 * get_iqr() * std::pow(static_cast(data.size() / num_volumes), -1.0 / 3.0); - vector().swap(data); // No longer required; free the memory used + std::vector().swap(data); // No longer required; free the memory used // If the input data are integers, the bin width should also be an integer, to avoid getting // regular spike artifacts in the histogram if (is_integer) { diff --git a/core/algo/histogram.h b/core/algo/histogram.h index 0ddc4f325e..5499d9128b 100644 --- a/core/algo/histogram.h +++ b/core/algo/histogram.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -75,7 +75,7 @@ class Calibrator { default_type min, max, bin_width; size_t num_bins; const bool ignore_zero; - vector data; + std::vector data; default_type get_iqr(); }; diff --git a/core/algo/iterator.h b/core/algo/iterator.h index b926544664..09c04d1a75 100644 --- a/core/algo/iterator.h +++ b/core/algo/iterator.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -48,7 +48,7 @@ class Iterator { } private: - vector d, p; + std::vector d, p; void value() const { assert(0); } }; diff --git a/core/algo/loop.h b/core/algo/loop.h index 3427790345..37492225ea 100644 --- a/core/algo/loop.h +++ b/core/algo/loop.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -132,7 +132,7 @@ struct inc_pos { * following example: * \code * float value = 0.0; - * vector order = { 1, 0, 2 }; + * std::vector order = { 1, 0, 2 }; * * LoopInOrder loop (vox, order); * for (auto i = loop.run (vox); i; ++i) @@ -306,15 +306,15 @@ struct LoopAlongAxesProgress { }; struct LoopAlongDynamicAxes { - const vector axes; + const std::vector axes; template struct Run { - const vector axes; + const std::vector axes; const std::tuple vox; const size_t from; const ssize_t size0; bool ok; - FORCE_INLINE Run(const vector &axes, const std::tuple &vox) + FORCE_INLINE Run(const std::vector &axes, const std::tuple &vox) : axes(axes), vox(vox), from(axes[0]), size0(std::get<0>(vox).size(from)), ok(true) { for (auto axis : axes) MR::apply(set_pos(axis, 0), vox); @@ -345,12 +345,12 @@ struct LoopAlongDynamicAxes { struct LoopAlongDynamicAxesProgress : public LoopAlongDynamicAxes { const std::string text; - LoopAlongDynamicAxesProgress(const std::string &text, const vector &axes) + LoopAlongDynamicAxesProgress(const std::string &text, const std::vector &axes) : LoopAlongDynamicAxes({axes}), text(text) {} template struct Run : public LoopAlongDynamicAxes::Run { MR::ProgressBar progress; - FORCE_INLINE Run(const std::string &text, const vector &axes, const std::tuple &vox) + FORCE_INLINE Run(const std::string &text, const std::vector &axes, const std::tuple &vox) : LoopAlongDynamicAxes::Run(axes, vox), progress(text, MR::voxel_count(std::get<0>(vox), axes)) {} FORCE_INLINE void operator++() { LoopAlongDynamicAxes::Run::operator++(); @@ -380,9 +380,9 @@ FORCE_INLINE LoopAlongAxisRangeProgress Loop(const std::string &progress_message return {progress_message, axis_from, axis_to}; } -FORCE_INLINE LoopAlongDynamicAxes Loop(const vector &axes) { return {axes}; } +FORCE_INLINE LoopAlongDynamicAxes Loop(const std::vector &axes) { return {axes}; } -FORCE_INLINE LoopAlongDynamicAxesProgress Loop(const std::string &progress_message, const vector &axes) { +FORCE_INLINE LoopAlongDynamicAxesProgress Loop(const std::string &progress_message, const std::vector &axes) { return {progress_message, axes}; } diff --git a/core/algo/min_max.h b/core/algo/min_max.h index 6d62a1ce36..aa82c68754 100644 --- a/core/algo/min_max.h +++ b/core/algo/min_max.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/algo/neighbourhooditerator.h b/core/algo/neighbourhooditerator.h index ccb43bf243..53bfb4dcc9 100644 --- a/core/algo/neighbourhooditerator.h +++ b/core/algo/neighbourhooditerator.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -39,7 +39,7 @@ class NeighbourhoodIterator { public: NeighbourhoodIterator() = delete; template - NeighbourhoodIterator(const IteratorType &iter, const vector &extent) + NeighbourhoodIterator(const IteratorType &iter, const std::vector &extent) : dim(iter.ndim()), offset(iter.ndim()), // pos (iter.ndim()), @@ -105,7 +105,7 @@ class NeighbourhoodIterator { } private: - vector dim, offset, pos_orig, ext; + std::vector dim, offset, pos_orig, ext; Eigen::Matrix pos; bool has_next_; diff --git a/core/algo/random_loop.h b/core/algo/random_loop.h index ae6ecf18d2..854ca415fd 100644 --- a/core/algo/random_loop.h +++ b/core/algo/random_loop.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -70,9 +70,9 @@ template class Random_loop { ImageType ℑ RandomEngine &engine; size_t ax; - vector idx; - vector::iterator it; - vector::iterator stop; + std::vector idx; + std::vector::iterator it; + std::vector::iterator stop; size_t max_cnt; bool status; size_t cnt; diff --git a/core/algo/random_threaded_loop.h b/core/algo/random_threaded_loop.h index b9da6889d3..4d6434a08c 100644 --- a/core/algo/random_threaded_loop.h +++ b/core/algo/random_threaded_loop.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -32,19 +32,19 @@ namespace MR { namespace { template struct RandomThreadedLoopRunInner { - const vector &outer_axes; + const std::vector &outer_axes; decltype(Loop(outer_axes)) loop; typename std::remove_reference::type func; double density; Math::RNG::Uniform rng; - const vector dims; + const std::vector dims; std::tuple vox; - RandomThreadedLoopRunInner(const vector &outer_axes, - const vector &inner_axes, + RandomThreadedLoopRunInner(const std::vector &outer_axes, + const std::vector &inner_axes, const Functor &functor, const double voxel_density, - const vector dimensions, + const std::vector dimensions, ImageType &...voxels) : outer_axes(outer_axes), loop(Loop(inner_axes)), @@ -67,8 +67,8 @@ template struct RandomThreadedLoopRun }; template struct RandomThreadedLoopRunInner<0, Functor, ImageType...> { - const vector &outer_axes; - const vector inner; + const std::vector &outer_axes; + const std::vector inner; decltype(Loop(outer_axes)) loop; // Random_loop random_loop; typename std::remove_reference::type func; @@ -77,21 +77,21 @@ template struct RandomThreadedLoopRunInner<0 size_t cnt; // Math::RNG::Uniform rng; std::default_random_engine random_engine; - vector idx; - vector::iterator it; - vector::iterator stop; - const vector dims; + std::vector idx; + std::vector::iterator it; + std::vector::iterator stop; + const std::vector dims; // ImageType& image; // RandomEngine& engine; // size_t max_cnt; // bool status; // size_t cnt; - RandomThreadedLoopRunInner(const vector &outer_axes, - const vector &inner_axes, + RandomThreadedLoopRunInner(const std::vector &outer_axes, + const std::vector &inner_axes, const Functor &functor, const double voxel_density, - const vector &dimensions, + const std::vector &dimensions, ImageType &...voxels) : outer_axes(outer_axes), inner(inner_axes), @@ -105,7 +105,7 @@ template struct RandomThreadedLoopRunInner<0 Math::RNG rng; typename std::default_random_engine::result_type seed = rng.get_seed(); random_engine = std::default_random_engine{static_cast(seed)}; - idx = vector(dims[inner_axes[0]]); + idx = std::vector(dims[inner_axes[0]]); std::iota(std::begin(idx), std::end(idx), 0); } @@ -138,11 +138,11 @@ template struct RandomThreadedLoopRunInner<0 template struct RandomThreadedLoopRunOuter { Iterator iterator; OuterLoopType outer_loop; - vector inner_axes; + std::vector inner_axes; //! invoke \a functor (const Iterator& pos) per voxel in the outer axes only template - void run_outer(Functor &&functor, const double voxel_density, const vector &dimensions) { + void run_outer(Functor &&functor, const double voxel_density, const std::vector &dimensions) { if (Thread::threads_to_execute() == 0) { for (auto i = outer_loop(iterator); i; ++i) { // std::cerr << "outer: " << str(iterator) << " " << voxel_density << " " << dimensions << std::endl; @@ -181,7 +181,7 @@ template struct RandomThreadedLoopRunOuter { //! invoke \a functor (const Iterator& pos) per voxel in the outer axes only template - void run(Functor &&functor, const double voxel_density, vector dimensions, ImageType &&...vox) { + void run(Functor &&functor, const double voxel_density, std::vector dimensions, ImageType &&...vox) { RandomThreadedLoopRunInner::type, typename std::remove_reference::type...> @@ -193,19 +193,19 @@ template struct RandomThreadedLoopRunOuter { } // namespace template -inline RandomThreadedLoopRunOuter()))> -RandomThreadedLoop(const HeaderType &source, const vector &outer_axes, const vector &inner_axes) { +inline RandomThreadedLoopRunOuter()))> RandomThreadedLoop( + const HeaderType &source, const std::vector &outer_axes, const std::vector &inner_axes) { return {source, Loop(outer_axes), inner_axes}; } template -inline RandomThreadedLoopRunOuter()))> -RandomThreadedLoop(const HeaderType &source, const vector &axes, size_t num_inner_axes = 1) { +inline RandomThreadedLoopRunOuter()))> +RandomThreadedLoop(const HeaderType &source, const std::vector &axes, size_t num_inner_axes = 1) { return {source, Loop(get_outer_axes(axes, num_inner_axes)), get_inner_axes(axes, num_inner_axes)}; } template -inline RandomThreadedLoopRunOuter()))> +inline RandomThreadedLoopRunOuter()))> RandomThreadedLoop(const HeaderType &source, size_t from_axis = 0, size_t to_axis = std::numeric_limits::max(), @@ -216,25 +216,25 @@ RandomThreadedLoop(const HeaderType &source, } template -inline RandomThreadedLoopRunOuter()))> +inline RandomThreadedLoopRunOuter()))> RandomThreadedLoop(const std::string &progress_message, const HeaderType &source, - const vector &outer_axes, - const vector &inner_axes) { + const std::vector &outer_axes, + const std::vector &inner_axes) { return {source, Loop(progress_message, outer_axes), inner_axes}; } template -inline RandomThreadedLoopRunOuter()))> +inline RandomThreadedLoopRunOuter()))> RandomThreadedLoop(const std::string &progress_message, const HeaderType &source, - const vector &axes, + const std::vector &axes, size_t num_inner_axes = 1) { return {source, Loop(progress_message, get_outer_axes(axes, num_inner_axes)), get_inner_axes(axes, num_inner_axes)}; } template -inline RandomThreadedLoopRunOuter()))> +inline RandomThreadedLoopRunOuter()))> RandomThreadedLoop(const std::string &progress_message, const HeaderType &source, size_t from_axis = 0, diff --git a/core/algo/stochastic_threaded_loop.h b/core/algo/stochastic_threaded_loop.h index de6b39ae35..67bcf238b2 100644 --- a/core/algo/stochastic_threaded_loop.h +++ b/core/algo/stochastic_threaded_loop.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -30,15 +30,15 @@ namespace MR { namespace { template struct StochasticThreadedLoopRunInner { - const vector &outer_axes; + const std::vector &outer_axes; decltype(Loop(outer_axes)) loop; typename std::remove_reference::type func; double density; Math::RNG::Uniform rng; std::tuple vox; - StochasticThreadedLoopRunInner(const vector &outer_axes, - const vector &inner_axes, + StochasticThreadedLoopRunInner(const std::vector &outer_axes, + const std::vector &inner_axes, const Functor &functor, const double voxel_density, ImageType &...voxels) @@ -63,14 +63,14 @@ template struct StochasticThreadedLoo }; template struct StochasticThreadedLoopRunInner<0, Functor, ImageType...> { - const vector &outer_axes; + const std::vector &outer_axes; decltype(Loop(outer_axes)) loop; typename std::remove_reference::type func; double density; Math::RNG::Uniform rng; - StochasticThreadedLoopRunInner(const vector &outer_axes, - const vector &inner_axes, + StochasticThreadedLoopRunInner(const std::vector &outer_axes, + const std::vector &inner_axes, const Functor &functor, const double voxel_density, ImageType &...voxels) @@ -95,7 +95,7 @@ template struct StochasticThreadedLoopRunInn template struct StochasticThreadedLoopRunOuter { Iterator iterator; OuterLoopType outer_loop; - vector inner_axes; + std::vector inner_axes; //! invoke \a functor (const Iterator& pos) per voxel in the outer axes only template void run_outer(Functor &&functor, const double voxel_density) { @@ -149,19 +149,19 @@ template struct StochasticThreadedLoopRunOuter { } // namespace template -inline StochasticThreadedLoopRunOuter()))> -StochasticThreadedLoop(const HeaderType &source, const vector &outer_axes, const vector &inner_axes) { +inline StochasticThreadedLoopRunOuter()))> StochasticThreadedLoop( + const HeaderType &source, const std::vector &outer_axes, const std::vector &inner_axes) { return {source, Loop(outer_axes), inner_axes}; } template -inline StochasticThreadedLoopRunOuter()))> -StochasticThreadedLoop(const HeaderType &source, const vector &axes, size_t num_inner_axes = 1) { +inline StochasticThreadedLoopRunOuter()))> +StochasticThreadedLoop(const HeaderType &source, const std::vector &axes, size_t num_inner_axes = 1) { return {source, Loop(get_outer_axes(axes, num_inner_axes)), get_inner_axes(axes, num_inner_axes)}; } template -inline StochasticThreadedLoopRunOuter()))> +inline StochasticThreadedLoopRunOuter()))> StochasticThreadedLoop(const HeaderType &source, size_t from_axis = 0, size_t to_axis = std::numeric_limits::max(), @@ -172,25 +172,25 @@ StochasticThreadedLoop(const HeaderType &source, } template -inline StochasticThreadedLoopRunOuter()))> +inline StochasticThreadedLoopRunOuter()))> StochasticThreadedLoop(const std::string &progress_message, const HeaderType &source, - const vector &outer_axes, - const vector &inner_axes) { + const std::vector &outer_axes, + const std::vector &inner_axes) { return {source, Loop(progress_message, outer_axes), inner_axes}; } template -inline StochasticThreadedLoopRunOuter()))> +inline StochasticThreadedLoopRunOuter()))> StochasticThreadedLoop(const std::string &progress_message, const HeaderType &source, - const vector &axes, + const std::vector &axes, size_t num_inner_axes = 1) { return {source, Loop(progress_message, get_outer_axes(axes, num_inner_axes)), get_inner_axes(axes, num_inner_axes)}; } template -inline StochasticThreadedLoopRunOuter()))> +inline StochasticThreadedLoopRunOuter()))> StochasticThreadedLoop(const std::string &progress_message, const HeaderType &source, size_t from_axis = 0, diff --git a/core/algo/threaded_copy.h b/core/algo/threaded_copy.h index 60375e4af4..f1f2197097 100644 --- a/core/algo/threaded_copy.h +++ b/core/algo/threaded_copy.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -38,7 +38,7 @@ struct __copy_func { template inline void threaded_copy(InputImageType &source, OutputImageType &destination, - const vector &axes, + const std::vector &axes, size_t num_axes_in_thread = 1) { ThreadedLoop(source, axes, num_axes_in_thread).run(__copy_func(), source, destination); } @@ -56,7 +56,7 @@ template inline void threaded_copy_with_progress_message(const std::string &message, InputImageType &source, OutputImageType &destination, - const vector &axes, + const std::vector &axes, size_t num_axes_in_thread = 1) { ThreadedLoop(message, source, axes, num_axes_in_thread).run(__copy_func(), source, destination); } @@ -74,7 +74,7 @@ inline void threaded_copy_with_progress_message(const std::string &message, template inline void threaded_copy_with_progress(InputImageType &source, OutputImageType &destination, - const vector &axes, + const std::vector &axes, size_t num_axes_in_thread = 1) { threaded_copy_with_progress_message("copying from \"" + shorten(source.name()) + "\" to \"" + shorten(destination.name()) + "\"", diff --git a/core/algo/threaded_loop.h b/core/algo/threaded_loop.h index 4d54c68846..08e6fa5020 100644 --- a/core/algo/threaded_loop.h +++ b/core/algo/threaded_loop.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -239,34 +239,34 @@ namespace MR { namespace { -inline vector get_inner_axes(const vector &axes, size_t num_inner_axes) { +inline std::vector get_inner_axes(const std::vector &axes, size_t num_inner_axes) { return {axes.begin(), axes.begin() + num_inner_axes}; } -inline vector get_outer_axes(const vector &axes, size_t num_inner_axes) { +inline std::vector get_outer_axes(const std::vector &axes, size_t num_inner_axes) { return {axes.begin() + num_inner_axes, axes.end()}; } template -inline vector +inline std::vector get_inner_axes(const HeaderType &source, size_t num_inner_axes, size_t from_axis, size_t to_axis) { return get_inner_axes(Stride::order(source, from_axis, to_axis), num_inner_axes); } template -inline vector +inline std::vector get_outer_axes(const HeaderType &source, size_t num_inner_axes, size_t from_axis, size_t to_axis) { return get_outer_axes(Stride::order(source, from_axis, to_axis), num_inner_axes); } template struct ThreadedLoopRunInner { - const vector &outer_axes; + const std::vector &outer_axes; decltype(Loop(outer_axes)) loop; typename std::remove_reference::type func; std::tuple vox; - ThreadedLoopRunInner(const vector &outer_axes, - const vector &inner_axes, + ThreadedLoopRunInner(const std::vector &outer_axes, + const std::vector &inner_axes, const Functor &functor, ImageType &...voxels) : outer_axes(outer_axes), loop(Loop(inner_axes)), func(functor), vox(voxels...) {} @@ -279,12 +279,12 @@ template struct ThreadedLoopRunInner }; template struct ThreadedLoopRunInner<0, Functor, ImageType...> { - const vector &outer_axes; + const std::vector &outer_axes; decltype(Loop(outer_axes)) loop; typename std::remove_reference::type func; - ThreadedLoopRunInner(const vector &outer_axes, - const vector &inner_axes, + ThreadedLoopRunInner(const std::vector &outer_axes, + const std::vector &inner_axes, const Functor &functor, ImageType &.../*voxels*/) : outer_axes(outer_axes), loop(Loop(inner_axes)), func(functor) {} @@ -305,7 +305,7 @@ inline auto __manage_progress(const LoopType *loop, const ThreadType *threads) template struct ThreadedLoopRunOuter { Iterator iterator; OuterLoopType outer_loop; - vector inner_axes; + std::vector inner_axes; //! invoke \a functor (const Iterator& pos) per voxel in the outer axes only template void run_outer(Functor &&functor) { @@ -364,23 +364,23 @@ template struct ThreadedLoopRunOuter { //! Multi-threaded loop object //* \sa image_thread_looping for details */ template -inline ThreadedLoopRunOuter()))> -ThreadedLoop(const HeaderType &source, const vector &outer_axes, const vector &inner_axes) { +inline ThreadedLoopRunOuter()))> +ThreadedLoop(const HeaderType &source, const std::vector &outer_axes, const std::vector &inner_axes) { return {source, Loop(outer_axes), inner_axes}; } //! Multi-threaded loop object //* \sa image_thread_looping for details */ template -inline ThreadedLoopRunOuter()))> -ThreadedLoop(const HeaderType &source, const vector &axes, size_t num_inner_axes = 1) { +inline ThreadedLoopRunOuter()))> +ThreadedLoop(const HeaderType &source, const std::vector &axes, size_t num_inner_axes = 1) { return {source, Loop(get_outer_axes(axes, num_inner_axes)), get_inner_axes(axes, num_inner_axes)}; } //! Multi-threaded loop object //* \sa image_thread_looping for details */ template -inline ThreadedLoopRunOuter()))> +inline ThreadedLoopRunOuter()))> ThreadedLoop(const HeaderType &source, size_t from_axis = 0, size_t to_axis = std::numeric_limits::max(), @@ -393,27 +393,28 @@ ThreadedLoop(const HeaderType &source, //! Multi-threaded loop object //* \sa image_thread_looping for details */ template -inline ThreadedLoopRunOuter()))> ThreadedLoop(const std::string &progress_message, - const HeaderType &source, - const vector &outer_axes, - const vector &inner_axes) { +inline ThreadedLoopRunOuter()))> +ThreadedLoop(const std::string &progress_message, + const HeaderType &source, + const std::vector &outer_axes, + const std::vector &inner_axes) { return {source, Loop(progress_message, outer_axes), inner_axes}; } //! Multi-threaded loop object //* \sa image_thread_looping for details */ template -inline ThreadedLoopRunOuter()))> ThreadedLoop(const std::string &progress_message, - const HeaderType &source, - const vector &axes, - size_t num_inner_axes = 1) { +inline ThreadedLoopRunOuter()))> ThreadedLoop(const std::string &progress_message, + const HeaderType &source, + const std::vector &axes, + size_t num_inner_axes = 1) { return {source, Loop(progress_message, get_outer_axes(axes, num_inner_axes)), get_inner_axes(axes, num_inner_axes)}; } //! Multi-threaded loop object //* \sa image_thread_looping for details */ template -inline ThreadedLoopRunOuter()))> +inline ThreadedLoopRunOuter()))> ThreadedLoop(const std::string &progress_message, const HeaderType &source, size_t from_axis = 0, diff --git a/core/app.cpp b/core/app.cpp index 137313e4c1..ae94f2aa96 100644 --- a/core/app.cpp +++ b/core/app.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -72,7 +72,7 @@ OptionGroup __standard_options = Option("version", "display version information and exit."); const char *AUTHOR = nullptr; -const char *COPYRIGHT = "Copyright (c) 2008-2023 the MRtrix3 contributors.\n" +const char *COPYRIGHT = "Copyright (c) 2008-2024 the MRtrix3 contributors.\n" "\n" "This Source Code Form is subject to the terms of the Mozilla Public\n" "License, v. 2.0. If a copy of the MPL was not distributed with this\n" @@ -90,8 +90,8 @@ const char *SYNOPSIS = nullptr; std::string NAME; std::string command_history_string; -vector argument; -vector option; +std::vector argument; +std::vector option; // ENVVAR name: MRTRIX_QUIET // ENVVAR Do not display information messages or progress status. This has @@ -121,7 +121,7 @@ void (*check_overwrite_files_func)(const std::string &name) = nullptr; namespace { -inline void get_matches(vector &candidates, const OptionGroup &group, const std::string &stub) { +inline void get_matches(std::vector &candidates, const OptionGroup &group, const std::string &stub) { for (size_t i = 0; i < group.size(); ++i) { if (stub.compare(0, stub.size(), std::string(group[i].id), 0, stub.size()) == 0) candidates.push_back(&group[i]); @@ -139,11 +139,11 @@ std::string paragraph(const std::string &header, const std::string &text, int he if (size(line) < indent) resize(line, indent, ' '); - vector paragraphs = split(text, "\n"); + std::vector paragraphs = split(text, "\n"); for (size_t n = 0; n < paragraphs.size(); ++n) { size_t i = 0; - vector words = split(paragraphs[n]); + std::vector words = split(paragraphs[n]); while (i < words.size()) { do { line += " " + words[i++]; @@ -370,7 +370,7 @@ std::string OptionGroup::contents(int format) const { std::string OptionGroup::footer(int format) { return format ? "" : "\n"; } std::string OptionList::syntax(int format) const { - vector group_names; + std::vector group_names; for (size_t i = 0; i < size(); ++i) { if (std::find(group_names.begin(), group_names.end(), (*this)[i].name) == group_names.end()) group_names.push_back((*this)[i].name); @@ -606,7 +606,7 @@ std::string markdown_usage() { } } - vector group_names; + std::vector group_names; for (size_t i = 0; i < OPTIONS.size(); ++i) { if (std::find(group_names.begin(), group_names.end(), OPTIONS[i].name) == group_names.end()) group_names.push_back(OPTIONS[i].name); @@ -734,7 +734,7 @@ std::string restructured_text_usage() { } } - vector group_names; + std::vector group_names; for (size_t i = 0; i < OPTIONS.size(); ++i) { if (std::find(group_names.begin(), group_names.end(), OPTIONS[i].name) == group_names.end()) group_names.push_back(OPTIONS[i].name); @@ -795,7 +795,7 @@ const Option *match_option(const char *arg) { if (consume_dash(arg) && *arg && !isdigit(*arg) && *arg != '.') { while (consume_dash(arg)) ; - vector candidates; + std::vector candidates; std::string root(arg); for (size_t i = 0; i < OPTIONS.size(); ++i) @@ -944,7 +944,7 @@ void parse() { s += " " + std::string(a); e.push_back(s); if (argument.size() > num_args_required) { - vector potential_options; + std::vector potential_options; for (const auto &a : argument) { for (const auto &og : OPTIONS) { for (const auto &o : og) { @@ -1139,8 +1139,8 @@ void init(int cmdline_argc, const char *const *cmdline_argv) { srand(time(nullptr)); } -const vector get_options(const std::string &name) { - vector matches; +const std::vector get_options(const std::string &name) { + std::vector matches; for (size_t i = 0; i < option.size(); ++i) { assert(option[i].opt); if (option[i].opt->is(name)) diff --git a/core/app.h b/core/app.h index 79d2bb49c0..56f6422ccc 100644 --- a/core/app.h +++ b/core/app.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -65,7 +65,7 @@ std::string usage_syntax(int format); // @{ //! vector of strings to hold more comprehensive command description -class Description : public vector { +class Description : public std::vector { public: Description &operator+(const char *text) { push_back(text); @@ -93,7 +93,7 @@ class Example { }; //! a class to hold the list of Example's -class ExampleList : public vector { +class ExampleList : public std::vector { public: ExampleList &operator+(const Example &example) { push_back(example); @@ -104,7 +104,7 @@ class ExampleList : public vector { }; //! a class to hold the list of Argument's -class ArgumentList : public vector { +class ArgumentList : public std::vector { public: ArgumentList &operator+(const Argument &argument) { push_back(argument); @@ -115,7 +115,7 @@ class ArgumentList : public vector { }; //! a class to hold the list of option groups -class OptionList : public vector { +class OptionList : public std::vector { public: OptionList &operator+(const OptionGroup &option_group) { push_back(option_group); @@ -135,7 +135,7 @@ class OptionList : public vector { OptionGroup &back() { if (empty()) push_back(OptionGroup()); - return vector::back(); + return std::vector::back(); } std::string syntax(int format) const; @@ -184,34 +184,34 @@ class ParsedArgument { uint64_t as_uint() const { return uint64_t(as_int()); } default_type as_float() const; - vector as_sequence_int() const { + std::vector as_sequence_int() const { assert(arg->type == IntSeq); try { return parse_ints(p); } catch (Exception &e) { error(e); } - return vector(); + return std::vector(); } - vector as_sequence_uint() const { + std::vector as_sequence_uint() const { assert(arg->type == IntSeq); try { return parse_ints(p); } catch (Exception &e) { error(e); } - return vector(); + return std::vector(); } - vector as_sequence_float() const { + std::vector as_sequence_float() const { assert(arg->type == FloatSeq); try { return parse_floats(p); } catch (Exception &e) { error(e); } - return vector(); + return std::vector(); } operator bool() const { return as_bool(); } @@ -223,9 +223,9 @@ class ParsedArgument { operator long long unsigned int() const { return as_uint(); } operator float() const { return as_float(); } operator double() const { return as_float(); } - operator vector() const { return as_sequence_int(); } - operator vector() const { return as_sequence_uint(); } - operator vector() const { return as_sequence_float(); } + operator std::vector() const { return as_sequence_int(); } + operator std::vector() const { return as_sequence_uint(); } + operator std::vector() const { return as_sequence_float(); } const char *c_str() const { return p; } @@ -298,9 +298,9 @@ class ParsedOption { }; //! the list of arguments parsed from the command-line -extern vector argument; +extern std::vector argument; //! the list of options parsed from the command-line -extern vector option; +extern std::vector option; //! additional description of the command over and above the synopsis /*! This is designed to be used within each command's usage() function. Add @@ -409,11 +409,11 @@ extern OptionGroup __standard_options; * std::string arg1 = opt[0][0]; * int arg2 = opt[0][1]; * float arg3 = opt[0][2]; - * vector arg4 = opt[0][3]; + * std::vector arg4 = opt[0][3]; * auto values = opt[0][4].as_sequence_float(); * } * \endcode */ -const vector get_options(const std::string &name); +const std::vector get_options(const std::string &name); //! Returns the option value if set, and the default otherwise. /*! Only be used for command-line options that do not specify diff --git a/core/apply.h b/core/apply.h index fb859675c6..5494995b93 100644 --- a/core/apply.h +++ b/core/apply.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/axes.cpp b/core/axes.cpp index ad4a151b2c..85598bc9be 100644 --- a/core/axes.cpp +++ b/core/axes.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/axes.h b/core/axes.h index 57832456ee..89ac05a6e2 100644 --- a/core/axes.h +++ b/core/axes.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/core/cmdline_option.h b/core/cmdline_option.h index 0b445e72b6..51718042f9 100644 --- a/core/cmdline_option.h +++ b/core/cmdline_option.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008-2023 the MRtrix3 contributors. +/* Copyright (c) 2008-2024 the MRtrix3 contributors. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -326,7 +326,7 @@ class Argument { * Options can also be specified as required (see required() function), or * as multiple (see allow_multiple() function). */ -class Option : public vector { +class Option : public std::vector { public: Option() : id(nullptr), flags(Optional) {} @@ -391,7 +391,7 @@ class Option : public vector { * } * \endcode */ -class OptionGroup : public vector