RTK  2.5.0
Reconstruction Toolkit
rtkGetNewtonUpdateImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK 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  * https://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 rtkGetNewtonUpdateImageFilter_h
19 #define rtkGetNewtonUpdateImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
22 #include "rtkMacro.h"
23 
24 namespace rtk
25 {
41 template <class TGradient,
42  class THessian = itk::Image<itk::Vector<typename TGradient::PixelType::ValueType,
43  TGradient::PixelType::Dimension * TGradient::PixelType::Dimension>,
44  TGradient::ImageDimension>>
45 class ITK_TEMPLATE_EXPORT GetNewtonUpdateImageFilter : public itk::ImageToImageFilter<TGradient, TGradient>
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_MOVE(GetNewtonUpdateImageFilter);
49 
54 
56  itkNewMacro(Self);
57 
59 #ifdef itkOverrideGetNameOfClassMacro
60  itkOverrideGetNameOfClassMacro(GetNewtonUpdateImageFilter);
61 #else
63 #endif
64 
65 
67  static constexpr unsigned int nChannels = TGradient::PixelType::Dimension;
68 
70  using dataType = typename TGradient::PixelType::ValueType;
71 
73  void
74  SetInputGradient(const TGradient * gradient);
75  void
76  SetInputHessian(const THessian * hessian);
78 
79 protected:
81  ~GetNewtonUpdateImageFilter() override = default;
82 
83  void
84  GenerateInputRequestedRegion() override;
85 
87  void
88  DynamicThreadedGenerateData(const typename TGradient::RegionType & outputRegionForThread) override;
89 
91  typename TGradient::ConstPointer
92  GetInputGradient();
93  typename THessian::ConstPointer
94  GetInputHessian();
95 };
96 } // namespace rtk
98 
99 
100 #ifndef ITK_MANUAL_INSTANTIATION
101 # include "rtkGetNewtonUpdateImageFilter.hxx"
102 #endif
103 
104 #endif
typename TGradient::PixelType::ValueType dataType
Computes update from gradient and Hessian in Newton&#39;s method.