affine_matrix.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_3d_affine_matrix_hh
#define mia_3d_affine_matrix_hh
#include <mia/3d/quaternion.hh>
NS_MIA_BEGIN
class EXPORT_3D CAffinTransformMatrix
{
public:
CAffinTransformMatrix();
CAffinTransformMatrix(float a11, float a12, float a13, float a14,
float a21, float a22, float a23, float a24,
float a31, float a32, float a33, float a34);
void rotate_x(float angle, const C3DFVector& center = C3DFVector::_0);
void rotate_y(float angle, const C3DFVector& center = C3DFVector::_0);
void rotate_z(float angle, const C3DFVector& center = C3DFVector::_0);
void rotate(const Quaternion& q, const C3DFVector& center = C3DFVector::_0);
void transform_centered(const C3DFMatrix& m, const C3DFVector& center = C3DFVector::_0);
void scale(const C3DFVector& scale, const C3DFVector& center = C3DFVector::_0);
void shear(const C3DFVector& shear, const C3DFVector& center = C3DFVector::_0);
void translate(const C3DFVector& shift);
void identity();
CAffinTransformMatrix& operator *= (const CAffinTransformMatrix& rhs);
const CAffinTransformMatrix inverse() const;
C3DFVector operator * (const C3DFVector& x) const;
C3DFVector rotate(const C3DFVector& x) const;
const std::vector<float>& data() const;
private:
std::vector<float> m_matrix;
};
EXPORT_3D CAffinTransformMatrix operator * (const CAffinTransformMatrix& lhs, const CAffinTransformMatrix& rhs);
NS_MIA_END
#endif
C3DFMatrix
T3DMatrix< float > C3DFMatrix
a simple 3x3 matrix with single precision floating point values
Definition 3d/matrix.hh:226
C3DFVector
T3DVector< float > C3DFVector
A float 3D Vector.
Definition 3d/vector.hh:409
operator*
EXPORT_3D CAffinTransformMatrix operator*(const CAffinTransformMatrix &lhs, const CAffinTransformMatrix &rhs)
CAffinTransformMatrix
Definition affine_matrix.hh:36
CAffinTransformMatrix::rotate_y
void rotate_y(float angle, const C3DFVector &center=C3DFVector::_0)
CAffinTransformMatrix::data
const std::vector< float > & data() const
CAffinTransformMatrix::transform_centered
void transform_centered(const C3DFMatrix &m, const C3DFVector &center=C3DFVector::_0)
CAffinTransformMatrix::translate
void translate(const C3DFVector &shift)
CAffinTransformMatrix::rotate_x
void rotate_x(float angle, const C3DFVector &center=C3DFVector::_0)
CAffinTransformMatrix::rotate
C3DFVector rotate(const C3DFVector &x) const
CAffinTransformMatrix::rotate
void rotate(const Quaternion &q, const C3DFVector &center=C3DFVector::_0)
CAffinTransformMatrix::identity
void identity()
CAffinTransformMatrix::scale
void scale(const C3DFVector &scale, const C3DFVector &center=C3DFVector::_0)
CAffinTransformMatrix::CAffinTransformMatrix
CAffinTransformMatrix(float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34)
CAffinTransformMatrix::shear
void shear(const C3DFVector &shear, const C3DFVector &center=C3DFVector::_0)
CAffinTransformMatrix::inverse
const CAffinTransformMatrix inverse() const
CAffinTransformMatrix::CAffinTransformMatrix
CAffinTransformMatrix()
standard constructor, initializes the transformation with the identity.
CAffinTransformMatrix::rotate_z
void rotate_z(float angle, const C3DFVector &center=C3DFVector::_0)
Quaternion
a class to implement a quaternion
Definition quaternion.hh:44
T3DVector< float >::_0
static T3DVector< float > _0
Definition 3d/vector.hh:342
EXPORT_3D
#define EXPORT_3D
Definition defines3d.hh:45
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
angle
float EXPORT_2D angle(const C2DFVector &ray_a, const C2DFVector &ray_b)
quaternion.hh
operator*
F operator*(const typename TSparseSolver< F >::A_mult_x &A, const F &x)
Definition sparse_solver.hh:182