Medical Imaging Interaction Toolkit  2021.10.99-2cdb1412
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef QUATERNIONAVERAGING_H_HEADER_INCLUDED_
15 #define QUATERNIONAVERAGING_H_HEADER_INCLUDED_
16 
17 #include "MitkIGTBaseExports.h"
18 #include <itkObject.h>
19 #include <itkObjectFactory.h>
20 #include <mitkCommon.h>
21 #include <mitkQuaternion.h>
22 #include <mitkVector.h>
23 #include <vector>
24 
25 
26 namespace mitk {
31  class MITKIGTBASE_EXPORT QuaternionAveraging : public itk::Object
32  {
33  public:
34 
36  itkNewMacro(Self);
37 
38  enum Mode
39  {
40  SimpleMean, //simple averaging over all components of the quaternion, only valid for small differences.
41  Slerp //more advanced algorithm for averaging (spherical linear interpolation), may also be used for huge differences
42  };
43 
44  static mitk::Quaternion CalcAverage(const std::vector<Quaternion>& quaternions, Mode mode = SimpleMean);
45 
46  protected:
48  ~QuaternionAveraging() override;
49 
50  };
51 } // Ende Namespace
52 #endif
DataCollection - Class to facilitate loading/accessing structured data.
This class offers methods to average quaternions.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
vnl_quaternion< ScalarType > Quaternion
#define MITKIGTBASE_EXPORT