25 #include "WTalairachConverter.h"
26 #include "core/common/math/WLinearAlgebraFunctions.h"
30 m_rotMatInvert( 3, 3 ),
58 return multMatrixWithVector3D(
m_rotMat, rpoint );
92 double X1 = fabs(
m_pp[0] -
m_pc[0] );
93 double X2 = fabs(
m_ac[0] -
m_pc[0] );
94 double X3 = fabs(
m_ap[0] -
m_ac[0] );
95 double Y1 = fabs(
m_ac[1] -
m_rp[1] );
96 double Y2 = fabs(
m_lp[1] -
m_ac[1] );
97 double Z1 = fabs(
m_ac[2] -
m_ip[2] );
98 double Z2 = fabs(
m_sp[2] -
m_ac[2] );
114 xt = ( X1T / X1 ) * ( x + X2 ) - X2T;
118 xt = ( X3T / X3 ) * x;
122 xt = ( X2T / X2 ) * x;
127 yt = ( Y1T / Y1 ) * y;
131 yt = ( Y2T / Y2 ) * y;
136 zt = ( Z1T / Z1 ) * z;
140 zt = ( Z2T / Z2 ) * z;
149 double xt = point[0];
150 double yt = point[1];
151 double zt = point[2];
161 double X1 = fabs(
m_pp[0] -
m_pc[0] );
162 double X2 = fabs(
m_ac[0] -
m_pc[0] );
163 double X3 = fabs(
m_ap[0] -
m_ac[0] );
164 double Y1 = fabs(
m_ac[1] -
m_rp[1] );
165 double Y2 = fabs(
m_lp[1] -
m_ac[1] );
166 double Z1 = fabs(
m_ac[2] -
m_ip[2] );
167 double Z2 = fabs(
m_sp[2] -
m_ac[2] );
184 x = ( X1 / X1T ) * ( xt + X2T ) - X2;
188 x = ( X3 / X3T ) * xt;
192 x = ( X2 / X2T ) * xt;
197 y = ( Y1 / Y1T ) * yt;
201 y = ( Y2 / Y2T ) * yt;
206 z = ( Z1 / Z1T ) * zt;
210 z = ( Z2 / Z2T ) * zt;
221 float apnorm = v1[0] * v1[0] + v1[1] * v1[1] + v1[2] * v1[2];
224 float dist = v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
231 ex = normalize( ex );
233 ez = normalize( ez );
WVector3d getRp() const
getter for rp
WVector3d m_ihp_proj
projected interhemispherical point
void setLp(WVector3d lp)
setter for lp
WVector3d getLp() const
getter for lp
WVector3d m_ac
anterior commisure
WVector3d m_pc
inferior commisure
void setPp(WVector3d pp)
setter for pp
WVector3d ACPC2Talairach(const WVector3d point)
ACPC2Talairach.
void setRp(WVector3d rp)
setter for rp
virtual ~WTalairachConverter()
destructor
void setPc(WVector3d pc)
setter for pc
WVector3d getPc() const
getter for pc
WVector3d getIhp() const
getter for ihp
WVector3d m_rp
right point
WVector3d Canonical2ACPC(const WVector3d point)
Canonical2ACPC.
WVector3d m_ap
anterior point
WVector3d m_ip
inferior point
WMatrix< double > getRotMat()
getter for the rotation matrix
WVector3d getIp() const
getter for ip
WMatrix< double > m_rotMatInvert
the inverted rotation matrix
WVector3d getAc() const
getter for ac
void setSp(WVector3d sp)
setter for sp
WVector3d m_sp
superior point
WVector3d m_ihp
inter hemispherical point
WVector3d Canonical2Talairach(const WVector3d point)
Canonical2Talairach.
WVector3d Talairach2ACPC(const WVector3d point)
Talairach2ACPC.
void defineRotationMatrix()
helper routine to create the rotation matrix from the given points
void setIp(WVector3d ip)
setter for ip
WMatrix< double > getInvRotMat()
getter for the inverted rotation matrix
WMatrix< double > m_rotMat
the rotation matrix
void setIhp(WVector3d ihp)
setter for ihp
WTalairachConverter(WVector3d ac, WVector3d pc, WVector3d ihp)
constructor
WVector3d ACPC2Canonical(const WVector3d point)
ACPC2Canonical.
WVector3d getSp() const
getter for sp
void setAc(WVector3d ac)
setter for ac
WVector3d Talairach2Canonical(const WVector3d point)
Talairach2Canonical.
void setAp(WVector3d ap)
setter for ap
WVector3d m_pp
posterior point
WVector3d getAp() const
getter for ap
WVector3d getPp() const
getter for pp