RTK  2.7.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 class ITK_TEMPLATE_EXPORT ADMMTotalVariationConjugateGradientOperator : public ConjugateGradientOperator<TOutputImage>
105 {
106 public:
107  ITK_DISALLOW_COPY_AND_MOVE(ADMMTotalVariationConjugateGradientOperator);
108 
113 
115  itkNewMacro(Self);
116 
118  itkOverrideGetNameOfClassMacro(ADMMTotalVariationConjugateGradientOperator);
119 
122 
125 
128 
130  using GradientImageType =
131  typename TOutputImage::template RebindImageType<VectorPixelType, TOutputImage::ImageDimension>;
132 
134  typename TOutputImage::ValueType,
135  typename TOutputImage::ValueType,
140 
142  void
143  SetBackProjectionFilter(BackProjectionFilterType * _arg);
144 
146  void
147  SetForwardProjectionFilter(ForwardProjectionFilterType * _arg);
148 
150  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
151 
153  itkSetMacro(Beta, float);
154 
156  void
157  SetGatingWeights(std::vector<float> weights);
158 
160  itkSetMacro(DisableDisplacedDetectorFilter, bool);
161  itkGetMacro(DisableDisplacedDetectorFilter, bool);
163 
164 protected:
166  ~ADMMTotalVariationConjugateGradientOperator() override = default;
167 
169  void
170  VerifyPreconditions() const override;
171 
173  void
174  GenerateData() override;
175 
179 
188 
190  float m_Beta;
192 
195  bool m_IsGated;
196  std::vector<float> m_GatingWeights;
197 
201  void
202  VerifyInputInformation() const override
203  {}
204 
207  void
208  GenerateInputRequestedRegion() override;
209  void
210  GenerateOutputInformation() override;
211 };
212 } // namespace rtk
214 
215 
216 #ifndef ITK_MANUAL_INSTANTIATION
217 # include "rtkADMMTotalVariationConjugateGradientOperator.hxx"
218 #endif
219 
220 #endif
typename TOutputImage::template RebindImageType< VectorPixelType, TOutputImage::ImageDimension > GradientImageType
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...