NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkFFDConjugateGradientDescentOptimizer.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkFFDConjugateGradientDescentOptimizer_h
16 #define itkFFDConjugateGradientDescentOptimizer_h
17 
18 
21 #include <itkUCLBSplineTransform.h>
26 
27 namespace itk
28 {
29 
36 template <class TFixedImage, class TMovingImage, class TScalarType, class TDeformationScalar>
38  public FFDGradientDescentOptimizer<TFixedImage, TMovingImage, TScalarType, TDeformationScalar>
39 {
40 public:
41 
46  typedef FFDGradientDescentOptimizer<TFixedImage, TMovingImage,
47  TScalarType, TDeformationScalar> Superclass;
48  typedef SmartPointer<Self> Pointer;
49  typedef SmartPointer<const Self> ConstPointer;
50 
52  itkNewMacro(Self);
53 
56 
58  itkStaticConstMacro(Dimension, unsigned int, TFixedImage::ImageDimension);
59 
66 
67 protected:
68 
71  void PrintSelf(std::ostream& os, Indent indent) const;
72 
74  virtual void OptimizeNextStep(int iterationNumber, int numberOfGridVoxels, const ParametersType& current, ParametersType& next);
75 
76 private:
77 
78  FFDConjugateGradientDescentOptimizer(const Self&); //purposely not implemented
79  void operator=(const Self&); //purposely not implemented
80 
82  virtual void Initialize();
83 
85  virtual void StoreGradient(const ParametersType& gradient);
86 
88  void GetNextGradient(const ParametersType& currentGradient, ParametersType& nextGradient);
89 
91  virtual void CleanUp();
92 
93  struct float3{
94  float x,y,z;
95  };
96 
97  float3 *conjugateG;
98  float3 *conjugateH;
99  unsigned long int m_NumberOfGridVoxels;
100  ParametersType m_DerivativeAtCurrentPosition;
101  ParametersType m_DerivativeAtNextPosition;
102 };
103 
104 } // namespace itk.
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 #include "itkFFDConjugateGradientDescentOptimizer.txx"
108 #endif
109 
110 #endif /*ITKFFDCONJUGATEGRADIENTDESCENTOPTIMIZER_H_*/
111 
112 
113 
GLdouble GLdouble z
Definition: glew.h:1543
Superclass::SimilarityMeasureType SimilarityMeasureType
Definition: itkFFDConjugateGradientDescentOptimizer.h:61
Deformable transform using a BSpline representation.
Definition: itkUCLBSplineTransform.h:56
Abstract base class to provide functionality for adding arbitrary constraints, and also arbitrary way...
Definition: itkImageToImageMetricWithConstraint.h:49
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1236
Definition: niftkITKAffineResampleImage.cxx:74
virtual ~FFDConjugateGradientDescentOptimizer()
Definition: itkFFDConjugateGradientDescentOptimizer.h:70
SmartPointer< const Self > ConstPointer
Definition: itkFFDConjugateGradientDescentOptimizer.h:49
Superclass::GridImagePointer GridImagePointer
Definition: itkFFDConjugateGradientDescentOptimizer.h:64
FFDGradientDescentOptimizer< TFixedImage, TMovingImage, TScalarType, TDeformationScalar > Superclass
Definition: itkFFDConjugateGradientDescentOptimizer.h:47
FFDConjugateGradientDescentOptimizer Self
Definition: itkFFDConjugateGradientDescentOptimizer.h:45
GLint GLint GLint GLint GLint x
Definition: glew.h:1236
Superclass::ParametersType TransformParametersType
Definition: itkImageToImageMetricWithConstraint.h:71
SmartPointer< Self > Pointer
Definition: itkFFDConjugateGradientDescentOptimizer.h:48
Class to perform FFD specific optimization using conjugate gradient descent.
Definition: itkFFDConjugateGradientDescentOptimizer.h:37
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
SimilarityMeasureType::TransformParametersType ParametersType
Definition: itkFFDConjugateGradientDescentOptimizer.h:62
Class to perform FFD specific optimization.
Definition: itkFFDGradientDescentOptimizer.h:39
OutputImageType::SizeType OutputImageSizeType
Definition: itkFFDGradientDescentOptimizer.h:104
Superclass::UCLBSplineTransformPointer UCLBSplineTransformPointer
Definition: itkFFDConjugateGradientDescentOptimizer.h:63
Superclass::OutputImageSizeType OutputImageSizeType
Definition: itkFFDConjugateGradientDescentOptimizer.h:65