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