17 #ifndef __itkEllipsoidInteriorExteriorSpatialFunction_txx
18 #define __itkEllipsoidInteriorExteriorSpatialFunction_txx
26 template <
unsigned int VDimension,
typename TInput>
30 m_Orientations =
NULL;
35 template <
unsigned int VDimension,
typename TInput >
42 for(i = 0; i < VDimension; i++)
44 delete []m_Orientations[i];
46 delete []m_Orientations;
50 template <
unsigned int VDimension,
typename TInput>
55 double distanceSquared = 0;
62 for(
unsigned int i = 0; i < VDimension; i++)
64 pointVector[i] = position[i] - m_Center[i];
67 for(
unsigned int i = 0; i < VDimension; i++)
69 for(
unsigned int j = 0; j < VDimension; j++)
71 orientationVector[j] = m_Orientations[i][j];
73 distanceSquared += vcl_pow(static_cast<double>((orientationVector * pointVector)/(.5*m_Axes[i])),static_cast<double>(2));
76 if(distanceSquared <= 1)
84 template <
unsigned int VDimension,
typename TInput>
92 for(i = 0; i < VDimension; i++)
94 delete []m_Orientations[i];
96 delete []m_Orientations;
98 m_Orientations =
new double * [VDimension];
99 for(i = 0; i < VDimension; i++)
101 m_Orientations[i] =
new double[VDimension];
105 for(i = 0; i < VDimension; i++)
107 for(j = 0; j < VDimension; j++)
109 m_Orientations[i][j] = orientations[i][j];
114 template <
unsigned int VDimension,
typename TInput>
120 Superclass::PrintSelf(os, indent);
122 os << indent <<
"Lengths of Ellipsoid Axes: " << m_Axes << std::endl;
123 os << indent <<
"Origin of Ellipsoid: " << m_Center << std::endl;
126 os << indent <<
"Orientations: " << std::endl;
127 for (i = 0; i < VDimension; i++)
129 for (j = 0; j < VDimension; j++)
131 os << indent << indent << m_Orientations[i][j] <<
" ";