RTK  2.6.0
Reconstruction Toolkit
rtkRegularizedConjugateGradientConeBeamReconstructionFilter.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 #ifndef rtkRegularizedConjugateGradientConeBeamReconstructionFilter_h
19 #define rtkRegularizedConjugateGradientConeBeamReconstructionFilter_h
20 
22 #ifdef RTK_USE_CUDA
24 #else
26 #endif
28 
30 
31 namespace rtk
32 {
106 template <typename TImage>
108  : public rtk::IterativeConeBeamReconstructionFilter<TImage, TImage>
109 {
110 public:
112 
118 
119 #ifdef RTK_USE_CUDA
120  using GradientImageType = itk::CudaImage<CovariantVectorForSpatialGradient, TImage::ImageDimension>;
121 #else
123 #endif
124 
125  using ForwardProjectionType = typename Superclass::ForwardProjectionType;
126  using BackProjectionType = typename Superclass::BackProjectionType;
127 
129  itkNewMacro(Self);
130 
132  itkOverrideGetNameOfClassMacro(RegularizedConjugateGradientConeBeamReconstructionFilter);
133 
135  void
136  SetInputVolume(const TImage * Volume);
137  typename TImage::ConstPointer
138  GetInputVolume();
140 
142  void
143  SetInputProjectionStack(const TImage * Projection);
144  typename TImage::Pointer
145  GetInputProjectionStack();
147 
149  void
150  SetInputWeights(const TImage * Weights);
151  typename TImage::Pointer
152  GetInputWeights();
154 
156  void
157  SetSupportMask(const TImage * SupportMask);
158  typename TImage::ConstPointer
159  GetSupportMask();
161 
167 
168  // Regularization steps to perform
169  itkSetMacro(PerformPositivity, bool);
170  itkGetMacro(PerformPositivity, bool);
171  itkSetMacro(PerformTVSpatialDenoising, bool);
172  itkGetMacro(PerformTVSpatialDenoising, bool);
173  itkSetMacro(PerformWaveletsSpatialDenoising, bool);
174  itkGetMacro(PerformWaveletsSpatialDenoising, bool);
175  itkSetMacro(PerformSoftThresholdOnImage, bool);
176  itkGetMacro(PerformSoftThresholdOnImage, bool);
177 
178  // Regularization parameters
179  itkSetMacro(GammaTV, float);
180  itkGetMacro(GammaTV, float);
181  itkSetMacro(SoftThresholdWavelets, float);
182  itkGetMacro(SoftThresholdWavelets, float);
183  itkSetMacro(SoftThresholdOnImage, float);
184  itkGetMacro(SoftThresholdOnImage, float);
185 
187  itkGetMacro(NumberOfLevels, unsigned int);
188  itkSetMacro(NumberOfLevels, unsigned int);
190 
192  itkGetMacro(Order, unsigned int);
193  itkSetMacro(Order, unsigned int);
195 
196  // Iterations
197  itkSetMacro(MainLoop_iterations, int);
198  itkGetMacro(MainLoop_iterations, int);
199  itkSetMacro(CG_iterations, int);
200  itkGetMacro(CG_iterations, int);
201  itkSetMacro(TV_iterations, int);
202  itkGetMacro(TV_iterations, int);
203 
204  // Geometry
205  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
206  itkGetModifiableObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
207 
209  itkSetMacro(Preconditioned, bool);
210  itkGetMacro(Preconditioned, bool);
212 
214  itkSetMacro(Tikhonov, float);
215  itkGetMacro(Tikhonov, float);
216  itkSetMacro(Gamma, float);
217  itkGetMacro(Gamma, float);
219 
221  itkSetMacro(CudaConjugateGradient, bool);
222  itkGetMacro(CudaConjugateGradient, bool);
224 
226  itkSetMacro(DisableDisplacedDetectorFilter, bool);
227  itkGetMacro(DisableDisplacedDetectorFilter, bool);
229 
230 protected:
233 
235  void
236  VerifyPreconditions() const override;
237 
239  void
240  GenerateData() override;
241 
242  void
243  GenerateOutputInformation() override;
244 
245  void
246  GenerateInputRequestedRegion() override;
247 
248  // Inputs are not supposed to occupy the same physical space,
249  // so there is nothing to verify
250  void
251  VerifyInputInformation() const override
252  {}
253 
260 
261  // Booleans for each regularization (should it be performed or not)
262  // as well as to choose whether CG should be on GPU or not
268 
269  // Regularization parameters
270  float m_GammaTV;
271  float m_Gamma;
272  float m_Tikhonov;
275  bool m_DimensionsProcessedForTV[TImage::ImageDimension];
278 
280  unsigned int m_Order;
281  unsigned int m_NumberOfLevels;
282 
285 
286  // Iterations
290 
291  // Geometry
293 };
294 } // namespace rtk
295 
296 
297 #ifndef ITK_MANUAL_INSTANTIATION
298 # include "rtkRegularizedConjugateGradientConeBeamReconstructionFilter.hxx"
299 #endif
300 
301 #endif
Applies a total variation denoising, only alm_SingularValueThresholdFilterong the dimensions specifie...
Projection geometry for a source and a 2-D flat panel.
#define itkSetMacro(name, type)
Mother class for cone beam reconstruction filters which need runtime selection of their forward and b...
Deconstructs an image, soft thresholds its wavelets coefficients, then reconstructs.