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-2013 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 apply(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