17 #ifndef __itkActiveShapeModelCalculator_h
18 #define __itkActiveShapeModelCalculator_h
23 #include "vnl/vnl_vector.h"
24 #include "vnl/vnl_matrix.h"
25 #include "vnl/vnl_math.h"
26 #include "vnl/algo/vnl_matrix_inverse.h"
27 #include <vnl/algo/vnl_generalized_eigensystem.h>
28 #include <vnl/algo/vnl_symmetric_eigensystem.h>
76 template <
class TImage >
159 if ( m_Image != image )
170 void SetLowerThresholdGradient(
const double <)
171 { m_LowerThreshold = lt; }
172 const double &GetLowerThresholdGradient()
const
173 {
return m_LowerThreshold; }
178 void SetUpperThresholdMeanDistance(
const double &ut1)
179 { m_UpperThreshold1 = ut1; }
180 const double &GetUpperThresholdMeanDistance()
const
181 {
return m_UpperThreshold1; }
186 void SetUpperThresholdDistance(
const double &ut2)
187 { m_UpperThreshold2 = ut2; }
188 const double &GetUpperThresholdDistance()
const
189 {
return m_UpperThreshold2; }
192 void SetTolerance(
const double &t)
194 const double &GetTolerance()
const
195 {
return m_Tolerance; }
198 void SetPruneIteration(
const unsigned int &t)
199 { m_PruneIteration = t; }
200 const unsigned int &GetPruneIteration()
const
201 {
return m_PruneIteration; }
204 const unsigned int &GetNumberOfTrainingImages()
const
205 {
return m_NumberOfTrainingImages; }
212 void GenerateData( );
215 VectorOfDoubleType GetMeanShape();
218 VectorOfDoubleType GetEigenvalues();
221 MatrixOfDoubleType GetEigenvector();
227 m_LowerThreshold = 10.0;
228 m_UpperThreshold1 = 1.0;
229 m_UpperThreshold2 = 1.0;
231 m_PruneIteration = 3;
232 m_NumberOfTrainingImages = 0;
233 m_EigenVectors.set_size(0,0);
234 m_EigenValues.set_size(0);
242 void PrintSelf(std::ostream& os,
Indent indent)
const
244 Superclass::PrintSelf(os,indent);
245 os << indent <<
"LowerThreshold: " << m_LowerThreshold << std::endl;
246 os << indent <<
"UpperThreshold1: " << m_UpperThreshold1 << std::endl;
247 os << indent <<
"UpperThreshold2: " << m_UpperThreshold2 << std::endl;
248 os << indent <<
"Tolerance: " << m_Tolerance << std::endl;
249 os << indent <<
"Number of training images: " << m_NumberOfTrainingImages << std::endl;
250 os << indent <<
"Number of iteration for Prunig filter: " << m_PruneIteration << std::endl;
251 itkDebugMacro(<<
" ");
252 itkDebugMacro(<<
"Results of the shape model");
253 itkDebugMacro(<<
"====================================");
255 itkDebugMacro(<<
"The mean shape: ");
257 itkDebugMacro(<< m_Means);
259 itkDebugMacro(<<
" ");
260 itkDebugMacro(<<
"================== ");
262 itkDebugMacro(<<
"The eigen values: ");
264 itkDebugMacro(<< m_EigenValues);
266 itkDebugMacro(<<
" ");
267 itkDebugMacro(<<
"================== ");
269 itkDebugMacro(<<
"The eigen vectors: ");
272 for(
unsigned int i = 0; i < m_Means.size(); i++)
274 itkDebugMacro(<< m_EigenVectors.get_row(i));
277 itkDebugMacro(<<
" ");
278 itkDebugMacro(<<
"+++++++++++++++++++++++++");
284 void operator=(
const Self&);
302 #ifndef ITK_MANUAL_INSTANTIATION