Developer documentation
Version 3.0.3-105-gd3941f44
fixel.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_sift_fixel_h__
18#define __dwi_tractography_sift_fixel_h__
19
20
21#include "dwi/fmls.h"
22
24
25
26namespace MR
27{
28 namespace DWI
29 {
30 namespace Tractography
31 {
32 namespace SIFT
33 {
34
35
36 class Fixel : public FixelBase
37 { MEMALIGN(Fixel)
38
39 public:
40 Fixel () :
41 FixelBase () { }
42
43 Fixel (const FMLS::FOD_lobe& lobe) :
44 FixelBase (lobe) { }
45
46 Fixel (const Fixel& that) :
47 FixelBase (that) { }
48
49
50 Fixel& operator-= (const double length) { TD = std::max (TD - length, 0.0); return *this; }
51
52 double get_d_cost_d_mu (const double mu) const { return get_d_cost_d_mu_unweighted (mu) * weight; }
53 double get_cost_wo_track (const double mu, const double length) const { return get_cost_wo_track_unweighted (mu, length) * weight; }
54 double get_cost_manual_TD (const double mu, const double manual_TD) const { return get_cost_manual_TD_unweighted (mu, manual_TD) * weight; }
55 double calc_quantisation (const double mu, const double length) const { return get_cost_manual_TD (mu, (FOD/mu) + length); }
56
57
58 private:
59 double get_d_cost_d_mu_unweighted (const double mu) const { return (2.0 * TD * get_diff (mu)); }
60 double get_cost_wo_track_unweighted (const double mu, const double length) const { return (Math::pow2 ((std::max (TD-length, 0.0) * mu) - FOD)); }
61 double get_cost_manual_TD_unweighted (const double mu, const double manual_TD) const { return Math::pow2 (( manual_TD * mu) - FOD); }
62
63 };
64
65
66
67
68
69 }
70 }
71 }
72}
73
74
75#endif
76
77
constexpr T pow2(const T &v)
Definition: math.h:53
PointType::Scalar length(const vector< PointType > &tck)
Definition: streamline.h:134
Definition: base.h:24