4 #include <vnl/vnl_matrix.h> 7 #include <itkTransform.h> 8 #include <itkMatrixOffsetTransformBase.h> 9 #include <itkMultiThreaderBase.h> 16 template <
class T> vnl_matrix <T>
GetSquareRoot(
const vnl_matrix <T> & m,
const double precision, vnl_matrix <T> & resultM);
19 template <
class T> vnl_matrix <T>
GetPadeLogarithm(
const vnl_matrix <double> & m,
const int numApprox);
22 template <
class T> vnl_matrix <T>
GetLogarithm(
const vnl_matrix <T> & m,
const double precision=0.00000000001,
const int numApprox=1);
25 template <
class T> vnl_matrix <T>
GetExponential(
const vnl_matrix <T> & m,
const int numApprox=1);
28 template <
class T>
void Get3DRotationLogarithm(
const vnl_matrix <T> &rotationMatrix, std::vector <T> &outputAngles);
34 template <
class TInputScalarType,
class TOutputScalarType,
unsigned int NDimensions,
unsigned int NDegreesOfFreedom>
41 typedef typename std::vector <OutputVectorType>
OutputType;
44 typedef typename std::vector <typename BaseInputTransformType::Pointer>
InputType;
50 m_InputTransforms.clear();
52 m_UseRigidTransforms =
false;
54 m_NumberOfThreads = itk::MultiThreaderBase::GetGlobalDefaultNumberOfThreads();
59 void SetInput(InputType &input) {m_InputTransforms = input;m_Modified =
true;}
63 if (m_UseRigidTransforms != rigTrsfs)
66 m_UseRigidTransforms = rigTrsfs;
85 static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION
ThreadedLogging(
void *arg);
86 void InternalLogger(
unsigned int threadId,
unsigned int numThreads);
89 InputType m_InputTransforms;
92 unsigned int m_NumberOfThreads;
93 bool m_UseRigidTransforms;
void SetNumberOfWorkUnits(unsigned int &numThreads)
void Get3DRotationLogarithm(const vnl_matrix< T > &rotationMatrix, std::vector< T > &outputAngles)
Computation of a 3D rotation matrix logarithm. Rodrigues' explicit formula.
void SetUseRigidTransforms(bool rigTrsfs)
itk::Vector< TOutputScalarType, NDegreesOfFreedom > OutputVectorType
std::vector< typename BaseInputTransformType::Pointer > InputType
void SetInput(InputType &input)
vnl_matrix< T > GetExponential(const vnl_matrix< T > &m, const int numApprox=1)
Computation of the matrix exponential. Algo: classical scaling and squaring, as in Matlab...
std::vector< OutputVectorType > OutputType
void InternalLogger(unsigned int threadId, unsigned int numThreads)
vnl_matrix< T > GetLogarithm(const vnl_matrix< T > &m, const double precision=0.00000000001, const int numApprox=1)
Computation of the matrix logarithm. Algo: inverse scaling and squaring, variant proposed by Cheng et...
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ThreadedLogging(void *arg)
void Get3DRotationExponential(const std::vector< T > &angles, vnl_matrix< T > &outputRotation)
Computation of a 3D rotation matrix exponential. Rodrigues' explicit formula.
itk::Transform< TInputScalarType, NDimensions, NDimensions > BaseInputTransformType
Class to compute many log-vectors in a multi-threaded way.
itk::MatrixOffsetTransformBase< TInputScalarType, NDimensions, NDimensions > BaseInputMatrixTransformType
vnl_matrix< T > GetPadeLogarithm(const vnl_matrix< double > &m, const int numApprox)
Final part of the computation of the log. Estimates the log with a Pade approximation for a matrix m ...
vnl_matrix< T > GetSquareRoot(const vnl_matrix< T > &m, const double precision, vnl_matrix< T > &resultM)
Gets the square root of matrix m.