My Project
regmodel.hh
Go to the documentation of this file.
1/* -*- mia-c++ -*-
2 *
3 * This file is part of MIA - a toolbox for medical image analysis
4 * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5 *
6 * MIA is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef mia_core_regmodel_hh
22#define mia_core_regmodel_hh
23
24#include <mia/core/factory.hh>
25
27
29 static const char *type_descr;
30};
31
37template <int Dim>
38struct RegistrationTraits {
39 typedef void need_to_declare_RegistrationTraits_for_DIM;
40 typedef need_to_declare_RegistrationTraits_for_DIM Data;
41 typedef need_to_declare_RegistrationTraits_for_DIM Force;
42 typedef need_to_declare_RegistrationTraits_for_DIM Transformation;
43};
45
54template <int Dim>
55class TRegModel : public CProductBase
56{
57public:
59 typedef typename RegistrationTraits<Dim>::Data Data;
60
62 typedef typename RegistrationTraits<Dim>::Force Force;
63
65 typedef typename RegistrationTraits<Dim>::Transformation Transformation;
66
69
72
73 TRegModel();
74 virtual ~TRegModel();
75
83 void solve (const Force& b, Transformation& x) const;
84
89 float get_force_scale() const;
90private:
91 virtual void do_solve(const Force& b, Transformation& x) const = 0;
92 virtual float do_get_force_scale() const;
93};
94
95//
96// implementation part of the registration model
97//
98
99template <int Dim>
101{
102}
103
104template <int Dim>
106{
107}
108
109template <int Dim>
111{
112 do_solve(b, x);
113}
114
115template <int Dim>
117{
118 return do_get_force_scale();
119}
120
121template <int Dim>
123{
124 return 1.0f;
125}
126
128
129#endif
The base class for all plug-in created object.
Definition: product_base.hh:41
Base class for PDE model based registrations.
Definition: regmodel.hh:56
void solve(const Force &b, Transformation &x) const
Definition: regmodel.hh:110
virtual ~TRegModel()
Definition: regmodel.hh:105
Data plugin_data
plug-in helper type for search path evaluation
Definition: regmodel.hh:71
RegistrationTraits< Dim >::Transformation Transformation
transformation type for the registrationmodel
Definition: regmodel.hh:65
regmodel_type plugin_type
plug-in helper type for search path evaluation
Definition: regmodel.hh:68
RegistrationTraits< Dim >::Data Data
Imaga data type for the registration model.
Definition: regmodel.hh:59
RegistrationTraits< Dim >::Force Force
gradient force data type for the registration model
Definition: regmodel.hh:62
float get_force_scale() const
Definition: regmodel.hh:116
generic base class for transformations
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition: defines.hh:101
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
static const char * type_descr
Definition: regmodel.hh:29