RTK  2.4.1
Reconstruction Toolkit
rtkConjugateGradientImageFilter.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 rtkConjugateGradientImageFilter_h
20 #define rtkConjugateGradientImageFilter_h
21 
22 #include <itkSubtractImageFilter.h>
24 #include <itkTimeProbe.h>
25 
27 
32 
33 namespace rtk
34 {
35 
45 template <typename OutputImageType>
46 class ITK_TEMPLATE_EXPORT ConjugateGradientImageFilter
47  : public itk::InPlaceImageFilter<OutputImageType, OutputImageType>
48 {
49 public:
50  ITK_DISALLOW_COPY_AND_MOVE(ConjugateGradientImageFilter);
51 
58  using OutputImagePointer = typename OutputImageType::Pointer;
59 
61  itkNewMacro(Self);
62 
65 
67  itkGetMacro(NumberOfIterations, int);
68  itkSetMacro(NumberOfIterations, int);
70 
71  void
73 
75  void
76  SetX(const OutputImageType * OutputImage);
77 
79  void
80  SetB(const OutputImageType * OutputImage);
81 
82 protected:
84  ~ConjugateGradientImageFilter() override = default;
85 
87  GetX();
89  GetB();
90 
92  void
93  GenerateData() override;
94 
96  void
97  GenerateInputRequestedRegion() override;
98  void
99  GenerateOutputInformation() override;
101 
103 
105 };
106 } // namespace rtk
107 
108 
109 #ifndef ITK_MANUAL_INSTANTIATION
110 # include "rtkConjugateGradientImageFilter.hxx"
111 #endif
112 
113 #endif
typename OutputImageType::Pointer OutputImagePointer
#define itkSetMacro(name, type)
typename ConjugateGradientOperatorType::Pointer ConjugateGradientOperatorPointerType
TOutputImage OutputImageType
ConjugateGradientOperatorPointerType m_A
Solves AX = B by conjugate gradient.