RTK  2.5.0
Reconstruction Toolkit
rtkFourDSARTConeBeamReconstructionFilter.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 
19 #ifndef rtkFourDSARTConeBeamReconstructionFilter_h
20 #define rtkFourDSARTConeBeamReconstructionFilter_h
21 
24 
25 #include <itkExtractImageFilter.h>
26 #include <itkMultiplyImageFilter.h>
27 #include <itkSubtractImageFilter.h>
28 #include <itkAddImageAdaptor.h>
29 #include <itkAddImageFilter.h>
32 
34 #include "rtkConstantImageSource.h"
39 
40 namespace rtk
41 {
42 
121 template <class VolumeSeriesType, class ProjectionStackType>
122 class ITK_TEMPLATE_EXPORT FourDSARTConeBeamReconstructionFilter
123  : public rtk::IterativeConeBeamReconstructionFilter<VolumeSeriesType, ProjectionStackType>
124 {
125 public:
126  ITK_DISALLOW_COPY_AND_MOVE(FourDSARTConeBeamReconstructionFilter);
127 
133 
135  using InputImageType = VolumeSeriesType;
136  using OutputImageType = VolumeSeriesType;
137  using VolumeType = ProjectionStackType;
138 
139  using ForwardProjectionType = typename Superclass::ForwardProjectionType;
140  using BackProjectionType = typename Superclass::BackProjectionType;
141 
149  using AddFilterType = itk::AddImageFilter<VolumeSeriesType, VolumeSeriesType>;
154  using DivideFilterType =
160 
162  itkNewMacro(Self);
163 
165 #ifdef itkOverrideGetNameOfClassMacro
166  itkOverrideGetNameOfClassMacro(FourDSARTConeBeamReconstructionFilter);
167 #else
169 #endif
170 
171 
173  void
174  SetInputVolumeSeries(const VolumeSeriesType * VolumeSeries);
175  typename VolumeSeriesType::ConstPointer
176  GetInputVolumeSeries();
178 
180  void
181  SetInputProjectionStack(const ProjectionStackType * Projection);
182  typename ProjectionStackType::Pointer
183  GetInputProjectionStack();
185 
187  itkGetModifiableObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
188  itkSetObjectMacro(Geometry, ThreeDCircularProjectionGeometry);
190 
192  itkGetMacro(NumberOfIterations, unsigned int);
193  itkSetMacro(NumberOfIterations, unsigned int);
195 
197  itkGetMacro(NumberOfProjectionsPerSubset, unsigned int);
198  itkSetMacro(NumberOfProjectionsPerSubset, unsigned int);
200 
202  itkGetMacro(Lambda, double);
203  itkSetMacro(Lambda, double);
205 
207  itkGetMacro(EnforcePositivity, bool);
208  itkSetMacro(EnforcePositivity, bool);
210 
212  void
213  SetWeights(const itk::Array2D<float> _arg);
214 
216  virtual void
217  SetSignal(const std::vector<double> signal);
218 
220  itkSetMacro(DisableDisplacedDetectorFilter, bool);
221  itkGetMacro(DisableDisplacedDetectorFilter, bool);
223 
224 protected:
226  ~FourDSARTConeBeamReconstructionFilter() override = default;
227 
229  void
230  VerifyPreconditions() ITKv5_CONST override;
231 
232  void
233  GenerateInputRequestedRegion() override;
234 
235  void
236  GenerateOutputInformation() override;
237 
238  void
239  GenerateData() override;
240 
243  void
244  VerifyInputInformation() const override
245  {}
246 
254  typename AddFilterType::Pointer m_AddFilter;
255  typename AddFilterType::Pointer m_AddFilter2;
265 
267  std::vector<unsigned int> m_ProjectionsOrder;
270  std::vector<double> m_Signal;
272 
273 private:
277 
280 
282  unsigned int m_NumberOfIterations;
283 
286  double m_Lambda;
287 }; // end of class
288 
289 } // end namespace rtk
290 
291 #ifndef ITK_MANUAL_INSTANTIATION
292 # include "rtkFourDSARTConeBeamReconstructionFilter.hxx"
293 #endif
294 
295 #endif
Base class for forward projection, i.e. accumulation along x-ray lines.
FourDToProjectionStackFilterType::Pointer m_FourDToProjectionStackFilter
ProjectionStackToFourDFilterType::Pointer m_ProjectionStackToFourDFilter
Generate an n-dimensional image with constant pixel values.
Weigting for displaced detectors.
Analytical projection of a BoxShape.
Projection geometry for a source and a 2-D flat panel.
#define itkSetMacro(name, type)
TOutputImage OutputImageType
Implements the 4D Simultaneous Algebraic Reconstruction Technique.
ConstantVolumeSeriesSourceType::Pointer m_ConstantVolumeSeriesSource
itk::AddImageFilter< VolumeSeriesType, VolumeSeriesType > AddFilterType
ConstantProjectionStackSourceType::Pointer m_ConstantProjectionStackSource
Mother class for cone beam reconstruction filters which need runtime selection of their forward and b...
typename Superclass::ForwardProjectionType ForwardProjectionType
Implements part of the 4D reconstruction by conjugate gradient.