Developer documentation
Version 3.0.3-105-gd3941f44
tfce.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 __stats_tfce_h__
18#define __stats_tfce_h__
19
20#include "thread_queue.h"
22#include "math/stats/typedefs.h"
23
24#include "stats/enhance.h"
25
26namespace MR
27{
28 namespace Stats
29 {
30 namespace TFCE
31 {
32
33
34
36
37
38
41
42
43
45 { MEMALIGN (EnhancerBase)
46 public:
47 virtual ~EnhancerBase() { }
48 protected:
49 // Alternative functor that also takes the threshold value;
50 // makes TFCE integration cleaner
51 virtual void operator() (in_column_type /*input_statistics*/, const value_type /*threshold*/, out_column_type /*enhanced_statistics*/) const = 0;
52 friend class Wrapper;
53 };
54
55
56
57
59 { MEMALIGN (Wrapper)
60 public:
61 Wrapper (const std::shared_ptr<TFCE::EnhancerBase> base) : enhancer (base), dH (NaN), E (NaN), H (NaN) { }
62 Wrapper (const std::shared_ptr<TFCE::EnhancerBase> base, const default_type dh, const default_type e, const default_type h) : enhancer (base), dH (dh), E (e), H (h) { }
63 Wrapper (const Wrapper& that) = default;
64 virtual ~Wrapper() { }
65
66 void set_tfce_parameters (const value_type d_height, const value_type extent, const value_type height)
67 {
68 dH = d_height;
69 E = extent;
70 H = height;
71 }
72
73 private:
74 std::shared_ptr<Stats::TFCE::EnhancerBase> enhancer;
75 value_type dH, E, H;
76
77 void operator() (in_column_type, out_column_type) const override;
78 };
79
80
81
82 }
83 }
84}
85
86#endif
a class to hold a named list of Option's
virtual ~EnhancerBase()
Definition: enhance.h:34
Math::Stats::matrix_type::ConstColXpr in_column_type
Definition: enhance.h:46
Math::Stats::matrix_type::ColXpr out_column_type
Definition: enhance.h:47
virtual void operator()(in_column_type, const value_type, out_column_type) const =0
constexpr double e
Definition: math.h:39
MR::default_type value_type
Definition: typedefs.h:33
Eigen::Matrix< value_type, Eigen::Dynamic, Eigen::Dynamic > matrix_type
Definition: typedefs.h:34
const App::OptionGroup Options(const default_type, const default_type, const default_type)
Math::Stats::value_type value_type
Definition: tfce.h:39
Math::Stats::matrix_type matrix_type
Definition: tfce.h:40
Definition: base.h:24
double default_type
the default type used throughout MRtrix
Definition: types.h:228
constexpr default_type NaN
Definition: types.h:230