12 #ifndef mitkTransform_h
13 #define mitkTransform_h
15 #include <itkObject.h>
16 #include <opencv2/calib3d.hpp>
21 #include <vtkMatrix4x4.h>
23 #include <MitkCameraCalibrationExports.h>
35 class MITKCAMERACALIBRATION_EXPORT
Transform:
public itk::Object,
62 itkGetConstMacro(Type, std::string);
63 itkSetMacro(Type, std::string&);
82 void TransposeRotation();
87 mitk::Transform::Pointer Clone()
const;
100 void Concatenate(
const vnl_matrix_fixed<mitk::ScalarType, 4, 4>& transform );
105 void Concatenate(
const vtkMatrix4x4* transform );
119 void FromXML(
const tinyxml2::XMLElement* elem)
override;
123 void FromCSVFile(
const std::string& file);
131 void SetOrientation(
const vnl_quaternion<mitk::ScalarType>& orientation);
135 void SetOrientation(
const vnl_quaternion<float>& orientation);
139 void SetTranslation(
const vnl_vector_fixed<mitk::ScalarType, 3>& transl);
143 void SetTranslation(
const vnl_vector<double>& transl);
151 void SetRotation( vnl_matrix_fixed<mitk::ScalarType, 3, 3>& mat);
155 void SetRotation( vnl_matrix<mitk::ScalarType>& mat);
159 void SetMatrix(
const vnl_matrix_fixed<mitk::ScalarType, 4, 4>& mat);
163 void SetMatrix(
const vtkMatrix4x4* mat);
167 void SetTranslation(
float* array );
173 void SetRotation(
float* array );
177 void SetTranslation(
double array[3] );
181 void SetRotation(
double array[3][3] );
186 void SetTranslation(
const cv::Mat& transl);
190 void SetRotation(
const cv::Mat& mat );
194 void SetRotationVector(
const cv::Mat& rotVec);
199 mitk::NavigationData::Pointer GetNavigationData()
const;
211 bool IsValid()
const;
215 void SetValid(
bool valid);
225 vnl_matrix_fixed<mitk::ScalarType, 4, 4> GetMatrix()
const;
229 void GetMatrix(vtkMatrix4x4* matrix)
const;
234 void GetVtkOpenGlMatrix(vtkMatrix4x4* matrix)
const;
241 void ToXML(tinyxml2::XMLElement* elem)
const override;
245 std::string ToString()
const;
249 std::string ToCSVString()
const;
253 std::string ToMatlabString(
const std::string& varname=
"transform",
254 bool printLastRow=
true)
const;
258 void ToCSVFile(
const std::string& file)
const;
262 void ToMatlabFile(
const std::string& file
263 ,
const std::string& varname=
"transform")
const;
267 cv::Mat GetCvTranslation()
const;
268 cv::Mat GetCvRotationVector()
const;
269 cv::Mat GetCvRotationMatrix()
const;
270 cv::Mat GetCvMatrix()
const;
275 vnl_vector_fixed<mitk::ScalarType, 3> GetVnlTranslation()
const;
276 vnl_vector_fixed<double, 3> GetVnlDoubleTranslation()
const;
277 vnl_quaternion<double> GetVnlDoubleQuaternion()
const;
278 vnl_matrix_fixed<mitk::ScalarType, 3, 3> GetVnlRotationMatrix()
const;
279 vnl_matrix_fixed<double, 4, 4> GetVnlDoubleMatrix()
const;
297 MITKCAMERACALIBRATION_EXPORT std::ostream&
operator<<
298 (std::ostream& os, mitk::Transform::Pointer p);