18 #ifndef __itkPSMMeanCurvatureAttribute_h 19 #define __itkPSMMeanCurvatureAttribute_h 21 #include "itkDataObject.h" 22 #include "itkWeakPointer.h" 23 #include "itkPSMContainer.h" 24 #include "itkPSMContainerArrayAttribute.h" 25 #include "itkPSMImageDomainWithCurvature.h" 26 #include "itkPSMParticleSystem.h" 33 template <
class TNumericType,
unsigned int VDimension>
42 typedef SmartPointer<Self> Pointer;
43 typedef SmartPointer<const Self> ConstPointer;
44 typedef WeakPointer<const Self> ConstWeakPointer;
49 typedef vnl_vector_fixed<TNumericType, VDimension> VnlVectorType;
57 virtual void PositionAddEventCallback(Object *o,
const EventObject &e)
59 Superclass::PositionAddEventCallback(o, e);
60 const ParticlePositionAddEvent &
event =
dynamic_cast<const ParticlePositionAddEvent &
>(e);
61 const ParticleSystemType *ps =
dynamic_cast<const ParticleSystemType *
>(o);
62 this->ComputeMeanCurvature(ps, event.GetPositionIndex(),
event.GetDomainIndex());
65 virtual void PositionSetEventCallback(Object *o,
const EventObject &e)
67 const ParticlePositionSetEvent &
event =
dynamic_cast<const ParticlePositionSetEvent &
>(e);
68 const ParticleSystemType *ps=
dynamic_cast<const ParticleSystemType *
>(o);
69 this->ComputeMeanCurvature(ps, event.GetPositionIndex(),
event.GetDomainIndex());
74 Superclass::DomainAddEventCallback(o, e);
75 m_MeanCurvatureList.push_back(0.0);
76 m_CurvatureStandardDeviationList.push_back(0.0);
77 const ParticleDomainAddEvent &
event =
dynamic_cast<const ParticleDomainAddEvent &
>(e);
78 const ParticleSystemType *ps=
dynamic_cast<const ParticleSystemType *
>(o);
79 this->ComputeCurvatureStatistics(ps, event.GetDomainIndex());
83 inline void ComputeMeanCurvature(
const ParticleSystemType *system,
84 unsigned int idx,
unsigned int dom)
93 this->operator[](dom)->operator[](idx) = domain->GetCurvature(pos);
98 virtual void ComputeCurvatureStatistics(
const ParticleSystemType *,
unsigned int d);
100 double GetMeanCurvature(
int d)
101 {
return m_MeanCurvatureList[d]; }
102 double GetCurvatureStandardDeviation(
int d)
103 {
return m_CurvatureStandardDeviationList[d];}
108 this->m_DefinedCallbacks.PositionSetEvent =
true;
109 this->m_DefinedCallbacks.DomainAddEvent =
true;
113 void PrintSelf(std::ostream& os, Indent indent)
const 114 { Superclass::PrintSelf(os,indent); }
118 void operator=(
const Self&);
120 std::vector<double> m_MeanCurvatureList;
121 std::vector<double> m_CurvatureStandardDeviationList;
127 #ifndef ITK_MANUAL_INSTANTIATION 128 #include "itkPSMMeanCurvatureAttribute.hxx"
PointType & GetPosition(unsigned long int k, unsigned int d=0)
virtual void DomainAddEventCallback(Object *o, const EventObject &e)
A facade class that manages interactions with a particle system.
DomainType * GetDomain(unsigned int i)
Base class for PSMParticleSystem attribute classes.
PSMParticleSystem< VDimension > ParticleSystemType