RTK  2.5.0
Reconstruction Toolkit
rtkConjugateGradientGetR_kPlusOneImageFilter.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 
19 #ifndef rtkConjugateGradientGetR_kPlusOneImageFilter_h
20 #define rtkConjugateGradientGetR_kPlusOneImageFilter_h
21 
22 #include <itkImageToImageFilter.h>
23 #include <itkVectorImage.h>
24 
25 #include "rtkConfiguration.h"
26 #include "rtkMacro.h"
27 
28 namespace rtk
29 {
36 template <typename TInputImage>
38  : public itk::ImageToImageFilter<TInputImage, TInputImage>
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientGetR_kPlusOneImageFilter);
42 
47  using OutputImageRegionType = typename TInputImage::RegionType;
48 
50  itkNewMacro(Self);
51 
53 #ifdef itkOverrideGetNameOfClassMacro
54  itkOverrideGetNameOfClassMacro(ConjugateGradientGetR_kPlusOneImageFilter);
55 #else
57 #endif
58 
59 
61  void
62  SetRk(const TInputImage * Rk);
63  void
64  SetPk(const TInputImage * Pk);
65  void
66  SetAPk(const TInputImage * APk);
68 
69  itkGetMacro(Alphak, double);
70  itkGetMacro(SquaredNormR_k, double);
71  itkGetMacro(SquaredNormR_kPlusOne, double);
72 
73 protected:
75  ~ConjugateGradientGetR_kPlusOneImageFilter() override = default;
76 
77  typename TInputImage::Pointer
78  GetRk();
79  typename TInputImage::Pointer
80  GetPk();
81  typename TInputImage::Pointer
82  GetAPk();
83 
84  void
85  GenerateData() override;
86 
87 private:
88  double m_Alphak{ 0. };
89  double m_SquaredNormR_k{ 0. };
90  double m_SquaredNormR_kPlusOne{ 0. };
91 };
92 
93 } // namespace rtk
94 
95 
96 #ifndef ITK_MANUAL_INSTANTIATION
97 # include "rtkConjugateGradientGetR_kPlusOneImageFilter.hxx"
98 #endif
99 
100 #endif
typename OutputImageType::RegionType OutputImageRegionType