Doxygen Source Code Documentation
thd_mnicoords.c File Reference
#include "mrilib.h"Go to the source code of this file.
Functions | |
| THD_fvec3 | THD_mni_to_tta (THD_fvec3 mv) |
| THD_fvec3 | THD_tta_to_mni (THD_fvec3 tv) |
| void | THD_3tta_to_3mni (float *x, float *y, float *z) |
| void | THD_3mni_to_3tta (float *x, float *y, float *z) |
Function Documentation
|
||||||||||||||||
|
Definition at line 59 of file thd_mnicoords.c. References LOAD_FVEC3, THD_mni_to_tta(), and THD_fvec3::xyz.
00060 {
00061 THD_fvec3 mv , tv ;
00062 LOAD_FVEC3( mv , *x,*y,*z ) ;
00063 tv = THD_mni_to_tta( mv ) ;
00064 *x = tv.xyz[0] ; *y = tv.xyz[1] ; *z = tv.xyz[2] ; return ;
00065 }
|
|
||||||||||||||||
|
Definition at line 51 of file thd_mnicoords.c. References LOAD_FVEC3, THD_tta_to_mni(), and THD_fvec3::xyz. Referenced by main().
00052 {
00053 THD_fvec3 mv , tv ;
00054 LOAD_FVEC3( tv , *x,*y,*z ) ;
00055 mv = THD_tta_to_mni( tv ) ;
00056 *x = mv.xyz[0] ; *y = mv.xyz[1] ; *z = mv.xyz[2] ; return ;
00057 }
|
|
|
Convert MNI coordinates (LPI) to TT Atlas coordinates (RAI); cf. http://www.mrc-cbu.cam.ac.uk/Imaging/mnispace.html. ------------------------------------------------------------------------- Definition at line 8 of file thd_mnicoords.c. References LOAD_FVEC3, and THD_fvec3::xyz. Referenced by AFNI_mnito_CB(), and THD_3mni_to_3tta().
00009 {
00010 float mx,my,mz , tx,ty,tz ;
00011 THD_fvec3 tv ;
00012
00013 mx = mv.xyz[0] ; my = mv.xyz[1] ; mz = mv.xyz[2] ;
00014
00015 tx = 0.99 * mx ;
00016
00017 if( mz > 0.0 ){
00018 ty = 0.9688 * my + 0.0460 * mz ;
00019 tz = -0.0485 * my + 0.9189 * mz ;
00020 } else {
00021 ty = 0.9688 * my + 0.0420 * mz ;
00022 tz = -0.0485 * my + 0.8390 * mz ;
00023 }
00024
00025 tx = -tx ; ty = -ty ; /* flip x,y from LPI to RAI */
00026
00027 LOAD_FVEC3( tv , tx,ty,tz ) ; return tv ;
00028 }
|
|
|
Convert TTA coordinates (RAI) to MNI coordinates (LPI). ------------------------------------------------------------------------- Definition at line 34 of file thd_mnicoords.c. References LOAD_FVEC3, and THD_fvec3::xyz. Referenced by THD_3tta_to_3mni(), and TT_whereami().
00035 {
00036 float mx,my,mz , tx,ty,tz ;
00037 THD_fvec3 mv ;
00038
00039 tx = -tv.xyz[0] ; ty = -tv.xyz[1] ; /* flip xy from RAI to LPI */
00040 tz = tv.xyz[2] ;
00041
00042 mx = 1.01010 * tx ;
00043 my = 1.02962 * ty - 0.05154 * tz ;
00044 mz = 0.05434 * ty + 1.08554 * tz ;
00045 if( mz < 0.0 ) mz *= 1.09523 ;
00046 LOAD_FVEC3( mv , mx,my,mz ) ; return mv ;
00047 }
|