Developer documentation
Version 3.0.3-105-gd3941f44
early_exit.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_tracking_early_exit_h__
18#define __dwi_tractography_tracking_early_exit_h__
19
20#include <Eigen/Core>
21
22#if EIGEN_VERSION_AT_LEAST(3,3,0)
23#define TCKGEN_EARLY_EXIT_USE_FULL_BINOMIAL
24#include <unsupported/Eigen/SpecialFunctions>
25#define TCKGEN_EARLY_EXIT_PROB_THRESHOLD 0.001
26#else
27#define TCKGEN_EARLY_EXIT_PROB_THRESHOLD 1e-6
28#define TCKGEN_EARLY_EXIT_ZVALUE -4.753408 // For a p-value of 1e-6; should be negative
29#endif
30
32
33
34#define TCKGEN_EARLY_EXIT_STOP_TESTING_PERCENTAGE 0.20
35
36
37namespace MR
38{
39 namespace DWI
40 {
41 namespace Tractography
42 {
43 namespace Tracking
44 {
45
46
49 public:
50 EarlyExit (const SharedBase& shared) :
51 max_num_seeds (shared.max_num_seeds),
52 max_num_tracks (shared.max_num_tracks),
53 counter (0),
54 next_test ((max_num_seeds && max_num_tracks) ? (10 * max_num_seeds / max_num_tracks) : 0) { }
55
56 bool operator() (const size_t, const size_t);
57
58 private:
59 const size_t max_num_seeds, max_num_tracks;
60 size_t counter, next_test;
61 };
62
63
64
65 }
66 }
67 }
68}
69
70#endif
71
72
bool operator()(const size_t, const size_t)
EarlyExit(const SharedBase &shared)
Definition: early_exit.h:50
#define NOMEMALIGN
Definition: memory.h:22
Definition: base.h:24