35 #ifndef AIMS_TALAIRACH_TALBOX_H 36 #define AIMS_TALAIRACH_TALBOX_H 58 template<
class T >
inline 61 int x, y, z, dx = d.
dimX(), dy = d.
dimY(), dz = d.
dimZ();
63 Point3df boxmax( -10000.0f, -10000.0f, -10000.0f );
64 Point3df boxmin( 10000.0f, 10000.0f, 10000.0f );
67 for ( z=0; z<dz; z++ )
68 for ( y=0; y<dy; y++ )
69 for ( x=0; x<dx; x++ )
72 pt =
Point3df(
float( x ),
float( y ),
float( z ) );
73 pt[ 0 ] *= dsize[ 0 ];
74 pt[ 1 ] *= dsize[ 1 ];
75 pt[ 2 ] *= dsize[ 2 ];
78 if ( npt[ 0 ] < boxmin[ 0 ] ) boxmin[ 0 ] = npt[ 0 ];
79 if ( npt[ 1 ] < boxmin[ 1 ] ) boxmin[ 1 ] = npt[ 1 ];
80 if ( npt[ 2 ] < boxmin[ 2 ] ) boxmin[ 2 ] = npt[ 2 ];
81 if ( npt[ 0 ] > boxmax[ 0 ] ) boxmax[ 0 ] = npt[ 0 ];
82 if ( npt[ 1 ] > boxmax[ 1 ] ) boxmax[ 1 ] = npt[ 1 ];
83 if ( npt[ 2 ] > boxmax[ 2 ] ) boxmax[ 2 ] = npt[ 2 ];
86 if ( fabs( boxmin[ 0 ] ) > fabs( boxmax[ 0 ] ) )
87 _scale[ 0 ] = 1.0f / fabs( boxmin[ 0 ] );
88 else _scale[ 0 ] = 1.0f / fabs( boxmax[ 0 ] );
90 std::cout <<
"Box Min : " << boxmin <<
"\tBox Max :" << boxmax << std::endl ;
91 _scale[ 1 ] = 1.0f / fabs( boxmax[ 1 ] );
94 _scale[ 2 ] = 1.0f / fabs( boxmin[ 2 ] );
98 template<
class T >
inline 123 std::cout <<
"Scale : " <<
_scale << std::endl ;
virtual Motion computeTransformation(const TalairachPoints &)
Motion computeTransformationAndBox(const TalairachPoints &, const AimsData< T > &)
void computeBox(const AimsData< T > &)
Point3df toTalairach(const Point3df &)