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{
40public:
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
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
106private:
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
125class EXPORT_3D C3DRegTimeStepPlugin : public TFactory<C3DRegTimeStep>
126{
127public:
129 C3DRegTimeStepPlugin(const char *name);
130protected:
132 float get_min_timestep() const;
134 float get_max_timestep() const;
135private:
136 float m_min;
137 float m_max;
138};
139
141typedef std::shared_ptr<C3DRegTimeStep > P3DRegTimeStep;
142
145
147
148#endif
std::shared_ptr< C3DRegTimeStep > P3DRegTimeStep
Pointer type for time steps in 3D time-marching image registration.
Definition: 3d/timestep.hh:141
THandlerSingleton< TFactoryPluginHandler< C3DRegTimeStepPlugin > > C3DRegTimeStepPluginHandler
plugin handler for 3D time marching time step operator plug-ins
Definition: 3d/timestep.hh:144
a 3D field of floating point single accuracy 3D vectors
The generic base type of a 3D image.
Definition: 3d/image.hh:47
The plug-in class for the time-step class of time-marching registration algorithms.
Definition: 3d/timestep.hh:126
C3DRegTimeStepPlugin(const char *name)
Constructor to create the plug-in with its name.
float get_min_timestep() const
float get_max_timestep() const
The time-step part of time-marching registration algorithms.
Definition: 3d/timestep.hh:39
bool regrid_requested(const C3DFVectorfield &b, const C3DFVectorfield &v, float delta) const
virtual ~C3DRegTimeStep()
float calculate_pertuberation(C3DFVectorfield &io, const C3DFVectorfield &shift) const
C3DRegTimeStep(float min, float max)
C3DImage plugin_data
plugin hanlder helper
Definition: 3d/timestep.hh:42
void apply(const C3DFVectorfield &infield, C3DFVectorfield &outfield, float scale)
bool has_regrid() const
float get_delta(float maxshift) const
timestep_type plugin_type
plugin hanlder helper
Definition: 3d/timestep.hh:44
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_3D
Definition: defines3d.hh:45
#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