My Project
3d/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_3d_timestep_hh
22 #define mia_3d_timestep_hh
23 
24 #include <mia/core/factory.hh>
25 #include <mia/core/typedescr.hh>
26 #include <mia/3d/image.hh>
27 
29 
39 {
40 public:
44  typedef timestep_type plugin_type;
45 
52  C3DRegTimeStep(float min, float max);
53 
54  virtual ~C3DRegTimeStep();
55 
62  void apply(const C3DFVectorfield& infield, C3DFVectorfield& outfield, float scale);
63 
69  float calculate_pertuberation(C3DFVectorfield& io, const C3DFVectorfield& shift) const;
70 
76  bool decrease();
77 
81  void increase();
82 
89  float get_delta(float maxshift) const;
90 
99  bool regrid_requested (const C3DFVectorfield& b, const C3DFVectorfield& v, float delta) const;
100 
104  bool has_regrid () const;
105 
106 private:
107  virtual float do_calculate_pertuberation(C3DFVectorfield& io, const C3DFVectorfield& shift) const = 0;
108  virtual bool do_regrid_requested (const C3DFVectorfield& b, const C3DFVectorfield& v, float delta) const = 0;
109  virtual bool do_has_regrid () const = 0;
110 
111 
112  float m_min;
113  float m_max;
114  float m_current;
115  float m_step;
116 };
117 
118 
125 class EXPORT_3D C3DRegTimeStepPlugin : public TFactory<C3DRegTimeStep>
126 {
127 public:
129  C3DRegTimeStepPlugin(const char *name);
130 protected:
132  float get_min_timestep() const;
134  float get_max_timestep() const;
135 private:
136  float m_min;
137  float m_max;
138 };
139 
141 typedef std::shared_ptr<C3DRegTimeStep > P3DRegTimeStep;
142 
145 
147 
148 #endif
C3DImage
The generic base type of a 3D image.
Definition: 3d/image.hh:46
C3DRegTimeStep::plugin_type
timestep_type plugin_type
plugin hanlder helper
Definition: 3d/timestep.hh:44
factory.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
typedescr.hh
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
THandlerSingleton
the singleton that a plug-in handler really is
Definition: handler.hh:158
C3DFVectorfield
a 3D field of floating point single accuracy 3D vectors
Definition: 3d/vectorfield.hh:102
C3DRegTimeStep::plugin_data
C3DImage plugin_data
plugin hanlder helper
Definition: 3d/timestep.hh:42
CProductBase
The base class for all plug-in created object.
Definition: product_base.hh:40
C3DRegTimeStep
The time-step part of time-marching registration algorithms.
Definition: 3d/timestep.hh:38
EXPORT_3D
#define EXPORT_3D
Definition: defines3d.hh:45
P3DRegTimeStep
std::shared_ptr< C3DRegTimeStep > P3DRegTimeStep
Pointer type for time steps in 3D time-marching image registration.
Definition: 3d/timestep.hh:141
image.hh
C3DRegTimeStepPluginHandler
THandlerSingleton< TFactoryPluginHandler< C3DRegTimeStepPlugin > > C3DRegTimeStepPluginHandler
plugin handler for 3D time marching time step operator plug-ins
Definition: 3d/timestep.hh:144
C3DRegTimeStepPlugin
The plug-in class for the time-step class of time-marching registration algorithms.
Definition: 3d/timestep.hh:125
TFactory
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition: factory.hh:49