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

Public Types

typedef T DataType
 
typedef PSMMixedEffectsShapeMatrixAttribute Self
 
typedef PSMShapeMatrixAttribute< T, VDimension > Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef WeakPointer< const SelfConstWeakPointer
 
- Public Types inherited from itk::PSMShapeMatrixAttribute< T, VDimension >
typedef T DataType
 
typedef PSMShapeMatrixAttribute 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 (PSMMixedEffectsShapeMatrixAttribute, PSMShapeMatrixAttribute)
 
vnl_vector< double > ComputeMean (double k) const
 
void ResizeParameters (unsigned int n)
 
virtual void ResizeMeanMatrix (int rs, int cs)
 
void ResizeExplanatory (unsigned int n)
 
virtual void DomainAddEventCallback (Object *, const EventObject &e)
 
virtual void PositionAddEventCallback (Object *o, const EventObject &e)
 
virtual void PositionSetEventCallback (Object *o, const EventObject &e)
 
virtual void PositionRemoveEventCallback (Object *, const EventObject &)
 
void SetDomainsPerShape (int i)
 
int GetDomainsPerShape () const
 
void SetTimePointsPerIndividual (const vnl_vector< int > &v)
 
vnl_vector< int > & GetTimePointsPerIndividual () const
 
vnl_vector< int > & GetTimePointsPerIndividual ()
 
void SetNumIndividuals (int i)
 
int GetNumIndividuals ()
 
void SetExplanatory (std::vector< double > v)
 
void SetExplanatory (unsigned int i, double q)
 
const double & GetExplanatory (unsigned int i) const
 
double & GetExplanatory (unsigned int i)
 
const vnl_vector< double > & GetSlope () const
 
const vnl_vector< double > & GetIntercept () const
 
const vnl_matrix< double > & GetSlopeRandom () const
 
const vnl_matrix< double > & GetInterceptRandom () const
 
void SetSlope (const std::vector< double > &v)
 
void SetIntercept (const std::vector< double > &v)
 
void Initialize ()
 
virtual void BeforeIteration ()
 
void SetRegressionInterval (int i)
 
int GetRegressionInterval () const
 
virtual void UpdateMeanMatrix ()
 
virtual void EstimateParameters ()
 
- Public Member Functions inherited from itk::PSMShapeMatrixAttribute< T, VDimension >
 itkNewMacro (Self)
 
 itkTypeMacro (PSMShapeMatrixAttribute, PSMAttribute)
 
virtual void ResizeMatrix (int, int)
 
void SetDomainsPerShape (int i)
 
int GetDomainsPerShape () const
 
virtual void AfterIteration ()
 
virtual void SetMatrix (const vnl_matrix< T > &m)
 
- 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::PSMShapeMatrixAttribute< T, 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
 
- Protected Attributes inherited from itk::PSMShapeMatrixAttribute< T, VDimension >
int m_DomainsPerShape
 

Detailed Description

template<class T, unsigned int VDimension>
class itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >

Definition at line 35 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

Member Typedef Documentation

template<class T , unsigned int VDimension>
typedef T itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::DataType

Standard class typedefs

Definition at line 40 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

Member Function Documentation

template<class T , unsigned int VDimension>
virtual void itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::BeforeIteration ( )
inlinevirtual

Method defining actions before the iteration of a solver that is using this class (via a PSM function object).

Reimplemented from itk::PSMShapeMatrixAttribute< T, VDimension >.

Definition at line 305 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

306  {
307  m_UpdateCounter ++;
308  if (m_UpdateCounter >= m_RegressionInterval)
309  {
310  m_UpdateCounter = 0;
311  this->EstimateParameters();
312  this->UpdateMeanMatrix();
313  }
314  }
template<class T , unsigned int VDimension>
virtual void itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::DomainAddEventCallback ( Object *  ,
const EventObject &  e 
)
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 PSMParticleSystem will know to register the appropriate event with this method.

Reimplemented from itk::PSMShapeMatrixAttribute< T, VDimension >.

Definition at line 115 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

116  {
117  const itk::ParticleDomainAddEvent &event
118  = dynamic_cast<const itk::ParticleDomainAddEvent &>(e);
119  unsigned int d = event.GetDomainIndex();
120 
121  if ( d % this->m_DomainsPerShape == 0 )
122  {
123  this->ResizeMatrix(this->rows(), this->cols()+1);
124  this->ResizeMeanMatrix(this->rows(), this->cols()+1);
125  this->ResizeExplanatory(this->cols());
126  }
127  }
template<class T , unsigned int VDimension>
void itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::Initialize ( )
inlinevirtual

Perform any initialization steps. This can be overridden by subclasses.

Reimplemented from itk::PSMShapeMatrixAttribute< T, VDimension >.

Definition at line 295 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

