18 #ifndef __itkPSMGradientDescentOptimizer_h 19 #define __itkPSMGradientDescentOptimizer_h 22 #include "itkObject.h" 23 #include "itkObjectFactory.h" 24 #include "itkWeakPointer.h" 25 #include "vnl/vnl_vector_fixed.h" 26 #include "itkPSMParticleSystem.h" 27 #include "itkPSMCostFunction.h" 28 #include "itkPSMImageDomainWithGradients.h" 44 template <
class TGradientNumericType,
unsigned int VDimension>
50 typedef Object Superclass;
51 typedef SmartPointer<Self> Pointer;
52 typedef SmartPointer<const Self> ConstPointer;
53 typedef WeakPointer<const Self> ConstWeakPointer;
82 if (m_OptimizationMode == 0) { this->StartJacobiOptimization(); }
83 else { this->StartGaussSeidelOptimization(); }
85 void StartJacobiOptimization();
86 void StartGaussSeidelOptimization();
89 void SetModeToGaussSeidel() { this->m_OptimizationMode = 1; }
90 void SetModeToJacobi() { this->m_OptimizationMode = 0; }
95 { this->m_StopOptimization =
true; }
99 itkSetMacro(NumberOfIterations,
unsigned int);
104 itkSetMacro(TimeStep,
double);
107 itkGetMacro(MaximumNumberOfIterations,
unsigned int);
108 itkSetMacro(MaximumNumberOfIterations,
unsigned int);
112 itkSetMacro(Tolerance,
double);
116 itkSetObjectMacro(ParticleSystem, ParticleSystemType);
120 itkSetObjectMacro(CostFunction, CostFunctionType);
126 void PrintSelf(std::ostream& os, Indent indent)
const 128 Superclass::PrintSelf(os, indent);
133 typename ParticleSystemType::Pointer m_ParticleSystem;
134 typename CostFunctionType::Pointer m_CostFunction;
135 bool m_StopOptimization;
136 unsigned int m_NumberOfIterations;
137 unsigned int m_MaximumNumberOfIterations;
140 int m_OptimizationMode;
142 std::vector< std::vector<double> > m_TimeSteps;
147 #ifndef ITK_MANUAL_INSTANTIATION 148 #include "itkPSMGradientDescentOptimizer.hxx" PSMImageDomainWithGradients< TGradientNumericType, VDimension > DomainType
itkTypeMacro(PSMGradientDescentOptimizer, Object)
ParticleSystemType::PointType PointType
itkGetMacro(NumberOfIterations, unsigned int)
itkGetObjectMacro(ParticleSystem, ParticleSystemType)
CostFunctionType::VectorType VectorType
PSMParticleSystem< VDimension > ParticleSystemType
A facade class that manages interactions with a particle system.
PSMGradientDescentOptimizer Self
vnl_vector_fixed< double, VDimension > VectorType
PSMCostFunction< VDimension > CostFunctionType
itkStaticConstMacro(Dimension, unsigned int, VDimension)