ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkVariationalRegistrationCurvatureRegularizer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkVariationalRegistrationCurvatureRegularizer_h
19 #define itkVariationalRegistrationCurvatureRegularizer_h
20 
22 #include "itkMultiThreader.h"
23 
24 #if defined( ITK_USE_FFTWD ) || defined( ITK_USE_FFTWF )
25 
26 // other includes:
27 #include "itkFFTWCommon.h"
28 
29 namespace itk {
30 
61 template< class TDisplacementField >
63  : public VariationalRegistrationRegularizer< TDisplacementField >
64 {
65 public:
71 
73  itkNewMacro(Self);
74 
77 
79  itkStaticConstMacro(ImageDimension, unsigned int, TDisplacementField::ImageDimension);
80 
85  typedef typename Superclass::PixelType PixelType;
86  typedef typename Superclass::ValueType ValueType;
89 
92  #if defined( ITK_USE_FFTWD )
93  //Prefer to use double precision
94  typedef double RealTypeFFT;
95  #else
96  #if defined( ITK_USE_FFTWF )
97  //Allow to use single precision
98  #warning "Using single precision for FFT computations!"
99  typedef float RealTypeFFT;
100  #endif
101  #endif
102 
104 
106  itkSetMacro( Alpha, ValueType );
107 
109  itkGetConstMacro( Alpha, ValueType );
110 
111 protected:
114 
116  virtual void PrintSelf(std::ostream& os, Indent indent) const;
117 
120  virtual void GenerateData();
121 
124  virtual void Initialize();
125 
127  virtual bool InitializeCurvatureFFTPlans();
128 
130  virtual bool InitializeCurvatureDiagonalMatrix();
131 
133  virtual void Regularize();
134 
136  virtual void SolveCurvatureLES(unsigned int currentDimension);
137 
139  virtual void ThreadedSolveCurvatureLES(unsigned int currentDimension, OffsetValueType from, OffsetValueType to );
140 
143  OffsetValueType offset );
144 
145 private:
146  VariationalRegistrationCurvatureRegularizer(const Self&); //purposely not implemented
147  void operator=(const Self&); //purposely not implemented
148 
151 
153  typename DisplacementFieldType::SpacingType m_Spacing;
154 
157 
160 
163 
166 
178  {
181  unsigned int currentDimension;
182  };
183 
185 };
186 
187 }
188 
189 #ifndef ITK_MANUAL_INSTANTIATION
190 # include "itkVariationalRegistrationCurvatureRegularizer.hxx"
191 #endif
192 
193 #endif
194 #endif
Light weight base class for most itk classes.
Base class for regularization component in the variational registration framework.
unsigned long SizeValueType
Definition: itkIntTypes.h:143
#define ITK_THREAD_RETURN_TYPE
virtual void SolveCurvatureLES(unsigned int currentDimension)
DisplacementFieldType::ConstPointer DisplacementFieldConstPointer
virtual void PrintSelf(std::ostream &os, Indent indent) const
virtual void ThreadedSolveCurvatureLES(unsigned int currentDimension, OffsetValueType from, OffsetValueType to)
VariationalRegistrationRegularizer< TDisplacementField > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
static ITK_THREAD_RETURN_TYPE SolveCurvatureLESThreaderCallback(void *vargs)
This class performs linear elastic regularization of a vector field.
DisplacementFieldType::IndexType CalculateImageIndex(OffsetValueType offset)