2d/timestep.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_2d_timestep_hh
22 #define mia_2d_timestep_hh
23 
24 #include <mia/core/factory.hh>
25 #include <mia/core/typedescr.hh>
26 #include <mia/2d/image.hh>
27 #include <mia/2d/transform.hh>
28 
30 
43 public:
46 
48  typedef timestep_type plugin_type;
49 
56  C2DRegTimeStep(float min, float max);
57 
58 
59  virtual ~C2DRegTimeStep();
60 
71  float calculate_pertuberation(C2DFVectorfield& io,
72  const C2DTransformation& shift) const;
73 
82  bool regrid_requested(const C2DTransformation& b, const C2DFVectorfield& v,
83  float delta) const;
84 
91  bool decrease();
92 
94  void increase();
95 
101  float get_delta(float maxshift) const;
102 
104  bool has_regrid () const;
105 
106 private:
107  virtual float do_calculate_pertuberation(C2DFVectorfield& io,
108  const C2DTransformation& shift) const = 0;
109  virtual bool do_regrid_requested (const C2DTransformation& b,
110  const C2DFVectorfield& v, float delta) const = 0;
111 
112  virtual bool do_has_regrid () const = 0;
113 
114  float m_min;
115  float m_max;
116  float m_current;
117 };
118 
120 typedef std::shared_ptr<C2DRegTimeStep > P2DRegTimeStep;
121 
129 class EXPORT_2D C2DRegTimeStepPlugin : public TFactory<C2DRegTimeStep>
130 {
131 public:
136  C2DRegTimeStepPlugin(const char *name);
137 protected:
139  float get_min_timestep() const;
140 
142  float get_max_timestep() const;
143 private:
144  float m_min;
145  float m_max;
146 };
147 
154 
156 
157 #endif
the singleton that a plug-in handler really is
Definition: handler.hh:157
Plug-in to create the time step evaluation.
Definition: 2d/timestep.hh:129
The time step class for time-marching registration algorithms.
Definition: 2d/timestep.hh:42
THandlerSingleton< TFactoryPluginHandler< C2DRegTimeStepPlugin > > C2DRegTimeStepPluginHandler
Definition: 2d/timestep.hh:153
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
C2DImage plugin_data
plugin search path data component helper
Definition: 2d/timestep.hh:45
#define EXPORT_2D
Definition: defines2d.hh:37
a 2D field of floating point single accuracy 2D vectors
This is the generic base class for 2D transformations.
Definition: 2d/transform.hh:45
timestep_type plugin_type
plugin search path plugin type component helper
Definition: 2d/timestep.hh:48
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition: factory.hh:49
std::shared_ptr< C2DRegTimeStep > P2DRegTimeStep
pointer type for the 2D registration time step
Definition: 2d/timestep.hh:120
The base class for all plug-in created object.
Definition: product_base.hh:40
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:47
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36