2d/transformmock.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_2d_transformmock_hh
#define mia_2d_transformmock_hh
#include <mia/2d/transform.hh>
NS_MIA_BEGIN
class EXPORT_2D C2DTransformMock: public C2DTransformation
{
public:
C2DTransformMock();
C2DTransformMock(const C2DBounds& size);
virtual C2DTransformation *invert() const;
virtual void update(float step, const C2DFVectorfield& a);
virtual size_t degrees_of_freedom() const;
virtual void set_identity();
virtual C2DFMatrix derivative_at(const C2DFVector& x) const;
virtual C2DFMatrix derivative_at(int x, int y) const;
virtual void translate(const C2DFVectorfield& gradient, CDoubleVector& params) const;
virtual float get_max_transform() const;
virtual CDoubleVector get_parameters() const;
virtual void set_parameters(const CDoubleVector& params);
virtual const C2DBounds& get_size() const;
virtual float pertuberate(C2DFVectorfield& v) const;
virtual C2DFVector get_displacement_at(const C2DFVector& x) const;
virtual C2DFVector operator () (const C2DFVector& x) const;
virtual float get_jacobian(const C2DFVectorfield& v, float delta) const;
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 C2DTransformation::const_iterator begin() const;
virtual C2DTransformation::const_iterator end() const;
protected:
class iterator_impl: public C2DTransformation::iterator_impl
{
friend class C2DTransformMock;
iterator_impl(const C2DBounds& pos, const C2DBounds& size);
C2DTransformation::iterator_impl *clone()const __attribute__((warn_unused_result));
virtual const C2DFVector& do_get_value()const;
virtual void do_x_increment();
virtual void do_y_increment();
C2DFVector m_value;
};
private:
virtual P2DTransformation do_upscale(const C2DBounds& size) const;
virtual C2DTransformation *do_clone() const __attribute__((warn_unused_result));
virtual P2DImage apply(const C2DImage& image, const C2DInterpolatorFactory& ipf) const;
C2DBounds m_size;
};
NS_MIA_END
#endif
P2DImage
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition 2d/image.hh:120
C2DFMatrix
T2DMatrix< float > C2DFMatrix
a simple 2x2 matrix
Definition 2d/matrix.hh:153
transform.hh
C2DBounds
T2DVector< unsigned int > C2DBounds
unsigned int valued 2D vector - used as 2D size parameter
Definition 2d/vector.hh:540
C2DFVector
T2DVector< float > C2DFVector
float valued 2D vector
Definition 2d/vector.hh:534
C2DFVectorfield
a 2D field of floating point single accuracy 2D vectors
Definition 2d/vectorfield.hh:80
C2DImage
This is the base class for 2D images that can hold generic pixel data.
Definition 2d/image.hh:48
C2DInterpolatorFactory
The factory to create an interpolator from some input data.
Definition 2d/interpolator.hh:190
C2DTransformMock
This class mocks a transformation by implementing all the pure virtual methods of the C2DTransformati...
Definition 2d/transformmock.hh:36
C2DTransformation::const_iterator
Definition 2d/transform.hh:143
C2DTransformation::iterator_impl
Base of the implementation of an iterator over the transformation domain This iterator takes care of ...
Definition 2d/transform.hh:81
C2DTransformation::get_max_transform
virtual float get_max_transform() const =0
C2DTransformation::begin
virtual const_iterator begin() const =0
C2DTransformation::derivative_at
virtual C2DFMatrix derivative_at(const C2DFVector &x) const =0
C2DTransformation::translate
virtual void translate(const C2DFVectorfield &gradient, CDoubleVector &params) const =0
C2DTransformation::get_displacement_at
virtual C2DFVector get_displacement_at(const C2DFVector &x) const =0
C2DTransformation::get_size
virtual const C2DBounds & get_size() const =0
C2DTransformation::end
virtual const_iterator end() const =0
C2DTransformation::update
virtual void update(float step, const C2DFVectorfield &a)=0
C2DTransformation::apply
virtual C2DFVector apply(const C2DFVector &x) const __attribute__((deprecated))
Definition 2d/transform.hh:344
C2DTransformation::get_parameters
virtual CDoubleVector get_parameters() const =0
C2DTransformation::pertuberate
virtual float pertuberate(C2DFVectorfield &v) const =0
C2DTransformation::set_identity
virtual void set_identity()=0
C2DTransformation::degrees_of_freedom
virtual size_t degrees_of_freedom() const =0
C2DTransformation::C2DTransformation
C2DTransformation(const C2DInterpolatorFactory &ipf)
C2DTransformation::clone
virtual C2DTransformation * clone() const __attribute__((warn_unused_result))
C2DTransformation::invert
virtual C2DTransformation * invert() const __attribute__((warn_unused_result))=0
C2DTransformation::operator()
virtual C2DFVector operator()(const C2DFVector &x) const =0
C2DTransformation::get_jacobian
virtual float get_jacobian(const C2DFVectorfield &v, float delta) const =0
C2DTransformation::set_parameters
virtual void set_parameters(const CDoubleVector &params)=0
EXPORT_2D
#define EXPORT_2D
Definition defines2d.hh:37
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
P2DTransformation
C2DTransformation::Pointer P2DTransformation
Pointer type for the 2D transformation.
Definition 2d/transform.hh:409