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 
37 template <int Dim>
38 struct 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 
54 template <int Dim>
55 class TRegModel :public CProductBase {
56 public:
58  typedef typename RegistrationTraits<Dim>::Data Data;
59 
61  typedef typename RegistrationTraits<Dim>::Force Force;
62 
64  typedef typename RegistrationTraits<Dim>::Transformation Transformation;
65 
68 
70  typedef Data plugin_data;
71 
72  TRegModel();
73  virtual ~TRegModel();
74 
82  void solve (const Force& b, Transformation& x) const;
83 
88  float get_force_scale() const;
89 private:
90  virtual void do_solve(const Force& b, Transformation& x) const = 0;
91  virtual float do_get_force_scale() const;
92 };
93 
94 //
95 // implementation part of the registration model
96 //
97 
98 template <int Dim>
100 {
101 }
102 
103 template <int Dim>
105 {
106 }
107 
108 template <int Dim>
109 void TRegModel<Dim>::solve (const Force& b, Transformation& x) const
110 {
111  do_solve(b,x);
112 }
113 
114 template <int Dim>
116 {
117  return do_get_force_scale();
118 }
119 
120 template <int Dim>
122 {
123  return 1.0f;
124 }
125 
127 
128 #endif
virtual ~TRegModel()
Definition: regmodel.hh:104
RegistrationTraits< Dim >::Data Data
Imaga data type for the registration model.
Definition: regmodel.hh:58
static const char * type_descr
Definition: regmodel.hh:29
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
Base class for PDE model based registrations.
Definition: regmodel.hh:55
void solve(const Force &b, Transformation &x) const
Definition: regmodel.hh:109
Data plugin_data
plug-in helper type for search path evaluation
Definition: regmodel.hh:70
RegistrationTraits< Dim >::Transformation Transformation
transformation type for the registrationmodel
Definition: regmodel.hh:64
generic base class for transformations
regmodel_type plugin_type
plug-in helper type for search path evaluation
Definition: regmodel.hh:67
TRegModel()
Definition: regmodel.hh:99
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition: defines.hh:101
The base class for all plug-in created object.
Definition: product_base.hh:40
float get_force_scale() const
Definition: regmodel.hh:115
RegistrationTraits< Dim >::Force Force
gradient force data type for the registration model
Definition: regmodel.hh:61
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36