-
Notifications
You must be signed in to change notification settings - Fork 177
/
worker.h
96 lines (71 loc) · 2.53 KB
/
worker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* Copyright (c) 2008-2016 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
* file, You can obtain one at http://mozilla.org/MPL/2.0/
*
* MRtrix is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* For more details, see www.mrtrix.org
*
*/
#ifndef __dwi_tractography_editing_worker_h__
#define __dwi_tractography_editing_worker_h__
#include <string>
#include <vector>
#include "dwi/tractography/properties.h"
#include "dwi/tractography/resample.h"
#include "dwi/tractography/streamline.h"
namespace MR {
namespace DWI {
namespace Tractography {
namespace Editing {
class Worker
{
public:
Worker (Tractography::Properties& p, const size_t upsample_ratio, const size_t downsample_ratio, const float step_size, const bool inv, const bool end) :
properties (p),
upsampler (upsample_ratio),
downsampler (downsample_ratio),
resampler (step_size),
inverse (inv),
ends_only (end),
thresholds (p),
include_visited (properties.include.size(), false) { }
Worker (const Worker& that) :
properties (that.properties),
upsampler (that.upsampler),
downsampler (that.downsampler),
resampler (that.resampler),
inverse (that.inverse),
ends_only (that.ends_only),
thresholds (that.thresholds),
include_visited (properties.include.size(), false) { }
bool operator() (const Streamline<>&, Streamline<>&) const;
private:
const Tractography::Properties& properties;
Upsampler upsampler;
Downsampler downsampler;
Resampler resampler;
const bool inverse, ends_only;
class Thresholds
{
public:
Thresholds (Tractography::Properties&);
Thresholds (const Thresholds&);
bool operator() (const Streamline<>&) const;
private:
float max_length, min_length;
float max_weight, min_weight;
float step_size;
} thresholds;
mutable std::vector<bool> include_visited;
};
}
}
}
}
#endif