Shapeworks Studio  2.1
Shape analysis software suite
List of all members | Public Types | Public Member Functions | Protected Member Functions
itk::PSMMeanCurvatureAttribute< TNumericType, VDimension > Class Template Reference
+ Inheritance diagram for itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >:
+ Collaboration diagram for itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >:

Public Types

typedef TNumericType NumericType
 
typedef PSMMeanCurvatureAttribute Self
 
typedef PSMContainerArrayAttribute< TNumericType, VDimension > Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
typedef PSMParticleSystem< VDimension > ParticleSystemType
 
typedef ParticleSystemType::PointType PointType
 
typedef vnl_vector_fixed< TNumericType, VDimension > VnlVectorType
 
- Public Types inherited from itk::PSMContainerArrayAttribute< TNumericType, VDimension >
typedef TNumericType DataType
 
typedef PSMContainerArrayAttribute Self
 
typedef PSMAttribute< VDimension > Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
- Public Types inherited from itk::PSMAttribute< VDimension >
typedef PSMAttribute Self
 
typedef DataObject Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 

Public Member Functions

 itkNewMacro (Self)
 
 itkTypeMacro (PSMMeanCurvatureAttribute, PSMContainerArrayAttribute)
 
virtual void PositionAddEventCallback (Object *o, const EventObject &e)
 
virtual void PositionSetEventCallback (Object *o, const EventObject &e)
 
virtual void DomainAddEventCallback (Object *o, const EventObject &e)
 
void ComputeMeanCurvature (const ParticleSystemType *system, unsigned int idx, unsigned int dom)
 
virtual void ComputeCurvatureStatistics (const ParticleSystemType *, unsigned int d)
 
double GetMeanCurvature (int d)
 
double GetCurvatureStandardDeviation (int d)
 
- Public Member Functions inherited from itk::PSMContainerArrayAttribute< TNumericType, VDimension >
 itkNewMacro (Self)
 
 itkTypeMacro (PSMContainerArrayAttribute, PSMAttribute)
 
virtual void PositionRemoveEventCallback (Object *, const EventObject &)
 
void ZeroAllValues ()
 
- Public Member Functions inherited from itk::PSMAttribute< VDimension >
 itkNewMacro (Self)
 
 itkTypeMacro (PSMAttribute, DataObject)
 
virtual void EventCallback (Object *, const EventObject &)
 
virtual void EventWithIndexCallback (Object *, const EventObject &)
 
virtual void TransformSetEventCallback (Object *, const EventObject &)
 
virtual void PrefixTransformSetEventCallback (Object *, const EventObject &)
 
virtual void NeighborhoodSetEventCallback (Object *, const EventObject &)
 

Protected Member Functions

void PrintSelf (std::ostream &os, Indent indent) const
 
- Protected Member Functions inherited from itk::PSMContainerArrayAttribute< TNumericType, VDimension >
void PrintSelf (std::ostream &os, Indent indent) const
 
- Protected Member Functions inherited from itk::PSMAttribute< VDimension >
void PrintSelf (std::ostream &os, Indent indent) const
 

Additional Inherited Members

- Public Attributes inherited from itk::PSMAttribute< VDimension >
DefinedCallbacksStruct m_DefinedCallbacks
 

Detailed Description

template<class TNumericType, unsigned int VDimension>
class itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >

Definition at line 34 of file itkPSMMeanCurvatureAttribute.h.

Member Typedef Documentation

template<class TNumericType, unsigned int VDimension>
typedef TNumericType itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >::NumericType

Standard class typedefs

Definition at line 39 of file itkPSMMeanCurvatureAttribute.h.

template<class TNumericType, unsigned int VDimension>
typedef PSMParticleSystem<VDimension> itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >::ParticleSystemType

Numeric types.

Definition at line 47 of file itkPSMMeanCurvatureAttribute.h.

Member Function Documentation

