18 #ifndef __itkPSMRegressionShapeMatrixAttribute_h 19 #define __itkPSMRegressionShapeMatrixAttribute_h 21 #include "itkPSMShapeMatrixAttribute.h" 22 #include "itkPSMParticleSystem.h" 23 #include "vnl/vnl_vector.h" 32 template <
class T,
unsigned int VDimension>
41 typedef SmartPointer<Self> Pointer;
42 typedef SmartPointer<const Self> ConstPointer;
43 typedef WeakPointer<const Self> ConstWeakPointer;
52 virtual void UpdateMeanMatrix();
57 return m_Intercept + m_Slope * k;
61 void ResizeParameters(
unsigned int n);
64 virtual void ResizeMeanMatrix(
int rs,
int cs);
67 void ResizeExplanatory(
unsigned int n);
73 virtual void DomainAddEventCallback(Object *,
const EventObject &e);
74 virtual void PositionAddEventCallback(Object *o,
const EventObject &e);
75 virtual void PositionSetEventCallback(Object *o,
const EventObject &e);
80 itkExceptionMacro(
"Method has not been implemented");
86 { this->m_DomainsPerShape = i; }
87 int GetDomainsPerShape()
const 88 {
return this->m_DomainsPerShape; }
94 this->SetExplanatory(v);
96 void SetExplanatory(
const std::vector<double> &v);
97 void SetExplanatory(
unsigned int i,
double q)
98 { m_Explanatory[i] = q; }
99 const vnl_vector<double> &GetVariables()
const 100 {
return m_Explanatory; }
101 const vnl_vector<double> &GetExplanatory()
const 102 {
return m_Explanatory; }
103 vnl_vector<double> &GetExplanatory()
104 {
return m_Explanatory; }
105 const double &GetExplanatory(
unsigned int i)
const 106 {
return m_Explanatory[i]; }
107 double &GetExplanatory(
unsigned int i)
108 {
return m_Explanatory[i]; }
111 const vnl_matrix<double> &GetMeanMatrix()
const 115 vnl_matrix<double> &GetMeanMatrix()
123 vnl_vector<double> &GetSlope()
128 {
return m_Intercept; }
129 vnl_vector<double> GetIntercept()
130 {
return m_Intercept; }
133 void SetSlope(
const std::vector<double> &v);
134 void SetSlope(
const vnl_vector<double> &v)
140 void SetIntercept(
const std::vector<double> &v);
141 void SetIntercept(
const vnl_vector<double> &v)
148 virtual void EstimateParameters();
152 virtual void Initialize();
156 virtual void BeforeIteration();
164 { m_RegressionInterval = i; }
165 int GetRegressionInterval()
const 166 {
return m_RegressionInterval; }
171 this->m_DefinedCallbacks.DomainAddEvent =
true;
172 this->m_DefinedCallbacks.PositionAddEvent =
true;
173 this->m_DefinedCallbacks.PositionSetEvent =
true;
174 this->m_DefinedCallbacks.PositionRemoveEvent =
true;
176 m_RegressionInterval = 1;
180 void PrintSelf(std::ostream& os, Indent indent)
const 181 { Superclass::PrintSelf(os,indent); }
185 void operator=(
const Self&);
188 int m_RegressionInterval;
191 vnl_vector<double> m_Intercept;
192 vnl_vector<double> m_Slope;
195 vnl_vector<double> m_Explanatory;
198 vnl_matrix<double> m_MeanMatrix;
203 #ifndef ITK_MANUAL_INSTANTIATION 204 #include "itkPSMRegressionShapeMatrixAttribute.hxx" const vnl_vector< double > & GetIntercept() const
Each column describes a shape. A shape may be composed of m_DomainsPerShape domains (default 1)...
virtual void PositionRemoveEventCallback(Object *, const EventObject &)
void SetDomainsPerShape(int i)
void SetRegressionInterval(int i)
Base class for PSMParticleSystem attribute classes.
vnl_vector< double > ComputeMean(double k) const
const vnl_vector< double > & GetSlope() const
void SetVariables(const std::vector< double > &v)