OpenWalnut  1.5.0dev
WTalairachConverter.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WTALAIRACHCONVERTER_H
26 #define WTALAIRACHCONVERTER_H
27 
28 #include <memory>
29 
30 
31 #include "core/common/math/WMatrix.h"
32 #include "core/common/math/linearAlgebra/WVectorFixed.h"
33 
34 /**
35  * class to provide conversions between world or voxel space coordinates und Talairach coordinates
36  */
38 {
39 public:
40  /**
41  * constructor
42  *
43  * \param ac anterior point
44  * \param pc posterior point
45  * \param ihp interhemispherical plane
46  */
48 
49  /**
50  * destructor
51  */
52  virtual ~WTalairachConverter();
53 
54  /**
55  * Canonical2ACPC
56  *
57  * \param point the coordinates to transform
58  *
59  * \return vector
60  */
61  WVector3d Canonical2ACPC( const WVector3d point );
62 
63  /**
64  * ACPC2Canonical
65  *
66  * \param point the coordinates to transform
67  *
68  * \return vector
69  */
70  WVector3d ACPC2Canonical( const WVector3d point );
71 
72  /**
73  * Canonical2Talairach
74  *
75  * \param point the coordinates to transform
76  *
77  * \return vector
78  */
80 
81  /**
82  * Talairach2Canonical
83  *
84  * \param point the coordinates to transform
85  *
86  * \return vector
87  */
89 
90  /**
91  * ACPC2Talairach
92  *
93  * \param point the coordinates to transform
94  *
95  * \return vector
96  */
97  WVector3d ACPC2Talairach( const WVector3d point );
98 
99  /**
100  * Talairach2ACPC
101  *
102  * \param point the coordinates to transform
103  *
104  * \return vector
105  */
106  WVector3d Talairach2ACPC( const WVector3d point );
107 
108  /**
109  * getter for ac
110  *
111  * \return vector
112  */
113  WVector3d getAc() const;
114 
115  /**
116  * setter for ac
117  *
118  * \param ac coordinate of point
119  */
120  void setAc( WVector3d ac );
121 
122  /**
123  * getter for pc
124  *
125  * \return vector
126  */
127  WVector3d getPc() const;
128 
129  /**
130  * setter for pc
131  *
132  * \param pc coordinate of point
133  */
134  void setPc( WVector3d pc );
135 
136  /**
137  * getter for ihp
138  *
139  * \return vector
140  */
141  WVector3d getIhp() const;
142 
143  /**
144  * setter for ihp
145  *
146  * \param ihp coordinate of point
147  */
148  void setIhp( WVector3d ihp );
149 
150  /**
151  * getter for ap
152  *
153  * \return vector
154  */
155  WVector3d getAp() const;
156 
157  /**
158  * setter for ap
159  *
160  * \param ap coordinate of point
161  */
162  void setAp( WVector3d ap );
163 
164  /**
165  * getter for pp
166  *
167  * \return vector
168  */
169  WVector3d getPp() const;
170 
171  /**
172  * setter for pp
173  *
174  * \param pp coordinate of point
175  */
176  void setPp( WVector3d pp );
177 
178  /**
179  * getter for sp
180  *
181  * \return vector
182  */
183  WVector3d getSp() const;
184 
185  /**
186  * setter for sp
187  *
188  * \param sp coordinate of point
189  */
190  void setSp( WVector3d sp );
191 
192  /**
193  * getter for ip
194  *
195  * \return vector
196  */
197  WVector3d getIp() const;
198 
199  /**
200  * setter for ip
201  *
202  * \param ip coordinate of point
203  */
204  void setIp( WVector3d ip );
205 
206  /**
207  * getter for rp
208  *
209  * \return vector
210  */
211  WVector3d getRp() const;
212 
213  /**
214  * setter for rp
215  *
216  * \param rp coordinate of point
217  */
218  void setRp( WVector3d rp );
219 
220  /**
221  * getter for lp
222  *
223  * \return vector
224  */
225  WVector3d getLp() const;
226 
227  /**
228  * setter for lp
229  *
230  * \param lp coordinate of point
231  */
232  void setLp( WVector3d lp );
233 
234  /**
235  * getter for the rotation matrix
236  *
237  * \return the rotation matrix
238  */
240 
241  /**
242  * getter for the inverted rotation matrix
243  *
244  * \return the inverted rotation matrix
245  */
247 
248  /**
249  * projected interhemispherical point
250  */
252 protected:
253 private:
254  /**
255  * helper routine to create the rotation matrix from the given points
256  */
257  void defineRotationMatrix();
258 
259  WMatrix<double> m_rotMat; //!< the rotation matrix
260  WMatrix<double> m_rotMatInvert; //!< the inverted rotation matrix
261 
262  WVector3d m_ac; //!< anterior commisure
263  WVector3d m_pc; //!< inferior commisure
264  WVector3d m_ihp; //!< inter hemispherical point
265 
266  WVector3d m_ap; //!< anterior point
267  WVector3d m_pp; //!< posterior point
268  WVector3d m_sp; //!< superior point
269  WVector3d m_ip; //!< inferior point
270  WVector3d m_rp; //!< right point
271  WVector3d m_lp; //!< left point
272 };
273 
274 #endif // WTALAIRACHCONVERTER_H
class to provide conversions between world or voxel space coordinates und Talairach coordinates
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
WVector3d m_lp
left point
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