Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkQuaternionAveraging.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef QUATERNIONAVERAGING_H_HEADER_INCLUDED_
19 #define QUATERNIONAVERAGING_H_HEADER_INCLUDED_
20 
21 #include "MitkIGTBaseExports.h"
22 #include <itkObject.h>
23 #include <itkObjectFactory.h>
24 #include <mitkCommon.h>
25 #include <mitkQuaternion.h>
26 #include <mitkVector.h>
27 #include <vector>
28 
29 
30 namespace mitk {
35  class MITKIGTBASE_EXPORT QuaternionAveraging : public itk::Object
36  {
37  public:
38 
40  itkNewMacro(Self);
41 
42  enum Mode
43  {
44  SimpleMean, //simple averaging over all components of the quaternion, only valid for small differences.
45  Slerp //more advanced algorithm for averaging (spherical linear interpolation), may also be used for huge differences
46  };
47 
48  static mitk::Quaternion CalcAverage(const std::vector<Quaternion>& quaternions, Mode mode = SimpleMean);
49 
50  protected:
52  virtual ~QuaternionAveraging();
53 
54  };
55 } // Ende Namespace
56 #endif
DataCollection - Class to facilitate loading/accessing structured data.
This class offers methods to average quaternions.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
vnl_quaternion< ScalarType > Quaternion
#define MITKIGTBASE_EXPORT