Developer documentation
Version 3.0.3-105-gd3941f44
gmwmi.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_act_gmwmi_h__
18#define __dwi_tractography_act_gmwmi_h__
19
20
21#include "image.h"
22#include "interp/linear.h"
23#include "math/hermite.h"
26
27
28#define GMWMI_PERTURBATION 0.001 // in mm
29#define GMWMI_MAX_ITERS_TO_FIND_BOUNDARY 10
30#define GMWMI_HERMITE_TENSION 0.1
31
32
33
34namespace MR
35{
36 namespace DWI
37 {
38 namespace Tractography
39 {
40
41 namespace Seeding
42 {
44 }
45
46 namespace ACT
47 {
48
49
52
53 protected:
54 using Interp = Interp::Linear<Image<float>>;
55
56 public:
57 GMWMI_finder (const Image<float>& buffer) :
58 interp_template (buffer),
59 min_vox (std::min (buffer.spacing(0), std::min (buffer.spacing(1), buffer.spacing(2)))) { }
60
61 GMWMI_finder (const Interp& interp) :
62 interp_template (interp),
63 min_vox (std::min (interp.spacing(0), std::min (interp.spacing(1), interp.spacing(2)))) { }
64
65 GMWMI_finder (const GMWMI_finder& that) :
67 min_vox (that.min_vox) { }
68
69
70 bool find_interface (Eigen::Vector3f&) const;
71 Eigen::Vector3f normal (const Eigen::Vector3f&) const;
72
73
74 Eigen::Vector3f find_interface (const vector<Eigen::Vector3f>&, const bool) const;
76
77
78 protected:
79 const Interp interp_template;
80 const float min_vox;
81
82
83 Tissues get_tissues (const Eigen::Vector3f& p, Interp& interp) const {
84 if (!interp.scanner (p))
85 return Tissues ();
86 return Tissues (interp);
87 }
88
89 bool find_interface (Eigen::Vector3f&, Interp&) const;
90 Eigen::Vector3f get_normal (const Eigen::Vector3f&, Interp&) const;
91 Eigen::Vector3f get_cf_min_step (const Eigen::Vector3f&, Interp&) const;
92
93 Eigen::Vector3f find_interface (const vector<Eigen::Vector3f>&, const bool, Interp&) const;
94
95
96 friend class Track_extender;
98
99 };
100
101
102
103 }
104 }
105 }
106}
107
108#endif
Eigen::Vector3f find_interface(const vector< Eigen::Vector3f > &, const bool, Interp &) const
Eigen::Vector3f normal(const Eigen::Vector3f &) const
GMWMI_finder(const Interp &interp)
Definition: gmwmi.h:61
Eigen::Vector3f find_interface(const vector< Eigen::Vector3f > &, const bool) const
bool find_interface(Eigen::Vector3f &, Interp &) const
Eigen::Vector3f get_normal(const Eigen::Vector3f &, Interp &) const
GMWMI_finder(const Image< float > &buffer)
Definition: gmwmi.h:57
Eigen::Vector3f get_cf_min_step(const Eigen::Vector3f &, Interp &) const
Tissues get_tissues(const Eigen::Vector3f &p, Interp &interp) const
Definition: gmwmi.h:83
void crop_track(vector< Eigen::Vector3f > &) const
GMWMI_finder(const GMWMI_finder &that)
Definition: gmwmi.h:65
bool find_interface(Eigen::Vector3f &) const
Definition: base.h:24
Definition: types.h:303
#define MEMALIGN(...)
Definition: types.h:185