CustusX  16.5
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
matrixInterpolation.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 #ifndef MATRIXINTERPOLATION_H_
33 #define MATRIXINTERPOLATION_H_
34 
35 #include "org_custusx_usreconstruction_Export.h"
36 
37 #include <vector>
38 #include "vnl/vnl_matrix.h"
39 #include "vnl/vnl_vector.h"
40 typedef vnl_matrix<double> vnl_matrix_double;
41 
43 // Suppose that T(t) is a time-variant 4-by-4 transformation matrix
44 // whos values at certain points, given in the vector DataPoints, are
45 // given in the vector DataValues. This operation, then, interpolates
46 // to find the values of T at the intermediate points given in the
47 // vector InterpolationPoints.
48 //
49 // The interpolated values are found in two different ways depending
50 // on the value of the InterpolationMethod string:
51 // 1. InterpolationMethod == "closest point": In this case, the
52 // value at a given point is set to the value at the nearest
53 // neighboring point with a known value.
54 // 2. InterpolationMethod == "linear": In this case, the rotation
55 // part of the transformation matrix is found using the slerp
56 // (spherical linear interpolation), while the translation part
57 // is found using ordinary linear interpolation.
58 //
59 // Trondheim, 12.01.09.
60 // Lars Eirik B� <larseirik.bo@sintef.no>, SINTEF Technology and Society.
61 cxPluginUSReconstruction_EXPORT std::vector<vnl_matrix_double> matrixInterpolation(
62  vnl_vector<double> DataPoints,
63  std::vector<vnl_matrix_double> DataValues,
64  vnl_vector<double> InterpolationPoints,
65  std::string InterpolationMethod );
66 
67 
68 #endif /* MATRIXINTERPOLATION_H_ */
vnl_matrix< double > vnl_matrix_double
cxPluginUSReconstruction_EXPORT std::vector< vnl_matrix_double > matrixInterpolation(vnl_vector< double > DataPoints, std::vector< vnl_matrix_double > DataValues, vnl_vector< double > InterpolationPoints, std::string InterpolationMethod)
Operation: Interpolate transformation matrices.