iRoCS Toolbox  1.1.0
ATBThinPlateSpline.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 #ifndef ATBTHINPLATESPLINE_HH
24 #define ATBTHINPLATESPLINE_HH
25 
26 #ifdef HAVE_CONFIG_H
27 #include <config.hh>
28 #endif
29 
30 #include "TypeTraits.hh"
31 #include "ATBLinAlg.hh"
32 
33 #include <vector>
34 
35 namespace atb
36 {
37 
38 /*======================================================================*/
51 /*======================================================================*/
52  template<int Dim>
53  double tpsDistance(
54  const blitz::TinyVector<double,Dim>& p1,
55  const blitz::TinyVector<double,Dim>& p2);
56 
57 /*======================================================================*/
106 /*======================================================================*/
107  template<int Dim>
109  const std::vector< blitz::TinyVector<double,Dim> >& source,
110  const std::vector< blitz::TinyVector<double,Dim> >& target,
111  blitz::Array<double,2>& coeffs);
112 
113 /*======================================================================*/
161 /*======================================================================*/
162  template<int Dim>
163  blitz::TinyVector<double,Dim>
164  evaluateTPS(
165  const blitz::TinyVector<double,Dim>& x,
166  const std::vector< blitz::TinyVector<double,Dim> >& controlPoints,
167  const blitz::Array<double,2>& coeffs);
168 
169 }
170 
171 #include "ATBThinPlateSpline.icc"
172 
173 #endif
double tpsDistance(const blitz::TinyVector< double, Dim > &p1, const blitz::TinyVector< double, Dim > &p2)
Compute the TPS distance between point p1 on point p2.
Query specific information about different data types.
blitz::TinyVector< double, Dim > evaluateTPS(const blitz::TinyVector< double, Dim > &x, const std::vector< blitz::TinyVector< double, Dim > > &controlPoints, const blitz::Array< double, 2 > &coeffs)
Given a set of controlPoints and a coefficient matrix as computed with computeTPSParameters(), evaluate the thin plate spline at position x.
void computeTPSParameters(const std::vector< blitz::TinyVector< double, Dim > > &source, const std::vector< blitz::TinyVector< double, Dim > > &target, blitz::Array< double, 2 > &coeffs)
Given two vectors of correspondending points of two datasets, compute the weights and offsets of a th...