Developer documentation
Version 3.0.3-105-gd3941f44
enhance.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_enhance_h__
18#define __stats_enhance_h__
19
20#include "math/stats/typedefs.h"
21
22namespace MR
23{
24 namespace Stats
25 {
26
27
28
29 // This class defines the standardised interface by which statistical enhancement
30 // is performed.
33 public:
34 virtual ~EnhancerBase() { }
35
36 // Perform statistical enhancement once for each column in the matrix
37 // (correspond to different contrasts)
38 void operator() (const Math::Stats::matrix_type& input_statistics,
39 Math::Stats::matrix_type& enhanced_statistics) const
40 {
41 for (ssize_t col = 0; col != input_statistics.cols(); ++col)
42 (*this) (input_statistics.col (col), enhanced_statistics.col (col));
43 }
44
45 protected:
46 typedef Math::Stats::matrix_type::ConstColXpr in_column_type;
47 typedef Math::Stats::matrix_type::ColXpr out_column_type;
48 // Derived classes should override this function
49 virtual void operator() (in_column_type, out_column_type) const = 0;
50
51 };
52
53
54
55 }
56}
57
58#endif
virtual ~EnhancerBase()
Definition: enhance.h:34
Math::Stats::matrix_type::ConstColXpr in_column_type
Definition: enhance.h:46
void operator()(const Math::Stats::matrix_type &input_statistics, Math::Stats::matrix_type &enhanced_statistics) const
Definition: enhance.h:38
Math::Stats::matrix_type::ColXpr out_column_type
Definition: enhance.h:47
#define NOMEMALIGN
Definition: memory.h:22
Eigen::Matrix< value_type, Eigen::Dynamic, Eigen::Dynamic > matrix_type
Definition: typedefs.h:34
Definition: base.h:24