RTK  2.0.1
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  * 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 
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>
35 class ConjugateGradientGetP_kPlusOneImageFilter : public itk::ImageToImageFilter< TInputImage, TInputImage>
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_ASSIGN(ConjugateGradientGetP_kPlusOneImageFilter);
39 
44  using OutputImageRegionType = typename TInputImage::RegionType;
45  using BetaImage = itk::Image<typename TInputImage::InternalPixelType,
46  TInputImage::ImageDimension>;
47 
49  itkNewMacro(Self)
50 
51 
53 
55  void SetR_kPlusOne(const TInputImage* R_kPlusOne);
56  void SetRk(const TInputImage* Rk);
57  void SetPk(const TInputImage* Pk);
59 
60  itkSetMacro(SquaredNormR_k, double)
61  itkSetMacro(SquaredNormR_kPlusOne, double)
62 
64  using AddFilterType = itk::AddImageFilter<TInputImage>;
65  using MultiplyFilterType = itk::MultiplyImageFilter<TInputImage, BetaImage, TInputImage>;
66 
67 protected:
68  ConjugateGradientGetP_kPlusOneImageFilter();
69  ~ConjugateGradientGetP_kPlusOneImageFilter() override = default;
70 
71  typename TInputImage::Pointer GetR_kPlusOne();
72  typename TInputImage::Pointer GetRk();
73  typename TInputImage::Pointer GetPk();
74 
76  void GenerateData() override;
77 
78  void GenerateOutputInformation() override;
79 
80 private:
83  double m_Betak;
84 
88 
89 };
90 } //namespace ITK
91 
92 
93 #ifndef ITK_MANUAL_INSTANTIATION
94 #include "rtkConjugateGradientGetP_kPlusOneImageFilter.hxx"
95 #endif
96 
97 #endif
void SetR_kPlusOne(const TInputImage *R_kPlusOne)
#define itkSetMacro(name, type)