Static Public Member Functions

itk::PointShell< NPoints, TMatrixType > Class Template Reference

#include <itkPointShell.h>

List of all members.

Static Public Member Functions

static TMatrixType * DistributePointShell ()

Detailed Description

template<int NPoints, class TMatrixType>
class itk::PointShell< NPoints, TMatrixType >

Definition at line 31 of file itkPointShell.h.


Member Function Documentation

template<int NPoints, class TMatrixType >
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;
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines