34 #ifndef CXELASTIXEXECUTER_H_
35 #define CXELASTIXEXECUTER_H_
46 #include "org_custusx_registration_method_commandline_Export.h"
77 void setDisplayProcessMessages(
bool on);
79 bool setInput(QString application,
83 QStringList parameterfiles);
84 virtual void execute();
85 virtual bool isFinished()
const;
86 virtual bool isRunning()
const;
94 QString getNonlinearResultVolume(
bool* ok = 0);
97 void processStateChanged(QProcess::ProcessState newState);
98 void processError(QProcess::ProcessError error);
99 void processFinished(
int, QProcess::ExitStatus);
100 void processReadyRead();
106 QString writeInitTransformToElastixfile(
DataPtr fixed,
DataPtr moving, QString outdir);
110 QString writeInitTransformToCalfile(
DataPtr fixed,
DataPtr moving, QString outdir);
115 QString findMostRecentTransformOutputFile()
const;
168 QString readParameterRawValue(QString key);
195 retval.
mAngles_xyz = M.matrix().block<3, 3> (0, 0).eulerAngles(0, 1, 2);
217 std::cout <<
"==========TEST==============" << std::endl;
223 std::cout <<
"M\n" << M << std::endl;
224 std::cout <<
"Q\n" << Q << std::endl;
226 std::cout <<
"Q*M.inv\n" << diff << std::endl;
227 if (!
similar(Transform3D::Identity(), diff))
228 reportError(
"assertion failure in ElastixEulerTransform");
236 m = Eigen::AngleAxisd(
mAngles_xyz[0], Eigen::Vector3d::UnitX())
237 * Eigen::AngleAxisd(
mAngles_xyz[1], Eigen::Vector3d::UnitY())
238 * Eigen::AngleAxisd(
mAngles_xyz[2], Eigen::Vector3d::UnitZ());
241 R.matrix().block<3, 3> (0, 0) = m;
ElastixParameterFile(QString filename)
Transform3D createTransformRotateY(const double angle)
QString readParameterString(QString key)
void reportError(QString msg)
Base class for algorithms that wants to time their execution.
int readParameterInt(QString key)
Transform3D Transform3D
Transform3D is a representation of an affine 3D transform.
bool similar(const DoubleBoundingBox3D &a, const DoubleBoundingBox3D &b, double tol)
boost::shared_ptr< class Data > DataPtr
ElastiX command-line wrapper.
Transform3D createTransformTranslate(const Vector3D &translation)
bool readParameterBool(QString key)
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
std::vector< double > readParameterDoubleVector(QString key)
Transform3D createTransformRotateX(const double angle)
Transform3D readEulerTransform()
Transform3D readAffineTransform()