Developer documentation
Version 3.0.3-105-gd3941f44
list.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_seeding_list_h__
18
#define __dwi_tractography_seeding_list_h__
19
20
21
#include "types.h"
22
23
#include "
dwi/tractography/seeding/base.h
"
24
25
26
namespace
MR
27
{
28
namespace
DWI
29
{
30
namespace
Tractography
31
{
32
namespace
Seeding
33
{
34
35
36
37
38
class
List
39
{ MEMALIGN(
List
)
40
41
public
:
42
List
() :
43
total_volume (0.0),
44
total_count (0) { }
45
46
List
(
const
List
&) =
delete
;
47
48
49
void
add (
Base
*
const
in);
50
void
clear();
51
bool
get_seed (Eigen::Vector3f& p, Eigen::Vector3f& d);
52
53
54
size_t
num_seeds()
const
{
return
seeders.size(); }
55
const
Base
* operator[] (
const
size_t
n)
const
{
return
seeders[n].get(); }
56
bool
is_finite()
const
{
return
total_count; }
57
uint32_t get_total_count()
const
{
return
total_count; }
58
59
60
friend
inline
std::ostream&
operator<<
(std::ostream& stream,
const
List
&
S
) {
61
if
(
S
.seeders.empty())
62
return
stream;
63
auto
i =
S
.seeders.cbegin();
64
stream << **i;
65
for
(++i; i !=
S
.seeders.cend(); ++i)
66
stream <<
", "
<< **i;
67
return
(stream);
68
}
69
70
71
private
:
72
vector<std::unique_ptr<Base>
> seeders;
73
float
total_volume;
74
uint32_t total_count;
75
76
};
77
78
79
80
81
82
}
83
}
84
}
85
}
86
87
#endif
88
MR::DWI::Tractography::Seeding::Base
Definition:
base.h:97
MR::DWI::Tractography::Seeding::List
Definition:
list.h:39
MR::DWI::Tractography::Seeding::List::operator<<
friend std::ostream & operator<<(std::ostream &stream, const List &S)
Definition:
list.h:60
MR::vector
Definition:
types.h:253
MR
Definition:
base.h:24
S
Eigen::MatrixXd S
Definition:
noise_estimator.h:65
base.h
src
dwi
tractography
seeding
list.h
Generated on Mon Jul 4 2022 08:00:06 for MRtrix by
1.9.3