3d/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_3d_transformmock_hh
22 #define mia_3d_transformmock_hh
23 
24 #include <mia/3d/transform.hh>
25 
27 
38 public:
41  C3DTransformMock(const C3DBounds& size, const C3DInterpolatorFactory& ipf);
42  virtual C3DTransformation *invert() const;
43  virtual void update(float step, const C3DFVectorfield& a);
44  virtual size_t degrees_of_freedom() const;
45  virtual void set_identity();
46  virtual C3DFMatrix derivative_at(const C3DFVector& x) const;
47  virtual C3DFMatrix derivative_at(int x, int y, int z) const;
48  virtual void translate(const C3DFVectorfield& gradient, CDoubleVector& params) const;
49  virtual float get_max_transform() const;
50  virtual CDoubleVector get_parameters() const;
51  virtual void set_parameters(const CDoubleVector& params);
52  virtual const C3DBounds& get_size() const;
53  virtual float pertuberate(C3DFVectorfield& v) const;
54  virtual C3DFVector get_displacement_at(const C3DFVector& x) const;
55  virtual C3DFVector operator () (const C3DFVector& x) const;
56  virtual float get_jacobian(const C3DFVectorfield& v, float delta) const;
57  virtual float divergence() const;
58  virtual float curl() const;
59  virtual double get_divcurl_cost(double wd, double wr, CDoubleVector& gradient) const;
60  double get_divcurl_cost(double wd, double wr) const;
61 
63  virtual C3DTransformation::const_iterator end() const;
64  virtual C3DTransformation::const_iterator begin_range(const C3DBounds& begin, const C3DBounds& end) const;
65  virtual C3DTransformation::const_iterator end_range(const C3DBounds& begin, const C3DBounds& end) const;
66 
67 protected:
69  friend class C3DTransformMock;
70  iterator_impl(const C3DBounds& pos, const C3DBounds& size);
71  iterator_impl(const C3DBounds& pos, const C3DBounds& size,
72  const C3DBounds& begin, const C3DBounds& end);
73 
75  virtual const C3DFVector& do_get_value()const;
76  virtual void do_x_increment();
77  virtual void do_y_increment();
78  virtual void do_z_increment();
79  C3DFVector m_value;
80  };
81 
82 private:
83  virtual P3DTransformation do_upscale(const C3DBounds& size) const;
84  virtual C3DTransformation *do_clone() const;
85  virtual P3DImage do_transform(const C3DImage& src, const C3DInterpolatorFactory&) const;
86  C3DBounds m_size;
88 };
89 
91 
92 #endif
virtual const_iterator end() const =0
virtual C3DFMatrix derivative_at(int x, int y, int z) const =0
virtual C3DFVector operator()(const C3DFVector &x) const =0
C3DImage::Pointer P3DImage
define a shortcut to the 3D image shared pointer.
Definition: 3d/image.hh:134
a 3D field of floating point single accuracy 3D vectors
A wrapper around the c-array to provide an STL like interface for iterators.
Definition: core/vector.hh:75
virtual float get_jacobian(const C3DFVectorfield &v, float delta) const =0
virtual size_t degrees_of_freedom() const =0
virtual C3DTransformation * invert() const =0
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
virtual const C3DBounds & get_size() const =0
virtual CDoubleVector get_parameters() const =0
virtual float get_max_transform() const =0
virtual void set_parameters(const CDoubleVector &params)=0
#define EXPORT_3D
Definition: defines3d.hh:44
virtual void set_identity()=0
This is the generic base class for 3D transformations.
Definition: 3d/transform.hh:53
virtual void update(float step, const C3DFVectorfield &a)=0
virtual const_iterator end_range(const C3DBounds &begin, const C3DBounds &end) const =0
A test class to enable running code that needs a transformation.
virtual C3DTransformation * clone() const
The generic base type of a 3D image.
Definition: 3d/image.hh:46
A factory to create interpolators of a given type by providing input data.
virtual const_iterator begin_range(const C3DBounds &begin, const C3DBounds &end) const =0
std::shared_ptr< C3DTransformation > P3DTransformation
pointer type for a 3D transformation
Definition: 3d/transform.hh:37
virtual const_iterator begin() const =0
virtual float pertuberate(C3DFVectorfield &v) const =0
virtual C3DFVector get_displacement_at(const C3DFVector &x) const =0
virtual void translate(const C3DFVectorfield &gradient, CDoubleVector &params) const =0
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36