RTK  2.6.0
Reconstruction Toolkit
rtkADMMTotalVariationConjugateGradientOperator.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 rtkADMMTotalVariationConjugateGradientOperator_h
20 #define rtkADMMTotalVariationConjugateGradientOperator_h
21 
22 #include <itkMultiplyImageFilter.h>
23 #include <itkSubtractImageFilter.h>
24 
33 
34 namespace rtk
35 {
36 
103 template <typename TOutputImage,
104  typename TGradientOutputImage =
106  TOutputImage::ImageDimension>>
107 class ITK_TEMPLATE_EXPORT ADMMTotalVariationConjugateGradientOperator : public ConjugateGradientOperator<TOutputImage>
108 {
109 public:
110  ITK_DISALLOW_COPY_AND_MOVE(ADMMTotalVariationConjugateGradientOperator);
111 
116 
118  itkNewMacro(Self);
119 
121  itkOverrideGetNameOfClassMacro(ADMMTotalVariationConjugateGradientOperator);
122 
125 
128 
132  typename TOutputImage::ValueType,
133  typename TOutputImage::ValueType,
134  TGradientOutputImage>;
138 
140  void
141  SetBackProjectionFilter(BackProjectionFilterType * _arg);
142 
144  void
145  SetForwardProjectionFilter(ForwardProjectionFilterType * _arg);
146 
148  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
149 
151  itkSetMacro(Beta, float);
152 
154  void
155  SetGatingWeights(std::vector<float> weights);
156 
158  itkSetMacro(DisableDisplacedDetectorFilter, bool);
159  itkGetMacro(DisableDisplacedDetectorFilter, bool);
161 
162 protected:
164  ~ADMMTotalVariationConjugateGradientOperator() override = default;
165 
167  void
168  VerifyPreconditions() const override;
169 
171  void
172  GenerateData() override;
173 
177 
186 
188  float m_Beta;
190 
193  bool m_IsGated;
194  std::vector<float> m_GatingWeights;
195 
199  void
200  VerifyInputInformation() const override
201  {}
202 
205  void
206  GenerateInputRequestedRegion() override;
207  void
208  GenerateOutputInformation() override;
209 };
210 } // namespace rtk
212 
213 
214 #ifndef ITK_MANUAL_INSTANTIATION
215 # include "rtkADMMTotalVariationConjugateGradientOperator.hxx"
216 #endif
217 
218 #endif
Weigting for displaced detectors.
typename ForwardProjectionFilterType::Pointer ForwardProjectionFilterPointer
Projection geometry for a source and a 2-D flat panel.
#define itkSetMacro(name, type)
Computes the gradient of an image using forward difference.
Implements the operator A used in the conjugate gradient step of ADMM reconstruction with total varia...
Multiplies each (n-1) dimension image by the corresponding element in a vector.
Computes the backward differences divergence (adjoint of the forward differences gradient) of the inp...