Developer documentation
Version 3.0.3-105-gd3941f44
line_search.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_sift2_line_search_h__
18
#define __dwi_tractography_sift2_line_search_h__
19
20
21
#include "
types.h
"
22
23
#include "
dwi/tractography/SIFT/track_contribution.h
"
24
#include "
dwi/tractography/SIFT/types.h
"
25
26
27
28
namespace
MR
{
29
namespace
DWI {
30
namespace
Tractography {
31
namespace
SIFT2 {
32
33
34
35
class
TckFactor;
36
37
38
39
// New line search functor for when per-streamline projections and per-fixel correlation terms are not calculated
40
// Instead, the correlation term for the line search is derived using the TD fraction only
41
class
LineSearchFunctor
42
{
MEMALIGN
(
LineSearchFunctor
)
43
44
public
:
45
46
class
Result
47
{
NOMEMALIGN
48
public
:
49
Result() : cost (0.0), first_deriv (0.0), second_deriv (0.0), third_deriv (0.0) { }
50
Result&
operator+=
(
const
Result& that) { cost += that.cost; first_deriv += that.first_deriv; second_deriv += that.second_deriv; third_deriv += that.third_deriv;
return
*
this
; }
51
Result& operator*= (
const
double
i) { cost *= i; first_deriv *= i; second_deriv *= i; third_deriv *= i;
return
*
this
; }
52
double
cost, first_deriv, second_deriv, third_deriv;
53
bool
valid()
const
{
return
std::isfinite(cost) && std::isfinite(first_deriv) && std::isfinite(second_deriv) && std::isfinite(third_deriv); }
54
};
55
56
LineSearchFunctor
(
const
SIFT::track_t
,
const
TckFactor
&);
57
58
59
// Interfaces for line searches
60
Result get (
const
double
)
const
;
61
double
operator() (
const
double
)
const
;
62
63
64
protected
:
65
66
// Necessary information for those fixels traversed by this streamline
67
class
Fixel
68
{
NOMEMALIGN
69
public
:
70
Fixel
(
const
SIFT::Track_fixel_contribution
&,
const
TckFactor
&,
const
double
,
const
double
);
71
//void set_damping (const double i) { dTD_dFs *= i; }
72
uint32_t
index
;
73
double
length
,
PM
,
TD
,
cost_frac
,
SL_eff
,
dTD_dFs
,
meanFs
,
expmeanFs
,
FOD
;
74
};
75
76
77
const
SIFT::track_t
track_index
;
78
const
double
mu
;
79
const
double
Fs
;
80
const
double
reg_tik
,
reg_tv
;
81
82
vector<Fixel>
fixels
;
83
84
};
85
86
87
88
89
90
}
91
}
92
}
93
}
94
95
96
#endif
97
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel
Definition:
line_search.h:68
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::length
double length
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::dTD_dFs
double dTD_dFs
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::Fixel
Fixel(const SIFT::Track_fixel_contribution &, const TckFactor &, const double, const double)
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::FOD
double FOD
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::index
uint32_t index
Definition:
line_search.h:72
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::TD
double TD
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::meanFs
double meanFs
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::PM
double PM
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::SL_eff
double SL_eff
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::cost_frac
double cost_frac
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fixel::expmeanFs
double expmeanFs
Definition:
line_search.h:73
MR::DWI::Tractography::SIFT2::LineSearchFunctor
Definition:
line_search.h:42
MR::DWI::Tractography::SIFT2::LineSearchFunctor::reg_tik
const double reg_tik
Definition:
line_search.h:80
MR::DWI::Tractography::SIFT2::LineSearchFunctor::reg_tv
const double reg_tv
Definition:
line_search.h:80
MR::DWI::Tractography::SIFT2::LineSearchFunctor::fixels
vector< Fixel > fixels
Definition:
line_search.h:82
MR::DWI::Tractography::SIFT2::LineSearchFunctor::Fs
const double Fs
Definition:
line_search.h:79
MR::DWI::Tractography::SIFT2::LineSearchFunctor::track_index
const SIFT::track_t track_index
Definition:
line_search.h:77
MR::DWI::Tractography::SIFT2::LineSearchFunctor::mu
const double mu
Definition:
line_search.h:78
MR::DWI::Tractography::SIFT2::TckFactor
Definition:
tckfactor.h:60
MR::DWI::Tractography::SIFT::Track_fixel_contribution
Definition:
track_contribution.h:42
MR::vector< Fixel >
operator+=
Derived & operator+=(const MR::Helper::ConstRow< ImageType > &row)
Definition:
dense_base.h:28
NOMEMALIGN
#define NOMEMALIGN
Definition:
memory.h:22
MR::DWI::Tractography::SIFT::track_t
unsigned int track_t
Definition:
types.h:34
MR
Definition:
base.h:24
types.h
types.h
MEMALIGN
#define MEMALIGN(...)
Definition:
types.h:185
track_contribution.h
src
dwi
tractography
SIFT2
line_search.h
Generated on Mon Jul 4 2022 08:00:07 for MRtrix by
1.9.3