RTK  2.0.1
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  * 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 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>
35 class ConjugateGradientGetX_kPlusOneImageFilter : public itk::ImageToImageFilter< TInputImage, TInputImage>
36 {
37 public:
38  ITK_DISALLOW_COPY_AND_ASSIGN(ConjugateGradientGetX_kPlusOneImageFilter);
39 
44  using OutputImageRegionType = typename TInputImage::RegionType;
45  using AlphaImage = itk::Image<typename TInputImage::InternalPixelType,
46  TInputImage::ImageDimension>;
47 
49  itkNewMacro(Self)
50 
51 
53 
55  void SetXk(const TInputImage* Xk);
56  void SetPk(const TInputImage* Pk);
58 
59  itkGetMacro(Alphak, double)
60  itkSetMacro(Alphak, double)
61 
63  using AddFilterType = itk::AddImageFilter<TInputImage>;
64  using MultiplyFilterType = itk::MultiplyImageFilter<TInputImage, AlphaImage, TInputImage>;
65 
66 protected:
67  ConjugateGradientGetX_kPlusOneImageFilter();
68  ~ConjugateGradientGetX_kPlusOneImageFilter() override = default;
69 
70  typename TInputImage::Pointer GetXk();
71  typename TInputImage::Pointer GetPk();
72 
74  void GenerateData() override;
75 
76  void GenerateOutputInformation() override;
77 
78 private:
79  double m_Alphak;
80 
84 
85 };
86 } //namespace ITK
87 
88 
89 #ifndef ITK_MANUAL_INSTANTIATION
90 #include "rtkConjugateGradientGetX_kPlusOneImageFilter.hxx"
91 #endif
92 
93 #endif
#define itkSetMacro(name, type)