RTK  2.6.0
Reconstruction Toolkit
rtkConjugateGradientGetX_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 rtkConjugateGradientGetX_kPlusOneImageFilter_h
20 #define rtkConjugateGradientGetX_kPlusOneImageFilter_h
21 
22 #include <itkImageToImageFilter.h>
23 #include <itkAddImageFilter.h>
24 #include <itkMultiplyImageFilter.h>
25 
26 namespace rtk
27 {
34 template <typename TInputImage>
36  : public itk::ImageToImageFilter<TInputImage, TInputImage>
37 {
38 public:
39  ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientGetX_kPlusOneImageFilter);
40 
45  using OutputImageRegionType = typename TInputImage::RegionType;
47 
49  itkNewMacro(Self);
50 
52 #ifdef itkOverrideGetNameOfClassMacro
53  itkOverrideGetNameOfClassMacro(ConjugateGradientGetX_kPlusOneImageFilter);
54 #else
56 #endif
57 
58 
60  void
61  SetXk(const TInputImage * Xk);
62  void
63  SetPk(const TInputImage * Pk);
65 
66  itkGetMacro(Alphak, double);
67  itkSetMacro(Alphak, double);
68 
70  using AddFilterType = itk::AddImageFilter<TInputImage>;
72 
73 protected:
75  ~ConjugateGradientGetX_kPlusOneImageFilter() override = default;
76 
77  typename TInputImage::Pointer
78  GetXk();
79  typename TInputImage::Pointer
80  GetPk();
81 
83  void
84  GenerateData() override;
85 
86  void
87  GenerateOutputInformation() override;
88 
89 private:
90  double m_Alphak;
91 
93  typename AddFilterType::Pointer m_AddFilter;
95 };
96 } // namespace rtk
97 
98 
99 #ifndef ITK_MANUAL_INSTANTIATION
100 # include "rtkConjugateGradientGetX_kPlusOneImageFilter.hxx"
101 #endif
102 
103 #endif
#define itkSetMacro(name, type)
typename OutputImageType::RegionType OutputImageRegionType