32#ifndef FIFF_COORD_TRANS_H
33#define FIFF_COORD_TRANS_H
49#include <QSharedPointer>
85 using SPtr = QSharedPointer<FiffCoordTrans>;
86 using ConstSPtr = QSharedPointer<const FiffCoordTrans>;
87 using UPtr = std::unique_ptr<FiffCoordTrans>;
88 using ConstUPtr = std::unique_ptr<const FiffCoordTrans>;
176 return this->
from < 0;
195 return trans.block<3, 3>(0, 0);
204 return trans.block<3, 3>(0, 0);
214 return trans.block<3, 1>(0, 3);
223 return trans.block<3, 1>(0, 3);
342 Eigen::MatrixX3f
apply_trans(
const Eigen::MatrixX3f& rr,
bool do_move =
true)
const;
542 const Eigen::MatrixXf& fromp,
543 const Eigen::MatrixXf& top,
544 const Eigen::VectorXf& w,
550 Eigen::Matrix<float, 4, 4, Eigen::DontAlign>
trans;
551 Eigen::Matrix<float, 4, 4, Eigen::DontAlign>
invtrans;
576#ifndef metatype_fiffcoordtrans
577#define metatype_fiffcoordtrans
581#ifndef metatype_fiffcoordtrans_sptr
582#define metatype_fiffcoordtrans_sptr
FIFF binary tag-stream layer: wraps a QIODevice to read and write FIFF tags, directories,...
Q_DECLARE_METATYPE(FIFFLIB::FiffCoordTrans)
Export/import macros and build-info accessors for the FIFFLIB shared library.
#define FIFFSHARED_EXPORT
Recursive node of the parsed FIFF block tree (FIFFB_* hierarchy with directory entries and children).
Primitive scalar typedefs and forward-compatible aliases backing the FIFF type system.
FIFF file I/O, in-memory data structures and high-level readers/writers.
bool operator==(const FiffChInfo &a, const FiffChInfo &b)
Labelled 4x4 FIFF affine: source frame, destination frame, rotation, translation and cached inverse.
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > invtrans
static qint32 storageSize()
static FiffCoordTrans procrustesAlign(int from_frame, int to_frame, const Eigen::MatrixXf &fromp, const Eigen::MatrixXf &top, const Eigen::VectorXf &w, float max_diff)
static FiffCoordTrans combine(int from, int to, const FiffCoordTrans &t1, const FiffCoordTrans &t2)
static QString frame_name(int frame)
static FiffCoordTrans readTransformFromNode(FiffStream::SPtr &stream, const FiffDirNode::SPtr &node, int from, int to)
friend bool operator==(const FiffCoordTrans &a, const FiffCoordTrans &b)
QSharedPointer< FiffCoordTrans > SPtr
FiffCoordTrans(int from, int to, const Eigen::Matrix3f &rot, const Eigen::Vector3f &move)
FiffCoordTrans & operator=(const FiffCoordTrans &p_FiffCoordTrans)=default
void writeToStream(FiffStream *p_pStream)
Writes the transformation to a FIFF stream.
static FiffCoordTrans readMeasTransform(const QString &name)
static FiffCoordTrans readFShead2mriTransform(const QString &name)
static void apply_inverse_trans(float r[3], const FiffCoordTrans &t, bool do_move)
FiffCoordTrans(int from, int to, const Eigen::Matrix4f &matTrans, bool bStandard=false)
FiffCoordTrans(QIODevice &p_IODevice)
QSharedPointer< const FiffCoordTrans > ConstSPtr
std::unique_ptr< FiffCoordTrans > UPtr
Eigen::MatrixX3f apply_inverse_trans(const Eigen::MatrixX3f &rr, bool do_move=true) const
bool write(QIODevice &p_IODevice)
Writes the transformation to file.
static FiffCoordTrans readMriTransform(const QString &name)
static FiffCoordTrans readTransformAscii(const QString &name, int from, int to)
static bool read(QIODevice &p_IODevice, FiffCoordTrans &p_Trans)
FiffCoordTrans inverted() const
Eigen::MatrixX3f apply_trans(const Eigen::MatrixX3f &rr, bool do_move=true) const
float angleTo(Eigen::MatrixX4f mTransDest)
static FiffCoordTrans identity(int from, int to)
static FiffCoordTrans fromCardinalPoints(int from, int to, const float *rL, const float *rN, const float *rR)
FiffCoordTrans(const FiffCoordTrans &p_FiffCoordTrans)
std::unique_ptr< const FiffCoordTrans > ConstUPtr
float translationTo(Eigen::MatrixX4f mTransDest)
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > trans
static void apply_trans(float r[3], const FiffCoordTrans &t, bool do_move)
static FiffCoordTrans readTransform(const QString &name, int from, int to)
static bool addInverse(FiffCoordTrans &t)
static FiffCoordTrans readFromTag(const std::unique_ptr< FiffTag > &tag)
QSharedPointer< FiffDirNode > SPtr
FIFF tag-stream reader/writer: wraps a QIODevice and exposes typed read_* / write_* methods for every...
QSharedPointer< FiffStream > SPtr
FIFF tag: 16-byte header (kind, type, size, next) plus payload, with typed decoders for every FIFFT_*...