RTK  2.6.0
Reconstruction Toolkit
rtkConjugateGradientGetP_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 rtkConjugateGradientGetP_kPlusOneImageFilter_h
20 #define rtkConjugateGradientGetP_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(ConjugateGradientGetP_kPlusOneImageFilter);
40 
45  using OutputImageRegionType = typename TInputImage::RegionType;
47 
49  itkNewMacro(Self);
50 
52 #ifdef itkOverrideGetNameOfClassMacro
53  itkOverrideGetNameOfClassMacro(ConjugateGradientGetP_kPlusOneImageFilter);
54 #else
56 #endif
57 
58 
60  void
61  SetR_kPlusOne(const TInputImage * R_kPlusOne);
62  void
63  SetRk(const TInputImage * Rk);
64  void
65  SetPk(const TInputImage * Pk);
67 
68  itkSetMacro(SquaredNormR_k, double);
69  itkSetMacro(SquaredNormR_kPlusOne, double);
70 
72  using AddFilterType = itk::AddImageFilter<TInputImage>;
74 
75 protected:
77  ~ConjugateGradientGetP_kPlusOneImageFilter() override = default;
78 
79  typename TInputImage::Pointer
80  GetR_kPlusOne();
81  typename TInputImage::Pointer
82  GetRk();
83  typename TInputImage::Pointer
84  GetPk();
85 
87  void
88  GenerateData() override;
89 
90  void
91  GenerateOutputInformation() override;
92 
93 private:
96  double m_Betak;
97 
99  typename AddFilterType::Pointer m_AddFilter;
101 };
102 } // namespace rtk
103 
104 
105 #ifndef ITK_MANUAL_INSTANTIATION
106 # include "rtkConjugateGradientGetP_kPlusOneImageFilter.hxx"
107 #endif
108 
109 #endif
#define itkSetMacro(name, type)
typename OutputImageType::RegionType OutputImageRegionType