#include <itkPointShell.h>
Static Public Member Functions | |
static TMatrixType * | DistributePointShell () |
Definition at line 31 of file itkPointShell.h.
TMatrixType * itk::PointShell< NPoints, TMatrixType >::DistributePointShell | ( | ) | [static] |
Definition at line 16 of file itkPointShell.txx.
References DIST_POINTSHELL_PI, and QuadProgPP::sqrt().
{ vnl_vector_fixed<double,NPoints> *theta = new vnl_vector_fixed<double,NPoints>(); vnl_vector_fixed<double,NPoints> *phi = new vnl_vector_fixed<double,NPoints>(); double C = sqrt(4*DIST_POINTSHELL_PI); (*phi)(0) = 0.0; (*phi)(NPoints-1) = 0.0; for(int i=0; i<NPoints; i++) { (*theta)(i) = acos(-1.0+2.0*i/(NPoints-1.0)) - DIST_POINTSHELL_PI / 2.0; if( i>0 && i<NPoints-1) { (*phi)(i) = ((*phi)(i-1) + C / sqrt(NPoints*(1-(-1.0+2.0*i/(NPoints-1.0))*(-1.0+2.0*i/(NPoints-1.0))))); // % (2*DIST_POINTSHELL_PI); } } vnl_matrix_fixed<double, 3, NPoints> *pointshell = new vnl_matrix_fixed<double, 3, NPoints>(); for(int i=0; i<NPoints; i++) { (*pointshell)(0,i) = cos((*theta)(i)) * cos((*phi)(i)); (*pointshell)(1,i) = cos((*theta)(i)) * sin((*phi)(i)); (*pointshell)(2,i) = sin((*theta)(i)); } return pointshell; }