Developer documentation
Version 3.0.3-105-gd3941f44
mapped_track.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_connectome_mapped_track_h__
18#define __dwi_tractography_connectome_mapped_track_h__
19
21
22
23namespace MR {
24 namespace DWI {
25 namespace Tractography {
26 namespace Connectome {
27
28
29
31 { MEMALIGN(Mapped_track_base)
32
33 public:
35 track_index (-1),
36 factor (0.0),
37 weight (1.0) { }
38
39 void set_track_index (const size_t i) { track_index = i; }
40 void set_factor (const float i) { factor = i; }
41 void set_weight (const float i) { weight = i; }
42
43 size_t get_track_index() const { return track_index; }
44 float get_factor() const { return factor; }
45 float get_weight() const { return weight; }
46
47 private:
48 size_t track_index;
49 float factor, weight;
50 };
51
52
54 { MEMALIGN(Mapped_track_nodepair)
55
56 public:
59 nodes (std::make_pair (0, 0)) { }
60
61 void set_first_node (const node_t i) { nodes.first = i; }
62 void set_second_node (const node_t i) { nodes.second = i; }
63 void set_nodes (const NodePair i) { nodes = i; }
64
65 node_t get_first_node() const { return nodes.first; }
66 node_t get_second_node() const { return nodes.second; }
67 const NodePair& get_nodes() const { return nodes; }
68
69 private:
70 NodePair nodes;
71
72 };
73
74
76 { MEMALIGN(Mapped_track_nodelist)
77
78 public:
81 nodes () { }
82
83 void add_node (const node_t i) { nodes.push_back (i); }
84 void set_nodes (const vector<node_t>& i) { nodes = i; }
85 void set_nodes (vector<node_t>&& i) { std::swap (nodes, i); }
86
87 const vector<node_t>& get_nodes() const { return nodes; }
88
89 private:
90 vector<node_t> nodes;
91
92 };
93
94
95
96
97 }
98 }
99 }
100}
101
102
103#endif
104
std::enable_if< std::is_fundamental< ValueType >::value &&sizeof(ValueType)==1, ValueType >::type swap(ValueType v)
Definition: raw.h:49
std::pair< node_t, node_t > NodePair
Definition: connectome.h:41
MR::Connectome::node_t node_t
Definition: connectome.h:40
Definition: base.h:24