RTK  1.4.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  * 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 #ifndef rtkRegularizedConjugateGradientConeBeamReconstructionFilter_h
19 #define rtkRegularizedConjugateGradientConeBeamReconstructionFilter_h
20 
22 #ifdef RTK_USE_CUDA
24 #else
26 #endif
28 
30 
31 namespace rtk
32 {
101 template< typename TImage>
103 {
104 public:
110 
111 #ifdef RTK_USE_CUDA
112  typedef itk::CudaImage<CovariantVectorForSpatialGradient, TImage::ImageDimension> GradientImageType;
113 #else
115 #endif
116 
119 
121  itkNewMacro(Self)
122 
123 
125 
127  void SetInputVolume(const TImage* Volume);
128  typename TImage::ConstPointer GetInputVolume();
130 
132  void SetInputProjectionStack(const TImage* Projection);
133  typename TImage::Pointer GetInputProjectionStack();
135 
137  void SetInputWeights(const TImage* Projection);
138  typename TImage::Pointer GetInputWeights();
140 
142  void SetSupportMask(const TImage *SupportMask);
143  typename TImage::ConstPointer GetSupportMask();
145 
151 
153  void SetForwardProjectionFilter(ForwardProjectionType fwtype) ITK_OVERRIDE;
154 
156  void SetBackProjectionFilter(BackProjectionType bptype) ITK_OVERRIDE;
157 
158  // Regularization steps to perform
159  itkSetMacro(PerformPositivity, bool)
160  itkGetMacro(PerformPositivity, bool)
161  itkSetMacro(PerformTVSpatialDenoising, bool)
162  itkGetMacro(PerformTVSpatialDenoising, bool)
163  itkSetMacro(PerformWaveletsSpatialDenoising, bool)
164  itkGetMacro(PerformWaveletsSpatialDenoising, bool)
165  itkSetMacro(PerformSoftThresholdOnImage, bool)
166  itkGetMacro(PerformSoftThresholdOnImage, bool)
167 
168  // Regularization parameters
169  itkSetMacro(GammaTV, float)
170  itkGetMacro(GammaTV, float)
171  itkSetMacro(SoftThresholdWavelets, float)
172  itkGetMacro(SoftThresholdWavelets, float)
173  itkSetMacro(SoftThresholdOnImage, float)
174  itkGetMacro(SoftThresholdOnImage, float)
175 
177  itkGetMacro(NumberOfLevels, unsigned int)
178  itkSetMacro(NumberOfLevels, unsigned int)
179 
181  itkGetMacro(Order, unsigned int)
182  itkSetMacro(Order, unsigned int)
183 
185  itkSetMacro(IterationCosts, bool)
186  itkGetMacro(IterationCosts, bool)
187 
188  // Iterations
189  itkSetMacro(MainLoop_iterations, int)
190  itkGetMacro(MainLoop_iterations, int)
191  itkSetMacro(CG_iterations, int)
192  itkGetMacro(CG_iterations, int)
193  itkSetMacro(TV_iterations, int)
194  itkGetMacro(TV_iterations, int)
195 
196  // Geometry
197  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry)
198  itkGetModifiableObjectMacro(Geometry, ThreeDCircularProjectionGeometry)
199 
201  itkSetMacro(Preconditioned, bool)
202  itkGetMacro(Preconditioned, bool)
203 
205  itkSetMacro(Tikhonov, float)
206  itkGetMacro(Tikhonov, float)
207  itkSetMacro(Gamma, float)
208  itkGetMacro(Gamma, float)
209 
211  itkSetMacro(CudaConjugateGradient, bool)
212  itkGetMacro(CudaConjugateGradient, bool)
213 
215  itkSetMacro(DisableDisplacedDetectorFilter, bool)
216  itkGetMacro(DisableDisplacedDetectorFilter, bool)
217 
218 protected:
219  RegularizedConjugateGradientConeBeamReconstructionFilter();
220  virtual ~RegularizedConjugateGradientConeBeamReconstructionFilter() ITK_OVERRIDE {}
221 
223  void GenerateData() ITK_OVERRIDE;
224 
225  void GenerateOutputInformation() ITK_OVERRIDE;
226 
227  void GenerateInputRequestedRegion() ITK_OVERRIDE;
228 
229  // Inputs are not supposed to occupy the same physical space,
230  // so there is nothing to verify
231  void VerifyInputInformation() ITK_OVERRIDE {}
232 
239 
240  // Booleans for each regularization (should it be performed or not)
241  // as well as to choose whether CG should be on GPU or not
247 
248  // Regularization parameters
249  float m_GammaTV;
250  float m_Gamma;
251  float m_Tikhonov;
254  bool m_DimensionsProcessedForTV[TImage::ImageDimension];
257 
259  unsigned int m_Order;
260  unsigned int m_NumberOfLevels;
261 
265 
266  // Iterations
270 
271  // Geometry
273 
274 private:
275  RegularizedConjugateGradientConeBeamReconstructionFilter(const Self &); //purposely not implemented
276  void operator=(const Self &); //purposely not implemented
277 };
278 } //namespace ITK
279 
280 
281 #ifndef ITK_MANUAL_INSTANTIATION
282 #include "rtkRegularizedConjugateGradientConeBeamReconstructionFilter.hxx"
283 #endif
284 
285 #endif
itk::CovariantVector< typename TImage::ValueType, TImage::ImageDimension > CovariantVectorForSpatialGradient
Applies a total variation denoising, only alm_SingularValueThresholdFilterong the dimensions specifie...
Projection geometry for a source and a 2-D flat panel.
void SetBackProjectionFilter(BackProjectionType bptype) override
itk::Image< 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.
#define itkSetMacro(name, type)
void SetForwardProjectionFilter(ForwardProjectionType fwtype) override