RTK  2.7.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 
46 template <class TInputImage, class TOutputImage = TInputImage>
47 class ITK_TEMPLATE_EXPORT BoellaardScatterCorrectionImageFilter
48  : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_MOVE(BoellaardScatterCorrectionImageFilter);
52 
58 
60  using InputImageType = TInputImage;
61  using OutputImageType = TOutputImage;
62  using OutputImageRegionType = typename OutputImageType::RegionType;
63 
65  itkNewMacro(Self);
66 
68  itkOverrideGetNameOfClassMacro(BoellaardScatterCorrectionImageFilter);
69 
72  itkGetMacro(AirThreshold, double);
73  itkSetMacro(AirThreshold, double);
75 
79  itkGetMacro(ScatterToPrimaryRatio, double);
80  itkSetMacro(ScatterToPrimaryRatio, double);
82 
85  itkGetMacro(NonNegativityConstraintThreshold, double);
86  itkSetMacro(NonNegativityConstraintThreshold, double);
88 
89 protected:
91  ~BoellaardScatterCorrectionImageFilter() override = default;
92 
94  void
95  EnlargeOutputRequestedRegion(itk::DataObject * itkNotUsed(output)) override;
96  void
97  ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
99 
103  unsigned int
104  SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType & splitRegion) override;
105  virtual int
106  SplitRequestedRegion(int i, int num, OutputImageRegionType & splitRegion);
108 
109 private:
111  double m_AirThreshold{ 32000 };
112 
114  double m_ScatterToPrimaryRatio{ 0. };
115 
117  double m_NonNegativityConstraintThreshold{ 20 };
118 }; // end of class
119 
120 } // end namespace rtk
121 
122 #ifndef ITK_MANUAL_INSTANTIATION
123 # include "rtkBoellaardScatterCorrectionImageFilter.hxx"
124 #endif
125 
126 #endif
unsigned int ThreadIdType
#define itkSetMacro(name, type)
Scatter correction for cone-beam CT reconstruction.