296  {
297  m_Intercept.fill(0.0);
298  m_Slope.fill(0.0);
299  m_MeanMatrix.fill(0.0);
300 
301  m_SlopeRand.fill(0.0);
302  m_InterceptRand.fill(0.0);
303  }
template<class T , unsigned int VDimension>
itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::itkNewMacro ( Self  )

Method for creation through the object factory.

template<class T , unsigned int VDimension>
itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::itkTypeMacro ( PSMMixedEffectsShapeMatrixAttribute< T, VDimension >  ,
PSMShapeMatrixAttribute   
)

Run-time type information (and related methods).

template<class T , unsigned int VDimension>
virtual void itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::PositionAddEventCallback ( Object *  o,
const EventObject &  e 
)
inlinevirtual

Callback defining actions when a position is added to a ParticleSystem. This method will likely be called from itkParticleSystem with the event ParticleAddEvent.

Reimplemented from itk::PSMShapeMatrixAttribute< T, VDimension >.

Definition at line 129 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

130  {
131  const itk::ParticlePositionAddEvent &event
132  = dynamic_cast<const itk::ParticlePositionAddEvent &>(e);
134  = dynamic_cast<const itk::PSMParticleSystem<VDimension> *>(o);
135  const int d = event.GetDomainIndex();
136  const unsigned int idx = event.GetPositionIndex();
138  = ps->GetTransformedPosition(idx, d);
139 
140  const unsigned int PointsPerDomain = ps ->GetNumberOfParticles(d);
141 
142  // Make sure we have enough rows.
143  if ( (ps->GetNumberOfParticles(d) * VDimension * this->m_DomainsPerShape) > this->rows() )
144  {
145  this->ResizeParameters(PointsPerDomain * VDimension * this->m_DomainsPerShape);
146  this->ResizeMatrix(PointsPerDomain * VDimension * this->m_DomainsPerShape,
147  this->cols());
148  this->ResizeMeanMatrix(PointsPerDomain * VDimension * this->m_DomainsPerShape,
149  this->cols());
150  }
151 
152  // CANNOT ADD POSITION INFO UNTIL ALL POINTS PER DOMAIN IS KNOWN
153  // Add position info to the matrix
154  unsigned int k = ((d % this->m_DomainsPerShape) * PointsPerDomain * VDimension)
155  + (idx * VDimension);
156  for (unsigned int i = 0; i < VDimension; i++)
157  {
158  this->operator()(i+k, d / this->m_DomainsPerShape) = pos[i];
159  }
160  }
unsigned long int GetNumberOfParticles(unsigned int d=0) const
A facade class that manages interactions with a particle system.
Definition: Shape.h:14
template<class T , unsigned int VDimension>
virtual void itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::PositionRemoveEventCallback ( Object *  ,
const EventObject &   
)
inlinevirtual

Reserved for future implementation.

Reimplemented from itk::PSMShapeMatrixAttribute< T, VDimension >.

Definition at line 185 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

186  {
187  // NEED TO IMPLEMENT THIS
188  }
template<class T , unsigned int VDimension>
virtual void itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::PositionSetEventCallback ( Object *  o,
const EventObject &  e 
)
inlinevirtual

Callback for defining actions when a position value is set – usually from ParticleSystem.

Reimplemented from itk::PSMShapeMatrixAttribute< T, VDimension >.

Definition at line 162 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

163  {
164  const itk::ParticlePositionSetEvent &event
165  = dynamic_cast <const itk::ParticlePositionSetEvent &>(e);
166 
168  = dynamic_cast<const itk::PSMParticleSystem<VDimension> *>(o);
169  const int d = event.GetDomainIndex();
170  const unsigned int idx = event.GetPositionIndex();
171  const typename itk::PSMParticleSystem<VDimension>::PointType pos = ps->GetTransformedPosition(idx, d);
172  const unsigned int PointsPerDomain = ps ->GetNumberOfParticles(d);
173 
174  // Modify matrix info
175  unsigned int k = ((d % this->m_DomainsPerShape) * PointsPerDomain * VDimension)
176  + (idx * VDimension);
177 
178  for (unsigned int i = 0; i < VDimension; i++)
179  {
180  this->operator()(i+k, d / this->m_DomainsPerShape) =
181  pos[i] - m_MeanMatrix(i+k, d/ this->m_DomainsPerShape);
182  }
183  }
A facade class that manages interactions with a particle system.
Definition: Shape.h:14
template<class T , unsigned int VDimension>
void itk::PSMMixedEffectsShapeMatrixAttribute< T, VDimension >::SetDomainsPerShape ( int  i)
inline

Set/Get the number of domains per shape. This can only be safely done before shapes are initialized with points!

Definition at line 192 of file itkPSMMixedEffectsShapeMatrixAttribute.h.

193  {
194  this->m_DomainsPerShape = i;
195  }

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