RTK  2.0.1
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  * 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 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>
37 class ConjugateGradientGetR_kPlusOneImageFilter : public itk::ImageToImageFilter< TInputImage, TInputImage>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_ASSIGN(ConjugateGradientGetR_kPlusOneImageFilter);
41 
46  using OutputImageRegionType = typename TInputImage::RegionType;
47 
49  itkNewMacro(Self)
50 
51 
53 
55  void SetRk(const TInputImage* Rk);
56  void SetPk(const TInputImage* Pk);
57  void SetAPk(const TInputImage* APk);
59 
60  itkGetMacro(Alphak, double)
61  itkGetMacro(SquaredNormR_k, double)
62  itkGetMacro(SquaredNormR_kPlusOne, double)
63 
64 protected:
65  ConjugateGradientGetR_kPlusOneImageFilter();
66  ~ConjugateGradientGetR_kPlusOneImageFilter() override = default;
67 
68  typename TInputImage::Pointer GetRk();
69  typename TInputImage::Pointer GetPk();
70  typename TInputImage::Pointer GetAPk();
71 
72  void GenerateData() override;
73 
74 private:
75  double m_Alphak{0.};
76  double m_SquaredNormR_k{0.};
78 };
79 
80 } //namespace RTK
81 
82 
83 #ifndef ITK_MANUAL_INSTANTIATION
84 #include "rtkConjugateGradientGetR_kPlusOneImageFilter.hxx"
85 #endif
86 
87 #endif
typename OutputImageType::RegionType OutputImageRegionType