2d/transformmock.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_2d_transformmock_hh
22 #define mia_2d_transformmock_hh
23 
24 #include <mia/2d/transform.hh>
25 
27 
37 public:
39  C2DTransformMock(const C2DBounds& size);
40  virtual C2DTransformation *invert() const;
41  virtual void update(float step, const C2DFVectorfield& a);
42  virtual size_t degrees_of_freedom() const;
43  virtual void set_identity();
44  virtual C2DFMatrix derivative_at(const C2DFVector& x) const;
45  virtual C2DFMatrix derivative_at(int x, int y) const;
46  virtual void translate(const C2DFVectorfield& gradient, CDoubleVector& params) const;
47  virtual float get_max_transform() const;
48  virtual CDoubleVector get_parameters() const;
49  virtual void set_parameters(const CDoubleVector& params);
50  virtual const C2DBounds& get_size() const;
51  virtual float pertuberate(C2DFVectorfield& v) const;
52  virtual C2DFVector get_displacement_at(const C2DFVector& x) const;
53  virtual C2DFVector operator () (const C2DFVector& x) const;
54  virtual float get_jacobian(const C2DFVectorfield& v, float delta) const;
55  virtual float divergence() const;
56  virtual float curl() const;
57  virtual double get_divcurl_cost(double wd, double wr, CDoubleVector& gradient) const;
58  double get_divcurl_cost(double wd, double wr) const;
59 
61  virtual C2DTransformation::const_iterator end() const;
62 
63 protected:
65  friend class C2DTransformMock;
66  iterator_impl(const C2DBounds& pos, const C2DBounds& size);
67 
68  C2DTransformation::iterator_impl *clone()const __attribute__((warn_unused_result));
69  virtual const C2DFVector& do_get_value()const;
70  virtual void do_x_increment();
71  virtual void do_y_increment();
72  C2DFVector m_value;
73  };
74 
75 private:
76  virtual P2DTransformation do_upscale(const C2DBounds& size) const;
77  virtual C2DTransformation *do_clone() const __attribute__((warn_unused_result));
78  virtual P2DImage apply(const C2DImage& image, const C2DInterpolatorFactory& ipf) const;
79  C2DBounds m_size;
81 };
82 
84 
85 #endif
virtual CDoubleVector get_parameters() const =0
C2DImage::Pointer P2DImage
Shared pointer representation of the 2D Image.
Definition: 2d/image.hh:119
virtual C2DTransformation * clone() const __attribute__((warn_unused_result))
virtual const_iterator end() const =0
virtual size_t degrees_of_freedom() const =0
virtual C2DFVector operator()(const C2DFVector &x) const =0
A wrapper around the c-array to provide an STL like interface for iterators.
Definition: core/vector.hh:75
virtual float get_max_transform() const =0
virtual float get_jacobian(const C2DFVectorfield &v, float delta) const =0
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
C2DTransformation::Pointer P2DTransformation
Pointer type for the 2D transformation.
Base of the implementation of an iterator over the transformation domain This iterator takes care of ...
Definition: 2d/transform.hh:79
#define EXPORT_2D
Definition: defines2d.hh:37
virtual void set_identity()=0
a 2D field of floating point single accuracy 2D vectors
This is the generic base class for 2D transformations.
Definition: 2d/transform.hh:45
virtual void update(float step, const C2DFVectorfield &a)=0
virtual C2DFVector get_displacement_at(const C2DFVector &x) const =0
virtual C2DFMatrix derivative_at(const C2DFVector &x) const =0
A simple 2x2 matrix.
Definition: 2d/matrix.hh:36
This class mocks a transformation by implementing all the pure virtual methods of the C2DTransformati...
virtual float pertuberate(C2DFVectorfield &v) const =0
The factory to create an interpolator from some input data.
virtual void set_parameters(const CDoubleVector &params)=0
virtual const C2DBounds & get_size() const =0
virtual const_iterator begin() const =0
virtual C2DTransformation * invert() const __attribute__((warn_unused_result))=0
This is the base class for 2D images that can hold generic pixel data.
Definition: 2d/image.hh:47
virtual void translate(const C2DFVectorfield &gradient, CDoubleVector &params) const =0
virtual C2DFVector apply(const C2DFVector &x) const __attribute__((deprecated))
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36