template<class TNumericType , unsigned int VDimension>
void itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >::ComputeCurvatureStatistics ( const ParticleSystemType system,
unsigned int  d 
)
virtual

Compute the mean and std deviation of the curvature on the image surface.

Definition at line 31 of file itkPSMMeanCurvatureAttribute.hxx.

32 {
33  typedef PSMImageDomainWithCurvature<TNumericType, VDimension> DomainType;
34  typedef typename DomainType::ImageType ImageType;
35 
36  // Loop through a zero crossing image, project all the zero crossing points
37  // to the surface, and use those points to comput curvature stats.
38  typedef itk::ZeroCrossingImageFilter<ImageType, ImageType> ZeroCrossingImageFilterType;
39  typename ZeroCrossingImageFilterType::Pointer zc = ZeroCrossingImageFilterType::New() ;
40  zc->SetInput( dynamic_cast<const DomainType *>(system->GetDomain(d))->GetImage() );
41  zc->Update();
42 
43  itk::ImageRegionConstIteratorWithIndex<ImageType> it(zc->GetOutput(),
44  zc->GetOutput()->GetRequestedRegion());
45  std::vector<double> datalist;
46  m_MeanCurvatureList[d] = 0.0;
47  m_CurvatureStandardDeviationList[d] = 0.0;
48  const DomainType *domain = static_cast<const DomainType *>(system->GetDomain(d));
49 
50  for (; ! it.IsAtEnd(); ++it)
51  {
52  if (it.Get() == 1.0)
53  {
54  // Find closest pixel location to surface.
55  PointType pos;
56  domain->GetImage()->TransformIndexToPhysicalPoint(it.GetIndex(), pos);
57 
58  // Project point to surface.
59  // Make sure constraints are enabled
60  // bool c = domain->GetConstraintsEnabled();
61  // domain->EnableConstraints();
62  domain->ApplyConstraints(pos);
63  // domain->SetConstraintsEnabled(c);
64 
65  // Compute curvature at point.
66  double mc = domain->GetCurvature(pos);
67  m_MeanCurvatureList[d] += mc;
68  datalist.push_back(mc);
69  }
70  }
71  double n = static_cast<double>(datalist.size());
72  m_MeanCurvatureList[d] /= n;
73 
74  // Compute std deviation using point list
75  for (unsigned int i = 0; i < datalist.size(); i++)
76  {
77  m_CurvatureStandardDeviationList[d] += (datalist[i] - m_MeanCurvatureList[d]) * (datalist[i] - m_MeanCurvatureList[d]);
78  }
79  m_CurvatureStandardDeviationList[d] = sqrt(m_CurvatureStandardDeviationList[d] / (n-1));
80 }
template<class TNumericType, unsigned int VDimension>
virtual void itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >::DomainAddEventCallback ( Object *  ,
const EventObject &   
)
inlinevirtual

Callbacks that may be defined by a subclass. If a subclass defines one of these callback methods, the corresponding flag in m_DefinedCallbacks should be set to true so that the ParticleSystem will know to register the appropriate event with this method.

Reimplemented from itk::PSMContainerArrayAttribute< TNumericType, VDimension >.

Definition at line 72 of file itkPSMMeanCurvatureAttribute.h.

73  {
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());
80  }
virtual void ComputeCurvatureStatistics(const ParticleSystemType *, unsigned int d)
virtual void DomainAddEventCallback(Object *, const EventObject &)
PSMParticleSystem< VDimension > ParticleSystemType
template<class TNumericType, unsigned int VDimension>
itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >::itkNewMacro ( Self  )

Method for creation through the object factory.

template<class TNumericType, unsigned int VDimension>
itk::PSMMeanCurvatureAttribute< TNumericType, VDimension >::itkTypeMacro ( PSMMeanCurvatureAttribute< TNumericType, VDimension >  ,
PSMContainerArrayAttribute   
)

Run-time type information (and related methods).


The documentation for this class was generated from the following files: