Doxygen Source Code Documentation
thd_getorient.c
Go to the documentation of this file.00001 #include "mrilib.h" 00002 00003 /*---------------------------------------------------------------------------*/ 00004 /*! Input is a dataset axes struct and an orientation code. 00005 Output is an int saying which dataset axis is this code. 00006 - +1 => dataset +x-axis 00007 - -1 => dataset -x-axis, etc. 00008 - 0 => bad inputs 00009 - RWCox - 19 Mar 2003 00010 -----------------------------------------------------------------------------*/ 00011 00012 int THD_get_axis_direction( THD_dataxes * daxes, int orient_code ) 00013 { 00014 if( daxes == NULL ) return 0; 00015 00016 if( daxes->xxorient == orient_code ) return 1 ; 00017 if( ORIENT_OPPOSITE(daxes->xxorient) == orient_code ) return -1 ; 00018 if( daxes->yyorient == orient_code ) return 2 ; 00019 if( ORIENT_OPPOSITE(daxes->yyorient) == orient_code ) return -2 ; 00020 if( daxes->zzorient == orient_code ) return 3 ; 00021 if( ORIENT_OPPOSITE(daxes->zzorient) == orient_code ) return -3 ; 00022 return 0 ; 00023 }