RTK  1.4.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  * 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:
112 
114  itkNewMacro(Self)
115 
116 
117  itkTypeMacro(rtkADMMTotalVariationConjugateGradientOperator, ConjugateGradientOperator)
118 
119  typedef rtk::BackProjectionImageFilter< TOutputImage, TOutputImage > BackProjectionFilterType;
120  typedef typename BackProjectionFilterType::Pointer BackProjectionFilterPointer;
121 
122  typedef rtk::ForwardProjectionImageFilter< TOutputImage, TOutputImage > ForwardProjectionFilterType;
123  typedef typename ForwardProjectionFilterType::Pointer ForwardProjectionFilterPointer;
124 
127  typedef ForwardDifferenceGradientImageFilter<TOutputImage,
128  typename TOutputImage::ValueType,
129  typename TOutputImage::ValueType,
130  TGradientOutputImage> GradientFilterType;
132  <TGradientOutputImage, TOutputImage> DivergenceFilterType;
135 
137  void SetBackProjectionFilter (const BackProjectionFilterPointer _arg);
138 
140  void SetForwardProjectionFilter (const ForwardProjectionFilterPointer _arg);
141 
143  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry)
144 
146  itkSetMacro(Beta, float)
147 
149  void SetGatingWeights(std::vector<float> weights);
150 
152  itkSetMacro(DisableDisplacedDetectorFilter, bool)
153  itkGetMacro(DisableDisplacedDetectorFilter, bool)
154 
155 protected:
157  virtual ~ADMMTotalVariationConjugateGradientOperator() ITK_OVERRIDE {}
158 
160  void GenerateData() ITK_OVERRIDE;
161 
165 
174 
176  float m_Beta;
178 
181  bool m_IsGated;
182  std::vector<float> m_GatingWeights;
183 
187  void VerifyInputInformation() ITK_OVERRIDE {}
188 
191  void GenerateInputRequestedRegion() ITK_OVERRIDE;
192  void GenerateOutputInformation() ITK_OVERRIDE;
194 
195 private:
196  ADMMTotalVariationConjugateGradientOperator(const Self &); //purposely not implemented
197  void operator=(const Self &); //purposely not implemented
198 
199 };
200 } //namespace RTK
201 
202 
203 #ifndef ITK_MANUAL_INSTANTIATION
204 #include "rtkADMMTotalVariationConjugateGradientOperator.hxx"
205 #endif
206 
207 #endif
Base class for forward projection, i.e. accumulation along x-ray lines.
void SetGatingWeights(std::vector< float > weights)
Weigting for displaced detectors.
STL namespace.
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)