ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkVariationalRegistrationDiffusionRegularizer.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 itkVariationalRegistrationDiffusionRegularizer_h
19 #define itkVariationalRegistrationDiffusionRegularizer_h
20 
22 
23 namespace itk {
24 
49 template< typename TDisplacementField >
51  : public VariationalRegistrationRegularizer< TDisplacementField >
52 {
53 public:
54  ITK_DISALLOW_COPY_AND_ASSIGN(VariationalRegistrationDiffusionRegularizer);
55 
59  TDisplacementField >;
62 
64  itkNewMacro(Self);
65 
69 
71  static constexpr unsigned int ImageDimension = TDisplacementField::ImageDimension;
72 
77  using PixelType = typename Superclass::PixelType;
78  using ValueType = typename Superclass::ValueType;
79 
84 
86  itkSetMacro( Alpha, ValueType );
87 
89  itkGetConstMacro( Alpha, ValueType );
90 
91 protected:
94 
96  void PrintSelf(std::ostream& os, Indent indent) const override;
97 
100  void GenerateData() override;
101 
104  void Initialize() override;
105 
108  virtual void InitLUMatrices( ValueType** alpha, ValueType** beta,
109  ValueType** gamma, int n, int dim );
110 
113  virtual void RegularizeComponent( const int component );
114 
117  {
119  unsigned int component; // The current dimension.
120  BufferImagePointer bPtr; // Pointer to the image buffer.
121  };
122 
125  {
127  unsigned int direction; // Current direction.
128  ValueType* alpha; // Pointer to matrix diagonal.
129  ValueType* beta; // Pointer to matrix subdiagonal.
130  ValueType* gamma; // Pointer to matrix superdiagonal.
131  BufferImagePointer bPtr; // Pointer to force field image buffer.
132  BufferImagePointer vPtr; // Pointer to temporal result image buffer.
133  };
134 
137  {
139  unsigned int component; // The current dimension.
140  BufferImagePointer* vPtr; // Pointer to temporal image buffers.
141  };
142 
144  static ITK_THREAD_RETURN_TYPE CalcBufferCallback( void *arg );
145 
148 
151 
157  virtual int SplitBoundaryFaceRegion( int i, int num, int inDir,
158  BufferImageRegionType& splitRegion );
159 
160 private:
163 
166 
168  typename DisplacementFieldType::SpacingType m_Spacing;
169 
170  // Attributes for AOS calculation
173 
177 
180 
183 
186 };
187 
188 }
189 
190 #ifndef ITK_MANUAL_INSTANTIATION
191 # include "itkVariationalRegistrationDiffusionRegularizer.hxx"
192 #endif
193 
194 #endif
virtual void InitLUMatrices(ValueType **alpha, ValueType **beta, ValueType **gamma, int n, int dim)
static ITK_THREAD_RETURN_TYPE MergeDirectionsCallback(void *arg)
Light weight base class for most itk classes.
virtual void RegularizeComponent(const int component)
typename DisplacementFieldType::ConstPointer DisplacementFieldConstPointer
virtual int SplitBoundaryFaceRegion(int i, int num, int inDir, BufferImageRegionType &splitRegion)
Base class for regularization component in the variational registration framework.
void ITK_THREAD_RETURN_TYPE
static ITK_THREAD_RETURN_TYPE CalcBufferCallback(void *arg)
typename Superclass::RegionType RegionType
Definition: itkImage.h:139
static ITK_THREAD_RETURN_TYPE RegularizeDirectionCallback(void *arg)
void PrintSelf(std::ostream &os, Indent indent) const override
typename Superclass::DisplacementFieldConstPointer DisplacementFieldConstPointer
typename NumericTraits< PixelType >::ValueType ValueType
typename DisplacementFieldType::Pointer DisplacementFieldPointer
Control indentation during Print() invocation.
Definition: itkIndent.h:49
This class performs diffusive regularization of a vector field.
SmartPointer< Self > Pointer
Definition: itkImage.h:83
typename DisplacementFieldType::PixelType PixelType
Templated n-dimensional image class.
Definition: itkImage.h:75