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 public:
43  typedef timestep_type plugin_type;
44 
51  C3DRegTimeStep(float min, float max);
52 
53  virtual ~C3DRegTimeStep();
54 
61  void apply(const C3DFVectorfield& infield, C3DFVectorfield& outfield, float scale);
62 
68  float calculate_pertuberation(C3DFVectorfield& io, const C3DFVectorfield& shift) const;
69 
75  bool decrease();
76 
80  void increase();
81 
88  float get_delta(float maxshift) const;
89 
98  bool regrid_requested (const C3DFVectorfield& b, const C3DFVectorfield& v, float delta) const;
99 
103  bool has_regrid () const;
104 
105 private:
106  virtual float do_calculate_pertuberation(C3DFVectorfield& io, const C3DFVectorfield& shift) const = 0;
107  virtual bool do_regrid_requested (const C3DFVectorfield& b, const C3DFVectorfield& v, float delta) const = 0;
108  virtual bool do_has_regrid () const = 0;
109 
110 
111  float m_min;
112  float m_max;
113  float m_current;
114  float m_step;
115 };
116 
117 
124 class EXPORT_3D C3DRegTimeStepPlugin : public TFactory<C3DRegTimeStep>
125 {
126 public:
128  C3DRegTimeStepPlugin(const char *name);
129 protected:
131  float get_min_timestep() const;
133  float get_max_timestep() const;
134 private:
135  float m_min;
136  float m_max;
137 };
138 
140 typedef std::shared_ptr<C3DRegTimeStep > P3DRegTimeStep;
141 
144 
146 
147 #endif
THandlerSingleton< TFactoryPluginHandler< C3DRegTimeStepPlugin > > C3DRegTimeStepPluginHandler
plugin handler for 3D time marching time step operator plug-ins
Definition: 3d/timestep.hh:143
The time-step part of time-marching registration algorithms.
Definition: 3d/timestep.hh:38
the singleton that a plug-in handler really is
Definition: handler.hh:157
C3DImage plugin_data
plugin hanlder helper
Definition: 3d/timestep.hh:41
a 3D field of floating point single accuracy 3D vectors
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_3D
Definition: defines3d.hh:44
The plug-in class for the time-step class of time-marching registration algorithms.
Definition: 3d/timestep.hh:124
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition: factory.hh:49
timestep_type plugin_type
plugin hanlder helper
Definition: 3d/timestep.hh:43
The generic base type of a 3D image.
Definition: 3d/image.hh:46
std::shared_ptr< C3DRegTimeStep > P3DRegTimeStep
Pointer type for time steps in 3D time-marching image registration.
Definition: 3d/timestep.hh:140
The base class for all plug-in created object.
Definition: product_base.hh:40
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36