My Project
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{
44public:
47
49 typedef timestep_type plugin_type;
50
57 C2DRegTimeStep(float min, float max);
58
59
60 virtual ~C2DRegTimeStep();
61
73 const C2DTransformation& shift) const;
74
84 float delta) const;
85
92 bool decrease();
93
95 void increase();
96
102 float get_delta(float maxshift) const;
103
105 bool has_regrid () const;
106
107private:
108 virtual float do_calculate_pertuberation(C2DFVectorfield& io,
109 const C2DTransformation& shift) const = 0;
110 virtual bool do_regrid_requested (const C2DTransformation& b,
111 const C2DFVectorfield& v, float delta) const = 0;
112
113 virtual bool do_has_regrid () const = 0;
114
115 float m_min;
116 float m_max;
117 float m_current;
118};
119
121typedef std::shared_ptr<C2DRegTimeStep > P2DRegTimeStep;
122
130class EXPORT_2D C2DRegTimeStepPlugin : public TFactory<C2DRegTimeStep>
131{
132public:
137 C2DRegTimeStepPlugin(const char *name);
138protected:
140 float get_min_timestep() const;
141
143 float get_max_timestep() const;
144private:
145 float m_min;
146 float m_max;
147};
148
155
157
158#endif
std::shared_ptr< C2DRegTimeStep > P2DRegTimeStep
pointer type for the 2D registration time step
Definition: 2d/timestep.hh:121
THandlerSingleton< TFactoryPluginHandler< C2DRegTimeStepPlugin > > C2DRegTimeStepPluginHandler
Definition: 2d/timestep.hh:154
a 2D field of floating point single accuracy 2D vectors
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:48
Plug-in to create the time step evaluation.
Definition: 2d/timestep.hh:131
C2DRegTimeStepPlugin(const char *name)
float get_max_timestep() const
float get_min_timestep() const
The time step class for time-marching registration algorithms.
Definition: 2d/timestep.hh:43
timestep_type plugin_type
plugin search path plugin type component helper
Definition: 2d/timestep.hh:49
C2DImage plugin_data
plugin search path data component helper
Definition: 2d/timestep.hh:46
bool has_regrid() const
bool regrid_requested(const C2DTransformation &b, const C2DFVectorfield &v, float delta) const
void increase()
increase thetime step by multiplying with 1.5
float calculate_pertuberation(C2DFVectorfield &io, const C2DTransformation &shift) const
float get_delta(float maxshift) const
virtual ~C2DRegTimeStep()
C2DRegTimeStep(float min, float max)
This is the generic base class for 2D transformations.
Definition: 2d/transform.hh:46
The base class for all plug-in created object.
Definition: product_base.hh:41
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition: factory.hh:51
the singleton that a plug-in handler really is
Definition: handler.hh:159
#define EXPORT_2D
Definition: defines2d.hh:37
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36