RTK  2.6.0
Reconstruction Toolkit
rtkWaterPrecorrectionImageFilter.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 rtkWaterPrecorrectionImageFilter_h
20 #define rtkWaterPrecorrectionImageFilter_h
21 
22 #include <vector>
23 #include <itkInPlaceImageFilter.h>
24 
25 #include "rtkConfiguration.h"
26 
27 namespace rtk
28 {
39 template <class TInputImage, class TOutputImage = TInputImage>
40 class ITK_TEMPLATE_EXPORT WaterPrecorrectionImageFilter : public itk::InPlaceImageFilter<TInputImage, TOutputImage>
41 {
42 public:
43  ITK_DISALLOW_COPY_AND_MOVE(WaterPrecorrectionImageFilter);
44 
50 
52  using OutputImageRegionType = typename TOutputImage::RegionType;
53  using VectorType = std::vector<double>;
54 
56  itkNewMacro(Self);
57 
59 #ifdef itkOverrideGetNameOfClassMacro
60  itkOverrideGetNameOfClassMacro(WaterPrecorrectionImageFilter);
61 #else
63 #endif
64 
65 
68  itkGetMacro(Coefficients, VectorType);
69  virtual void
71  {
72  if (this->m_Coefficients != _arg)
73  {
74  this->m_Coefficients = _arg;
75  this->Modified();
76  }
77  }
79 
80 protected:
82  ~WaterPrecorrectionImageFilter() override = default;
83 
84  void
85  DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
86 
87 private:
88  VectorType m_Coefficients; // Correction coefficients
89 };
90 } // end namespace rtk
91 
92 #ifndef ITK_MANUAL_INSTANTIATION
93 # include "rtkWaterPrecorrectionImageFilter.hxx"
94 #endif
95 
96 #endif
Performs the classical water precorrection for beam hardening (Kachelriess, Med. Phys. 2006)
virtual void SetCoefficients(const VectorType _arg)
typename OutputImageType::RegionType OutputImageRegionType