RTK  2.0.1
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  * 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 rtkADMMTotalVariationConjugateGradientOperator_h
20 #define rtkADMMTotalVariationConjugateGradientOperator_h
21 
22 #include <itkMultiplyImageFilter.h>
23 #include <itkSubtractImageFilter.h>
24 
33 
34 namespace rtk
35 {
36 
102 template< typename TOutputImage, typename TGradientOutputImage =
104  TOutputImage::ImageDimension > >
106 {
107 public:
108  ITK_DISALLOW_COPY_AND_ASSIGN(ADMMTotalVariationConjugateGradientOperator);
109 
114 
116  itkNewMacro(Self)
117 
118 
119  itkTypeMacro(rtkADMMTotalVariationConjugateGradientOperator, ConjugateGradientOperator)
120 
121  using BackProjectionFilterType = rtk::BackProjectionImageFilter< TOutputImage, TOutputImage >;
123 
124  using ForwardProjectionFilterType = rtk::ForwardProjectionImageFilter< TOutputImage, TOutputImage >;
126 
130  typename TOutputImage::ValueType,
131  typename TOutputImage::ValueType,
132  TGradientOutputImage>;
134  <TGradientOutputImage, TOutputImage>;
137 
140 
143 
145  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry)
146 
148  itkSetMacro(Beta, float)
149 
151  void SetGatingWeights(std::vector<float> weights);
152 
154  itkSetMacro(DisableDisplacedDetectorFilter, bool)
155  itkGetMacro(DisableDisplacedDetectorFilter, bool)
156 
157 protected:
159  ~ADMMTotalVariationConjugateGradientOperator() override = default;
160 
162  void GenerateData() override;
163 
167 
176 
178  float m_Beta;
180 
183  bool m_IsGated;
184  std::vector<float> m_GatingWeights;
185 
189 #if ITK_VERSION_MAJOR<5
190  void VerifyInputInformation() override {}
191 #else
192  void VerifyInputInformation() const override {}
193 #endif
194 
195 
198  void GenerateInputRequestedRegion() override;
199  void GenerateOutputInformation() override;
200 };
201 } //namespace RTK
203 
204 
205 #ifndef ITK_MANUAL_INSTANTIATION
206 #include "rtkADMMTotalVariationConjugateGradientOperator.hxx"
207 #endif
208 
209 #endif
void SetGatingWeights(std::vector< float > weights)
Weigting for displaced detectors.
STL namespace.
typename ForwardProjectionFilterType::Pointer ForwardProjectionFilterPointer
Projection geometry for a source and a 2-D flat panel.
Computes the gradient of an image using forward difference.
void SetBackProjectionFilter(const BackProjectionFilterPointer _arg)
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.
void SetForwardProjectionFilter(const ForwardProjectionFilterPointer _arg)
Computes the backward differences divergence (adjoint of the forward differences gradient) of the inp...
#define itkSetMacro(name, type)