Developer documentation
Version 3.0.3-105-gd3941f44
properties.h
Go to the documentation of this file.
1/* Copyright (c) 2008-2022 the MRtrix3 contributors.
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 *
7 * Covered Software is provided under this License on an "as is"
8 * basis, without warranty of any kind, either expressed, implied, or
9 * statutory, including, without limitation, warranties that the
10 * Covered Software is free of defects, merchantable, fit for a
11 * particular purpose or non-infringing.
12 * See the Mozilla Public License v. 2.0 for more details.
13 *
14 * For more details, see http://www.mrtrix.org/.
15 */
16
17#ifndef __dwi_tractography_properties_h__
18#define __dwi_tractography_properties_h__
19
20#include <map>
21#include "app.h"
22#include "timer.h"
23#include "types.h"
26
27
28#define TRACTOGRAPHY_FILE_TIMESTAMP_PRECISION 20
29
30
31namespace MR
32{
33 namespace DWI
34 {
35 namespace Tractography
36 {
37
38
39
40 void check_timestamps (const Properties&, const Properties&, const std::string&);
41 void check_counts (const Properties&, const Properties&, const std::string&, bool abort_on_fail);
42
43
44
45 class Properties : public KeyValues { MEMALIGN(Properties)
46 public:
47
48 Properties () {
49 set_timestamp();
50 }
51
52 void set_timestamp();
53 void set_version_info();
54 void update_command_history();
55 void clear();
56
57 template <typename T> void set (T& variable, const std::string& name) {
58 if ((*this)[name].empty()) (*this)[name] = str (variable);
59 else variable = to<T> ((*this)[name]);
60 }
61
62 float get_stepsize() const;
63 void compare_stepsize_rois() const;
64
65 // In use at time of execution
66 ROIUnorderedSet include, exclude, mask;
67 ROIOrderedSet ordered_include;
68 Seeding::List seeds;
69
70 // As stored within the header of an existing .tck file
71 std::multimap<std::string, std::string> prior_rois;
72
73 vector<std::string> comments;
74
75 friend std::ostream& operator<< (std::ostream& stream, const Properties& P);
76 };
77
78
79
80 }
81 }
82}
83
84#endif
friend std::ostream & operator<<(std::ostream &stream, const Properties &P)
void check_counts(const Properties &, const Properties &, const std::string &, bool abort_on_fail)
void check_timestamps(const Properties &, const Properties &, const std::string &)
Definition: base.h:24
std::map< std::string, std::string > KeyValues
used in various places for storing key-value pairs
Definition: types.h:238
std::string str(const T &value, int precision=0)
Definition: mrtrix.h:247
const std::string name
Definition: thread.h:108