RTK  2.6.0
Reconstruction Toolkit
rtkBoellaardScatterCorrectionImageFilter.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 rtkBoellaardScatterCorrectionImageFilter_h
20 #define rtkBoellaardScatterCorrectionImageFilter_h
21 
22 #include <itkInPlaceImageFilter.h>
23 #include "rtkConfiguration.h"
24 
25 namespace rtk
26 {
27 
39 template <class TInputImage, class TOutputImage = TInputImage>
40 class ITK_TEMPLATE_EXPORT BoellaardScatterCorrectionImageFilter
41  : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_MOVE(BoellaardScatterCorrectionImageFilter);
45 
51 
53  using InputImageType = TInputImage;
54  using OutputImageType = TOutputImage;
55  using OutputImageRegionType = typename OutputImageType::RegionType;
56 
58  itkNewMacro(Self);
59 
61 #ifdef itkOverrideGetNameOfClassMacro
62  itkOverrideGetNameOfClassMacro(BoellaardScatterCorrectionImageFilter);
63 #else
65 #endif
66 
67 
70  itkGetMacro(AirThreshold, double);
71  itkSetMacro(AirThreshold, double);
73 
77  itkGetMacro(ScatterToPrimaryRatio, double);
78  itkSetMacro(ScatterToPrimaryRatio, double);
80 
83  itkGetMacro(NonNegativityConstraintThreshold, double);
84  itkSetMacro(NonNegativityConstraintThreshold, double);
86 
87 protected:
89  ~BoellaardScatterCorrectionImageFilter() override = default;
90 
92  void
93  EnlargeOutputRequestedRegion(itk::DataObject * itkNotUsed(output)) override;
94  void
95  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
97 
101  unsigned int
102  SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion) override;
103  virtual int
104  SplitRequestedRegion(int i, int num, OutputImageRegionType & splitRegion);
106 
107 private:
109  double m_AirThreshold{ 32000 };
110 
112  double m_ScatterToPrimaryRatio{ 0. };
113 
115  double m_NonNegativityConstraintThreshold{ 20 };
116 }; // end of class
117 
118 } // end namespace rtk
119 
120 #ifndef ITK_MANUAL_INSTANTIATION
121 # include "rtkBoellaardScatterCorrectionImageFilter.hxx"
122 #endif
123 
124 #endif
TInputImage InputImageType
#define itkSetMacro(name, type)
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
Scatter correction for cone-beam CT reconstruction.
unsigned int ThreadIdType