RTK  2.7.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  using GradientImageType =
119  typename TImage::template RebindImageType<CovariantVectorForSpatialGradient, TImage::ImageDimension>;
120  using ForwardProjectionType = typename Superclass::ForwardProjectionType;
121  using BackProjectionType = typename Superclass::BackProjectionType;
122 
124  itkNewMacro(Self);
125 
127  itkOverrideGetNameOfClassMacro(RegularizedConjugateGradientConeBeamReconstructionFilter);
128 
130  void
131  SetInputVolume(const TImage * Volume);
132  typename TImage::ConstPointer
133  GetInputVolume();
135 
137  void
138  SetInputProjectionStack(const TImage * Projection);
139  typename TImage::Pointer
140  GetInputProjectionStack();
142 
144  void
145  SetInputWeights(const TImage * Weights);
146  typename TImage::Pointer
147  GetInputWeights();
149 
151  void
152  SetSupportMask(const TImage * SupportMask);
153  typename TImage::ConstPointer
154  GetSupportMask();
156 
162 
163  // Regularization steps to perform
164  itkSetMacro(PerformPositivity, bool);
165  itkGetMacro(PerformPositivity, bool);
166  itkSetMacro(PerformTVSpatialDenoising, bool);
167  itkGetMacro(PerformTVSpatialDenoising, bool);
168  itkSetMacro(PerformWaveletsSpatialDenoising, bool);
169  itkGetMacro(PerformWaveletsSpatialDenoising, bool);
170  itkSetMacro(PerformSoftThresholdOnImage, bool);
171  itkGetMacro(PerformSoftThresholdOnImage, bool);
172 
173  // Regularization parameters
174  itkSetMacro(GammaTV, float);
175  itkGetMacro(GammaTV, float);
176  itkSetMacro(SoftThresholdWavelets, float);
177  itkGetMacro(SoftThresholdWavelets, float);
178  itkSetMacro(SoftThresholdOnImage, float);
179  itkGetMacro(SoftThresholdOnImage, float);
180 
182  itkGetMacro(NumberOfLevels, unsigned int);
183  itkSetMacro(NumberOfLevels, unsigned int);
185 
187  itkGetMacro(Order, unsigned int);
188  itkSetMacro(Order, unsigned int);
190 
191  // Iterations
192  itkSetMacro(MainLoop_iterations, int);
193  itkGetMacro(MainLoop_iterations, int);
194  itkSetMacro(CG_iterations, int);
195  itkGetMacro(CG_iterations, int);
196  itkSetMacro(TV_iterations, int);
197  itkGetMacro(TV_iterations, int);
198 
199  // Geometry
200  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
201  itkGetModifiableObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
202 
204  itkSetMacro(Preconditioned, bool);
205  itkGetMacro(Preconditioned, bool);
207 
209  itkSetMacro(Tikhonov, float);
210  itkGetMacro(Tikhonov, float);
211  itkSetMacro(Gamma, float);
212  itkGetMacro(Gamma, float);
214 
216  itkSetMacro(CudaConjugateGradient, bool);
217  itkGetMacro(CudaConjugateGradient, bool);
219 
221  itkSetMacro(DisableDisplacedDetectorFilter, bool);
222  itkGetMacro(DisableDisplacedDetectorFilter, bool);
224 
225 protected:
228 
230  void
231  VerifyPreconditions() const override;
232 
234  void
235  GenerateData() override;
236 
237  void
238  GenerateOutputInformation() override;
239 
240  void
241  GenerateInputRequestedRegion() override;
242 
243  // Inputs are not supposed to occupy the same physical space,
244  // so there is nothing to verify
245  void
246  VerifyInputInformation() const override
247  {}
248 
255 
256  // Booleans for each regularization (should it be performed or not)
257  // as well as to choose whether CG should be on GPU or not
263 
264  // Regularization parameters
265  float m_GammaTV;
266  float m_Gamma;
267  float m_Tikhonov;
270  bool m_DimensionsProcessedForTV[TImage::ImageDimension];
273 
275  unsigned int m_Order;
276  unsigned int m_NumberOfLevels;
277 
280 
281  // Iterations
285 
286  // Geometry
288 };
289 } // namespace rtk
290 
291 
292 #ifndef ITK_MANUAL_INSTANTIATION
293 # include "rtkRegularizedConjugateGradientConeBeamReconstructionFilter.hxx"
294 #endif
295 
296 #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)
typename TImage::template RebindImageType< CovariantVectorForSpatialGradient, TImage::ImageDimension > GradientImageType
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.