MNE-CPP  0.1.9
A Framework for Electrophysiology
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
FIFFLIB::FiffCoordTrans Class Reference

Coordinate transformation description. More...

#include <fiff_coord_trans.h>

Public Types

typedef QSharedPointer< FiffCoordTransSPtr
 
typedef QSharedPointer< const FiffCoordTransConstSPtr
 

Public Member Functions

 FiffCoordTrans ()
 
 FiffCoordTrans (QIODevice &p_IODevice)
 
 FiffCoordTrans (const FiffCoordTrans &p_FiffCoordTrans)
 
 ~FiffCoordTrans ()
 
void clear ()
 
bool invert_transform ()
 
bool isEmpty () const
 
Eigen::MatrixX3f apply_trans (const Eigen::MatrixX3f &rr, bool do_move=true) const
 
Eigen::MatrixX3f apply_inverse_trans (const Eigen::MatrixX3f &rr, bool do_move=true) const
 
void print () const
 
void write (QIODevice &p_IODevice)
 Writes the transformation to file. More...
 
void writeToStream (FiffStream *p_pStream)
 Writes the transformation to stream. More...
 
float angleTo (Eigen::MatrixX4f mTransDest)
 
float translationTo (Eigen::MatrixX4f mTransDest)
 
FiffCoordTransOld toOld ()
 

Static Public Member Functions

static bool read (QIODevice &p_IODevice, FiffCoordTrans &p_Trans)
 
static QString frame_name (int frame)
 
static FiffCoordTrans make (int from, int to, const Eigen::Matrix3f &rot, const Eigen::VectorXf &move)
 
static FiffCoordTrans make (int from, int to, const Eigen::Matrix4f &matTrans, bool bStandard=false)
 
static bool addInverse (FiffCoordTrans &t)
 
static qint32 storageSize ()
 

Public Attributes

fiff_int_t from
 
fiff_int_t to
 
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > trans
 
Eigen::Matrix< float, 4, 4, Eigen::DontAlign > invtrans
 

Friends

bool operator== (const FiffCoordTrans &a, const FiffCoordTrans &b)
 

Detailed Description

Coordinate transformation description.

Coordinate transformation description which replaces fiffCoordTransRec which had a size of 104

Definition at line 74 of file fiff_coord_trans.h.

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const FiffCoordTrans> FIFFLIB::FiffCoordTrans::ConstSPtr

Const shared pointer type for FiffCoordTrans.

Definition at line 78 of file fiff_coord_trans.h.

◆ SPtr

Shared pointer type for FiffCoordTrans.

Definition at line 77 of file fiff_coord_trans.h.

Constructor & Destructor Documentation

◆ FiffCoordTrans() [1/3]

FiffCoordTrans::FiffCoordTrans ( )

Constructs the coordinate transformation descriptor.

Definition at line 69 of file fiff_coord_trans.cpp.

◆ FiffCoordTrans() [2/3]

FiffCoordTrans::FiffCoordTrans ( QIODevice &  p_IODevice)

Constructs a coordinate transformation, by reading from a IO device.

Parameters
[in]p_IODeviceIO device to read from the coordinate transform.

Definition at line 79 of file fiff_coord_trans.cpp.

◆ FiffCoordTrans() [3/3]

FiffCoordTrans::FiffCoordTrans ( const FiffCoordTrans p_FiffCoordTrans)

Copy constructor.

Parameters
[in]p_FiffCoordTransCoordinate transformation description which should be copied.

Definition at line 94 of file fiff_coord_trans.cpp.

◆ ~FiffCoordTrans()

FiffCoordTrans::~FiffCoordTrans ( )

Destroys the coordinate transformation descriptor.

Definition at line 104 of file fiff_coord_trans.cpp.

Member Function Documentation

◆ addInverse()

bool FiffCoordTrans::addInverse ( FiffCoordTrans t)
static

MNE C root function ###: Definition of the add_inverse function

Parameters
[in]tFiff coordinate transform to which the inverse should be added.
Returns
True when successful.

Definition at line 265 of file fiff_coord_trans.cpp.

◆ angleTo()

float FiffCoordTrans::angleTo ( Eigen::MatrixX4f  mTransDest)

Calculate rotation as angle between two rotation matrices

Parameters
[in]mTransDestThe destination transformation matrix.
Returns
fAgle The of rotation between two rotation matrices in degree.

Definition at line 285 of file fiff_coord_trans.cpp.

◆ apply_inverse_trans()

MatrixX3f FiffCoordTrans::apply_inverse_trans ( const Eigen::MatrixX3f &  rr,
bool  do_move = true 
) const

Applies the inverse coordinate transform to given coordinates and returns the transformed coordinates

Parameters
[in]rrThe coordinates.
[in]do_movePerform translation next to rotation yes/no.
Returns
Transformed coordinates.

Definition at line 193 of file fiff_coord_trans.cpp.

◆ apply_trans()

MatrixX3f FiffCoordTrans::apply_trans ( const Eigen::MatrixX3f &  rr,
bool  do_move = true 
) const

MNE toolbox root function ###: Definition of the mne_transform_source_space_to function

TODO: dest - The id of the destination coordinate system (FIFFV_COORD_...)

Applies the coordinate transform to given coordinates and returns the transformed coordinates

Parameters
[in]rrThe coordinates.
[in]do_movePerform translation next to rotation yes/no.
Returns
Transformed coordinates.

Definition at line 184 of file fiff_coord_trans.cpp.

◆ clear()

