33 #ifndef CXTRANSFORM3D_H_
34 #define CXTRANSFORM3D_H_
36 #include "cxResourceExport.h"
39 #include <boost/array.hpp>
40 #include <boost/shared_ptr.hpp>
49 namespace cx_transform3D_internal
53 cxResource_EXPORT boost::array<double, 16>
flatten(
const Eigen::Affine3d*
self);
56 cxResource_EXPORT
void fill(Eigen::Affine3d*
self,
float m[4][4]);
57 cxResource_EXPORT
void fill(Eigen::Affine3d*
self,
const double* raw);
59 cxResource_EXPORT std::ostream&
put(
const Eigen::Affine3d*
self, std::ostream& s,
int indent,
char newline);
60 cxResource_EXPORT Eigen::Affine3d
fromString(
const QString& text,
bool* _ok);
68 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
69 std::ostream& operator<<(std::ostream& s, const Eigen::Transform<_Scalar, _Dim, _Mode, _Options>& t)
71 s << t.matrix().format(IOFormat());
76 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
77 Vector3d Transform<_Scalar, _Dim, _Mode, _Options>::vector(
const Vector3d& v)
const
79 return this->linear() * v;
82 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
85 return (this->linear() * v).normal();
88 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
89 Vector3d Transform<_Scalar, _Dim, _Mode, _Options>::coord(
const Vector3d& v)
const
94 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
95 Transform<_Scalar, _Dim, _Mode, _Options> Transform<_Scalar, _Dim, _Mode, _Options>::inv()
const
97 return this->inverse();
100 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
106 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
107 Transform<_Scalar, _Dim, _Mode, _Options>::Transform(vtkMatrix4x4* m)
112 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
113 Transform<_Scalar, _Dim, _Mode, _Options>::Transform(
double* raw)
118 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
124 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
130 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
136 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
137 Transform<_Scalar, _Dim, _Mode, _Options> Transform<_Scalar, _Dim, _Mode, _Options>::fromString(
const QString& text,
143 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
144 Transform<_Scalar, _Dim, _Mode, _Options> Transform<_Scalar, _Dim, _Mode, _Options>::fromVtkMatrix(
vtkMatrix4x4Ptr m)
146 Transform<_Scalar, _Dim, _Mode, _Options> retval;
151 template<
typename _Scalar,
int _Dim,
int _Mode,
int _Options>
152 Transform<_Scalar, _Dim, _Mode, _Options> Transform<_Scalar, _Dim, _Mode, _Options>::fromFloatArray(
float m[4][4])
154 Transform<_Scalar, _Dim, _Mode, _Options> retval;
166 class DoubleBoundingBox3D;
189 cxResource_EXPORT DoubleBoundingBox3D
transform(
const Transform3D& m,
const DoubleBoundingBox3D& bb);
vtkSmartPointer< class vtkMatrix4x4 > vtkMatrix4x4Ptr
DoubleBoundingBox3D transform(const Transform3D &m, const DoubleBoundingBox3D &bb)
Transform3D createTransformRotateY(const double angle)
Transform3D createTransformScale(const Vector3D &scale_)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
cxResource_EXPORT Transform3D createTransformFromReferenceToExternal(PATIENT_COORDINATE_SYSTEM external)
boost::shared_ptr< Transform3D > Transform3DPtr
cxResource_EXPORT Transform3D createTransformRotationBetweenVectors(Vector3D from, Vector3D to)
cxResource_EXPORT Transform3D createTransformLPS2RAS()
Vector3D unitVector(double thetaXY, double thetaZ)
compute a unit vector given angles xy in the xy plane and z meaning the elevation from the xy plane...
vtkSmartPointer< class vtkTransform > vtkTransformPtr
Transform3D createTransformNormalize(const DoubleBoundingBox3D &in, const DoubleBoundingBox3D &out)
bool similar(const DoubleBoundingBox3D &a, const DoubleBoundingBox3D &b, double tol)
Transform3D createTransformIJC(const Vector3D &ivec, const Vector3D &jvec, const Vector3D ¢er)
Transform3D createTransformTranslate(const Vector3D &translation)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Transform3D createTransformRotateZ(const double angle)
Transform3D createTransformRotateX(const double angle)