3d/timestep.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_3d_timestep_hh
#define mia_3d_timestep_hh
#include <mia/core/factory.hh>
#include <mia/core/typedescr.hh>
#include <mia/3d/image.hh>
NS_MIA_BEGIN
class EXPORT_3D C3DRegTimeStep : public CProductBase
{
public:
typedef C3DImage plugin_data;
typedef timestep_type plugin_type;
C3DRegTimeStep(float min, float max);
virtual ~C3DRegTimeStep();
void apply(const C3DFVectorfield& infield, C3DFVectorfield& outfield, float scale);
float calculate_pertuberation(C3DFVectorfield& io, const C3DFVectorfield& shift) const;
bool decrease();
void increase();
float get_delta(float maxshift) const;
bool regrid_requested (const C3DFVectorfield& b, const C3DFVectorfield& v, float delta) const;
bool has_regrid () const;
private:
virtual float do_calculate_pertuberation(C3DFVectorfield& io, const C3DFVectorfield& shift) const = 0;
virtual bool do_regrid_requested (const C3DFVectorfield& b, const C3DFVectorfield& v, float delta) const = 0;
virtual bool do_has_regrid () const = 0;
float m_min;
float m_max;
float m_current;
float m_step;
};
class EXPORT_3D C3DRegTimeStepPlugin : public TFactory<C3DRegTimeStep>
{
public:
C3DRegTimeStepPlugin(const char *name);
protected:
float get_min_timestep() const;
float get_max_timestep() const;
private:
float m_min;
float m_max;
};
typedef std::shared_ptr<C3DRegTimeStep > P3DRegTimeStep;
typedef THandlerSingleton<TFactoryPluginHandler<C3DRegTimeStepPlugin>> C3DRegTimeStepPluginHandler;
NS_MIA_END
#endif
image.hh
P3DRegTimeStep
std::shared_ptr< C3DRegTimeStep > P3DRegTimeStep
Pointer type for time steps in 3D time-marching image registration.
Definition 3d/timestep.hh:141
C3DRegTimeStepPluginHandler
THandlerSingleton< TFactoryPluginHandler< C3DRegTimeStepPlugin > > C3DRegTimeStepPluginHandler
plugin handler for 3D time marching time step operator plug-ins
Definition 3d/timestep.hh:144
C3DFVectorfield
a 3D field of floating point single accuracy 3D vectors
Definition 3d/vectorfield.hh:103
C3DImage
The generic base type of a 3D image.
Definition 3d/image.hh:47
C3DRegTimeStepPlugin::C3DRegTimeStepPlugin
C3DRegTimeStepPlugin(const char *name)
Constructor to create the plug-in with its name.
C3DRegTimeStepPlugin::get_min_timestep
float get_min_timestep() const
C3DRegTimeStepPlugin::get_max_timestep
float get_max_timestep() const
C3DRegTimeStep::regrid_requested
bool regrid_requested(const C3DFVectorfield &b, const C3DFVectorfield &v, float delta) const
C3DRegTimeStep::~C3DRegTimeStep
virtual ~C3DRegTimeStep()
C3DRegTimeStep::calculate_pertuberation
float calculate_pertuberation(C3DFVectorfield &io, const C3DFVectorfield &shift) const
C3DRegTimeStep::decrease
bool decrease()
C3DRegTimeStep::increase
void increase()
C3DRegTimeStep::C3DRegTimeStep
C3DRegTimeStep(float min, float max)
C3DRegTimeStep::plugin_data
C3DImage plugin_data
plugin hanlder helper
Definition 3d/timestep.hh:42
C3DRegTimeStep::apply
void apply(const C3DFVectorfield &infield, C3DFVectorfield &outfield, float scale)
C3DRegTimeStep::has_regrid
bool has_regrid() const
C3DRegTimeStep::get_delta
float get_delta(float maxshift) const
C3DRegTimeStep::plugin_type
timestep_type plugin_type
plugin hanlder helper
Definition 3d/timestep.hh:44
CProductBase
The base class for all plug-in created object.
Definition product_base.hh:41
TFactory< C3DRegTimeStep >::TFactory
TFactory(char const *const name)
Definition factory.hh:173
THandlerSingleton
the singleton that a plug-in handler really is
Definition handler.hh:159
EXPORT_3D
#define EXPORT_3D
Definition defines3d.hh:45
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
factory.hh
typedescr.hh