linear_transform.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_linear_transform_hh
#define mia_3d_linear_transform_hh
#include <mia/3d/transform.hh>
NS_MIA_BEGIN
class EXPORT_3D C3DLinearTransform: public C3DTransformation
{
public:
C3DLinearTransform();
C3DLinearTransform(const C3DBounds& size, const C3DInterpolatorFactory& ipf);
virtual C3DTransformation *invert() const;
virtual size_t degrees_of_freedom() const;
virtual void set_identity();
virtual C3DFMatrix derivative_at(const C3DFVector& x) const;
virtual C3DFMatrix derivative_at(int x, int y, int z) const;
virtual void translate(const C3DFVectorfield& gradient, CDoubleVector& params) const;
virtual float get_max_transform() const;
virtual CDoubleVector get_parameters() const;
virtual void set_parameters(const CDoubleVector& params);
virtual const C3DBounds& get_size() const;
virtual float pertuberate(C3DFVectorfield& v) const;
virtual C3DFVector apply(const C3DFVector& x) const;
virtual C3DFVector operator () (const C3DFVector& x) const;
virtual float get_jacobian(const C3DFVectorfield& v, float delta) const;
virtual void add(const C3DTransformation& a);
virtual void update(float step, const C3DFVectorfield& a);
virtual float divergence() const;
virtual float curl() const;
virtual double get_divcurl_cost(double wd, double wr, CDoubleVector& gradient) const;
double get_divcurl_cost(double wd, double wr) const;
virtual C3DTransformation::const_iterator begin() const;
virtual C3DTransformation::const_iterator end() const;
virtual C3DTransformation::const_iterator begin_range(const C3DBounds& begin, const C3DBounds& end) const;
virtual C3DTransformation::const_iterator end_range(const C3DBounds& begin, const C3DBounds& end) const;
protected:
class iterator_impl: public C3DTransformation::iterator_impl
{
friend class C3DLinearTransform;
iterator_impl(const C3DBounds& pos, const C3DBounds& size);
iterator_impl(const C3DBounds& pos, const C3DBounds& size,
const C3DBounds& begin, const C3DBounds& end);
C3DTransformation::iterator_impl *clone()const;
virtual const C3DFVector& do_get_value()const;
virtual void do_x_increment();
virtual void do_y_increment();
virtual void do_z_increment();
C3DFVector m_value;
};
private:
virtual P3DTransformation do_upscale(const C3DBounds& size) const;
virtual C3DTransformation *do_clone() const;
virtual P3DImage do_transform(const C3DImage& src, const C3DInterpolatorFactory&) const;
std::vector<double> m_matrix;
C3DBounds m_size;
};
NS_MIA_END
#endif
P3DImage
C3DImage::Pointer P3DImage
define a shortcut to the 3D image shared pointer.
Definition 3d/image.hh:135
C3DFMatrix
T3DMatrix< float > C3DFMatrix
a simple 3x3 matrix with single precision floating point values
Definition 3d/matrix.hh:226
transform.hh
C3DBounds
T3DVector< unsigned int > C3DBounds
A unsinged int 3D Vector (used for 3D field sizes).
Definition 3d/vector.hh:415
C3DFVector
T3DVector< float > C3DFVector
A float 3D Vector.
Definition 3d/vector.hh:409
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
C3DInterpolatorFactory
A factory to create interpolators of a given type by providing input data.
Definition 3d/interpolator.hh:175
C3DLinearTransform::iterator_impl::C3DLinearTransform
friend class C3DLinearTransform
Definition linear_transform.hh:65
C3DLinearTransform::get_divcurl_cost
double get_divcurl_cost(double wd, double wr) const
C3DLinearTransform::begin_range
virtual C3DTransformation::const_iterator begin_range(const C3DBounds &begin, const C3DBounds &end) const
C3DLinearTransform::derivative_at
virtual C3DFMatrix derivative_at(int x, int y, int z) const
C3DLinearTransform::degrees_of_freedom
virtual size_t degrees_of_freedom() const
C3DLinearTransform::begin
virtual C3DTransformation::const_iterator begin() const
C3DLinearTransform::set_identity
virtual void set_identity()
C3DLinearTransform::C3DLinearTransform
C3DLinearTransform()
C3DLinearTransform::invert
virtual C3DTransformation * invert() const
C3DLinearTransform::add
virtual void add(const C3DTransformation &a)
these functions should be removed
C3DLinearTransform::apply
virtual C3DFVector apply(const C3DFVector &x) const
C3DLinearTransform::derivative_at
virtual C3DFMatrix derivative_at(const C3DFVector &x) const
C3DLinearTransform::get_parameters
virtual CDoubleVector get_parameters() const
C3DLinearTransform::set_parameters
virtual void set_parameters(const CDoubleVector &params)
C3DLinearTransform::pertuberate
virtual float pertuberate(C3DFVectorfield &v) const
C3DLinearTransform::divergence
virtual float divergence() const
C3DLinearTransform::end_range
virtual C3DTransformation::const_iterator end_range(const C3DBounds &begin, const C3DBounds &end) const
C3DLinearTransform::translate
virtual void translate(const C3DFVectorfield &gradient, CDoubleVector &params) const
C3DLinearTransform::get_jacobian
virtual float get_jacobian(const C3DFVectorfield &v, float delta) const
C3DLinearTransform::end
virtual C3DTransformation::const_iterator end() const
C3DLinearTransform::curl
virtual float curl() const
C3DLinearTransform::update
virtual void update(float step, const C3DFVectorfield &a)
C3DLinearTransform::C3DLinearTransform
C3DLinearTransform(const C3DBounds &size, const C3DInterpolatorFactory &ipf)
C3DLinearTransform::get_max_transform
virtual float get_max_transform() const
C3DLinearTransform::get_divcurl_cost
virtual double get_divcurl_cost(double wd, double wr, CDoubleVector &gradient) const
C3DLinearTransform::get_size
virtual const C3DBounds & get_size() const
C3DTransformation::const_iterator
Definition 3d/transform.hh:135
C3DTransformation::iterator_impl
Definition 3d/transform.hh:71
C3DTransformation::C3DTransformation
C3DTransformation(const C3DInterpolatorFactory &ipf)
C3DTransformation::operator()
virtual C3DFVector operator()(const C3DFVector &x) const =0
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
CDoubleVector
TCArrayWrapper< double > CDoubleVector
Definition core/vector.hh:266
P3DTransformation
std::shared_ptr< C3DTransformation > P3DTransformation
pointer type for a 3D transformation
Definition 3d/transform.hh:43