Developer documentation
Version 3.0.3-105-gd3941f44
linear_base.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
18#ifndef __registration_metric_linear_base_h__
19#define __registration_metric_linear_base_h__
20
21namespace MR
22{
23 namespace Registration
24 {
25 namespace Metric
26 {
27
28 class LinearBase { MEMALIGN(LinearBase)
29
30 public:
31 LinearBase ( ) : weighted (false) {}
32
38 template <class ParamType>
39 default_type precompute (ParamType& parameters) { assert (0 && "FIXME: requires_precompute defined but precompute not implemented for this metric."); return 0.; }
40
44 template <class Im1Type = Image<default_type>, class Im2Type = Image<default_type>>
45 void init (const Im1Type& im1, const Im2Type& im2) { assert (0 && "FIXME: requires_initialisation defined but init not implemented for this metric."); }
46
51 // set contrast weights for 4D metrics
52 void set_weights (Eigen::VectorXd weights) {
53 mc_weights = weights;
54 weighted = mc_weights.rows() > 0;
55 }
56
57 template <class Params>
58 default_type operator() (Params& params,
59 const Eigen::Vector3d& im1_point,
60 const Eigen::Vector3d& im2_point,
61 const Eigen::Vector3d& midway_point,
62 Eigen::Matrix<default_type, Eigen::Dynamic, 1>& gradient);
63
64 protected:
65 Eigen::VectorXd mc_weights;
67 };
68
69 }
70 }
71}
72#endif
Definition: base.h:24
double default_type
the default type used throughout MRtrix
Definition: types.h:228