19#ifndef itkMeshProcrustesAlignFilter_h
20#define itkMeshProcrustesAlignFilter_h
27#include "vnl/vnl_matrix.h"
61template <
class TInputMesh,
class TOutputMesh>
138 double rotX, cosY, rotY, rotZ;
140 rotY = (-1) * (asin(rotation(0, 2)));
143 rotX = acos((rotation(2, 2)) / cosY);
145 rotZ = acos((rotation(0, 0)) / cosY);
166 std::ofstream output;
168 output.open(
"Transform.info", std::ios::out);
169 output <<
"ROTATION MATRIX" << std::endl;
170 for (
unsigned dim1 = 0; dim1 < 3; dim1++)
172 for (
unsigned dim2 = 0; dim2 < 3; dim2++)
174 output <<
"Position " << dim1 <<
" " << dim2 <<
" : " << rotation(dim1, dim2) << std::endl;
178 output <<
"TRANSLATION VECTOR" << std::endl;
179 for (
unsigned dim1 = 0; dim1 < 3; dim1++)
181 output <<
"Position " << dim1 <<
" : " << trans.
GetElement(dim1) << std::endl;
184 output <<
"ROTATION VECTOR" << std::endl;
185 for (
unsigned dim1 = 0; dim1 < 3; dim1++)
187 output <<
"Position " << dim1 <<
" : " << rots.
GetElement(dim1) << std::endl;
199 itkGetConstMacro(Convergence,
double);
224 itkGetMacro(UseScaling,
bool);
242 itkGetMacro(UseInitialAverage,
bool);
258 itkGetMacro(UseNormalization,
bool);
276 itkGetMacro(UseSingleIteration,
bool);
292 itkGetMacro(AlignRotation,
bool);
294 itkGetConstMacro(MeanPointsDifference,
double);
359#ifndef ITK_MANUAL_INSTANTIATION
360# include "itkMeshProcrustesAlignFilter.hxx"
SmartPointer< Self > Pointer
const_reference GetElement(unsigned int index) const
ITK_GCC_PRAGMA_POP void SetElement(unsigned int index, const_reference value)
TransformType::MatrixType RotationType
virtual void GenerateData() override
SmartPointer< const Self > ConstPointer
TranslationType GetMeshCenter(unsigned int idx)
void SetUseNormalizationOff()
double m_MeanPointsDifference
MeshProcrustesAlignFilter Self
vnl_matrix< CoordinateType > MatrixType
InputMeshType::Pointer InputMeshPointer
OutputPointType::ValueType CoordinateType
bool m_UseSingleIteration
TOutputMesh OutputMeshType
SmartPointer< Self > Pointer
TransformType::OffsetType TranslationType
void SetUseSingleIterationOn()
TransformPointer GetProcrustesMatch(unsigned int idx, OutputMeshType *targetMesh, TranslationType targetCenter)
TransformMeshFilter< OutputMeshType, OutputMeshType, TransformType > TransformMeshType
OutputMeshType::PointsContainerPointer OutputPointsContainerPointer
TransformType * GetTransform(unsigned int idx)
virtual void SetUseScaling(bool _arg)
void SetUseSingleIterationOff()
AffineTransform< double, 3 > TransformType
OutputMeshPointer m_OldMean
DataObject::Pointer DataObjectPointer
TransformMeshType::Pointer TransformMeshPointer
InputMeshType::PointType InputPointType
TransformType::Pointer TransformPointer
OutputMeshType * GetOutput(unsigned int idx)
void SetUseInitialAverageOff()
void SetUseInitialAverageOn()
TranslationType GetRotationDegrees(const TransformType *transform)
CoordinateType CoordRepType
OutputMeshType::PointsContainer OutputPointsContainer
virtual void SetAlignRotation(bool _arg)
void PrintTransform(const TransformType *transform)
std::vector< TransformMeshPointer > TransformMeshArray
InputMeshType * GetInput(unsigned int idx)
std::vector< TranslationType > m_Center
void SetAlignRotationOff()
virtual itk::ProcessObject::DataObjectPointer MakeOutput(itk::ProcessObject::DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
MeshProcrustesAlignFilter()
TranslationType m_MeanCenter
virtual void SetUseInitialAverage(bool _arg)
TransformMeshArray m_MeshTransform
void SetNumberOfInputs(unsigned int num)
void SetInput(unsigned int idx, InputMeshType *mesh)
void SetUseNormalizationOn()
OutputMeshType::Pointer OutputMeshPointer
virtual void SetUseSingleIteration(bool _arg)
OutputMeshType::PointType OutputPointType
~MeshProcrustesAlignFilter()
void SetAlignRotationOn()
virtual void SetUseNormalization(bool _arg)
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObject::Pointer DataObjectPointer
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
Make a DataObject of the correct type to used as the specified output.
Implements transparent reference counting.
constexpr double pi_over_180
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)