Developer documentation
Version 3.0.3-105-gd3941f44
shared.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_shared_h__
18#define __dwi_tractography_act_shared_h__
19
20#include "memory.h"
22
23
24namespace MR
25{
26 namespace DWI
27 {
28 namespace Tractography
29 {
30 namespace ACT
31 {
32
33
35
36 public:
37 ACT_Shared_additions (const std::string& path, Properties& property_set) :
38 voxel (Image<float>::open (path)),
39 bt (false)
40 {
41 verify_5TT_image (voxel);
42 property_set.set (bt, "backtrack");
43 if (property_set.find ("crop_at_gmwmi") != property_set.end())
44 gmwmi_finder.reset (new GMWMI_finder (voxel));
45 }
46
47
48 bool backtrack() const { return bt; }
49
50 bool crop_at_gmwmi() const { return bool (gmwmi_finder); }
51 void crop_at_gmwmi (vector<Eigen::Vector3f>& tck) const
52 {
53 assert (gmwmi_finder);
54 tck.back() = gmwmi_finder->find_interface (tck, true);
55 }
56
57
58 private:
59 Image<float> voxel;
60 bool bt;
61
62 std::unique_ptr<GMWMI_finder> gmwmi_finder;
63
64
65 protected:
67
68 };
69
70
71 }
72 }
73 }
74}
75
76#endif
functions and classes related to image data input/output
Definition: image.h:41
void verify_5TT_image(const Header &)
Definition: base.h:24