void FiffCoordTrans::clear ( )

Initializes the coordinate transformation descriptor.

Definition at line 110 of file fiff_coord_trans.cpp.

◆ frame_name()

QString FiffCoordTrans::frame_name ( int  frame)
static

MNE C root function ###: Definition of the mne_coord_frame_name function

Map coordinate frame integers to human-readable names

Parameters
[in]frameThe coordinate frame integer.
Returns
Human readable form of the coordinate frame.

Definition at line 202 of file fiff_coord_trans.cpp.

◆ invert_transform()

bool FiffCoordTrans::invert_transform ( )

MNE toolbox root function ###: Definition of the fiff_invert_transform function

Invert a coordinate transformation (actual obsolete - cause trans and inverse are both stored)

Returns
true if succeeded, false otherwise.

Definition at line 120 of file fiff_coord_trans.cpp.

◆ isEmpty()

bool FIFFLIB::FiffCoordTrans::isEmpty ( ) const
inline

Returns true if coordinate transform contains no data.

Returns
true if coordinate transform is empty.

Definition at line 131 of file fiff_coord_trans.h.

◆ make() [1/2]

static FiffCoordTrans FIFFLIB::FiffCoordTrans::make ( int  from,
int  to,
const Eigen::Matrix3f &  rot,
const Eigen::VectorXf &  move 
)
static

MNE C root function ###: Definition of the fiff_make_transform function

Compose the coordinate transformation structure from a known forward transform

Parameters
[in]fromSource coordinate system.
[in]toDestination coordinate system.
[in]rotThe forward transform (rotation part).
[in]moveThe forward transform (translation part).
Returns
the composed transform.

◆ make() [2/2]

static FiffCoordTrans FIFFLIB::FiffCoordTrans::make ( int  from,
int  to,
const Eigen::Matrix4f &  matTrans,
bool  bStandard = false 
)
static

Compose the coordinate transformation structure from a known forward transform

Parameters
[in]fromSource coordinate system.
[in]toDestination coordinate system.
[in]matTransThe forward transform.
[in]bStandardStandard transformation (no perspective projections, last row not zero) yes/no. Defaults to false.
Returns
the composed transform.

◆ print()

void FiffCoordTrans::print ( ) const

Prints the coordinate transform. TODO: overload stream operator Refactored: mne_print_coord_transform, mne_print_coord_transform_label (fiff_id.c)

Definition at line 273 of file fiff_coord_trans.cpp.

◆ read()

bool FiffCoordTrans::read ( QIODevice &  p_IODevice,
FiffCoordTrans p_Trans 
)
static

MNE toolbox root function ###: Definition of the mne_transform_coordinates function

Reads a coordinate transform from a fif file

Parameters
[in]p_IODeviceA fiff IO device like a fiff QFile or QTCPSocket.
[out]p_TransA coordinate transform from a fif file.
Returns
true if succeeded, false otherwise.

Definition at line 133 of file fiff_coord_trans.cpp.

◆ storageSize()

qint32 FIFFLIB::FiffCoordTrans::storageSize ( )
inlinestatic

Size of the old struct (fiffCoordTransRec) 26*int = 26*4 = 104

Returns
the size of the old struct fiffCoordTransRec.

Definition at line 318 of file fiff_coord_trans.h.

◆ toOld()

FiffCoordTransOld FiffCoordTrans::toOld ( )

Transform FiffCoordTrans to FiffCoordTransOld

Returns
The old FiffCoordTrans structure.

Definition at line 319 of file fiff_coord_trans.cpp.

◆ translationTo()

float FiffCoordTrans::translationTo ( Eigen::MatrixX4f  mTransDest)

Calculate translation between two rotation matrices in meter

Parameters
[in]mTransTargetThe destination transformation matrix.
Returns
fMove The translation between two rotation matrices in m.

Definition at line 308 of file fiff_coord_trans.cpp.

◆ write()

void FiffCoordTrans::write ( QIODevice &  p_IODevice)

Writes the transformation to file.

Parameters
[in]p_IODevice.

Definition at line 165 of file fiff_coord_trans.cpp.

◆ writeToStream()

void FiffCoordTrans::writeToStream ( FiffStream p_pStream)

Writes the transformation to stream.

Parameters
[in]p_pStream.

Definition at line 177 of file fiff_coord_trans.cpp.

Friends And Related Function Documentation

◆ operator==

bool operator== ( const FiffCoordTrans a,
const FiffCoordTrans b 
)
friend

Overloaded == operator to compare an object to this instance.

Parameters
[in]objectThe object which should be compared to.
Returns
true if equal, false otherwise.

Definition at line 325 of file fiff_coord_trans.h.

Member Data Documentation

◆ from

fiff_int_t FIFFLIB::FiffCoordTrans::from

Source coordinate system.

Definition at line 295 of file fiff_coord_trans.h.

◆ invtrans

Eigen::Matrix<float, 4,4, Eigen::DontAlign> FIFFLIB::FiffCoordTrans::invtrans

The inverse transform.

Definition at line 298 of file fiff_coord_trans.h.

◆ to

fiff_int_t FIFFLIB::FiffCoordTrans::to

Destination coordinate system.

Definition at line 296 of file fiff_coord_trans.h.

◆ trans

Eigen::Matrix<float, 4,4, Eigen::DontAlign> FIFFLIB::FiffCoordTrans::trans

The forward transform.

Definition at line 297 of file fiff_coord_trans.h.


The documentation for this class was generated from the following files: