RTK  2.5.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 #ifdef itkOverrideGetNameOfClassMacro
122  itkOverrideGetNameOfClassMacro(ADMMTotalVariationConjugateGradientOperator);
123 #else
125 #endif
126 
127 
130 
133 
137  typename TOutputImage::ValueType,
138  typename TOutputImage::ValueType,
139  TGradientOutputImage>;
143 
145  void
146  SetBackProjectionFilter(const BackProjectionFilterPointer _arg);
147 
149  void
150  SetForwardProjectionFilter(const ForwardProjectionFilterPointer _arg);
151 
153  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
154 
156  itkSetMacro(Beta, float);
157 
159  void
160  SetGatingWeights(std::vector<float> weights);
161 
163  itkSetMacro(DisableDisplacedDetectorFilter, bool);
164  itkGetMacro(DisableDisplacedDetectorFilter, bool);
166 
167 protected:
169  ~ADMMTotalVariationConjugateGradientOperator() override = default;
170 
172  void
173  VerifyPreconditions() ITKv5_CONST override;
174 
176  void
177  GenerateData() override;
178 
180  BackProjectionFilterPointer m_BackProjectionFilter;
181  ForwardProjectionFilterPointer m_ForwardProjectionFilter;
182 
183  typename SubtractFilterType::Pointer m_SubtractFilter;
184  typename MultiplyFilterType::Pointer m_MultiplyFilter;
185  typename MultiplyFilterType::Pointer m_ZeroMultiplyProjectionFilter;
186  typename MultiplyFilterType::Pointer m_ZeroMultiplyVolumeFilter;
187  typename DivergenceFilterType::Pointer m_DivergenceFilter;
188  typename GradientFilterType::Pointer m_GradientFilter;
189  typename DisplacedDetectorFilterType::Pointer m_DisplacedDetectorFilter;
190  typename GatingWeightsFilterType::Pointer m_GatingWeightsFilter;
191 
193  float m_Beta;
194  bool m_DisableDisplacedDetectorFilter;
195 
198  bool m_IsGated;
199  std::vector<float> m_GatingWeights;
200 
204  void
205  VerifyInputInformation() const override
206  {}
207 
210  void
211  GenerateInputRequestedRegion() override;
212  void
213  GenerateOutputInformation() override;
214 };
215 } // namespace rtk
217 
218 
219 #ifndef ITK_MANUAL_INSTANTIATION
220 # include "rtkADMMTotalVariationConjugateGradientOperator.hxx"
221 #endif
222 
223 #endif
Weigting for displaced detectors.
STL namespace.
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...