18 #ifndef __itkPSMImplicitSurfaceDomain_h 19 #define __itkPSMImplicitSurfaceDomain_h 21 #include "itkPSMImageDomainWithCurvature.h" 34 template <
class T,
unsigned int VDimension>
42 typedef SmartPointer<Self> Pointer;
43 typedef SmartPointer<const Self> ConstPointer;
44 typedef WeakPointer<const Self> ConstWeakPointer;
45 typedef typename Superclass::ImageType
ImageType;
46 typedef typename Superclass::PointType
PointType;
56 itkStaticConstMacro(Dimension,
unsigned int, VDimension);
60 itkSetMacro(Tolerance, T);
61 itkGetMacro(Tolerance, T);
73 virtual bool ApplyConstraints(PointType &p)
const;
77 virtual bool ApplyVectorConstraints(vnl_vector_fixed<double, VDimension> &gradE,
79 double maxtimestep)
const;
87 virtual double Distance(
const PointType &,
const PointType &)
const;
89 void SetCuttingPlane(
const vnl_vector<double> &a,
const vnl_vector<double> &b,
90 const vnl_vector<double> &c);
92 void RemoveCuttingPlane() { m_UseCuttingPlane =
false; }
94 bool IsCuttingPlaneDefined()
const {
return m_UseCuttingPlane;}
96 const vnl_vector_fixed<double, VDimension> &GetCuttingPlanePoint()
const 97 {
return m_CuttingPlanePoint; }
98 const vnl_vector_fixed<double, VDimension> &GetCuttingPlaneNormal()
const 99 {
return m_CuttingPlaneNormal; }
104 void AddSphere(
const vnl_vector_fixed<double,VDimension> &v,
double r)
108 m_SphereCenterList.push_back(v);
109 m_SphereRadiusList.push_back(r);
116 if (m_SphereRadiusList.size() > i)
return m_SphereRadiusList[i];
124 if (m_SphereRadiusList.size() > i)
return m_SphereCenterList[i];
126 {
return vnl_vector_fixed<double, VDimension>(0.0,0.0,0.0); }
129 unsigned int GetNumberOfSpheres()
const 131 return m_SphereCenterList.size();
140 void PrintSelf(std::ostream& os, Indent indent)
const 142 Superclass::PrintSelf(os, indent);
143 os << indent <<
"m_Tolerance = " << m_Tolerance << std::endl;
148 PixelType m_Tolerance;
149 bool m_UseCuttingPlane;
150 vnl_vector_fixed<double, VDimension> m_CuttingPlanePoint;
151 vnl_vector_fixed<double, VDimension> m_CuttingPlaneNormal;
153 std::vector< vnl_vector_fixed<double, VDimension> > m_SphereCenterList;
154 std::vector< double > m_SphereRadiusList;
157 void operator=(
const Self&);
162 #ifndef ITK_MANUAL_INSTANTIATION 163 #include "itkPSMImplicitSurfaceDomain.hxx" Image< T, VDimension > ImageType
PSMImplicitSurfaceDomain Self
vnl_vector_fixed< double, VDimension > GetSphereCenter(unsigned int i) const
double GetSphereRadius(unsigned int i) const
void AddSphere(const vnl_vector_fixed< double, VDimension > &v, double r)