RTK  2.0.1
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  * 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 
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>
41  public itk::InPlaceImageFilter<TInputImage, TOutputImage>
42 {
43 public:
44  ITK_DISALLOW_COPY_AND_ASSIGN(WaterPrecorrectionImageFilter);
45 
51 
53  using OutputImageRegionType = typename TOutputImage::RegionType;
54  using VectorType = std::vector< double >;
55 
57  itkNewMacro(Self);
58 
61 
64  itkGetMacro(Coefficients, VectorType);
65  virtual void SetCoefficients (const VectorType _arg)
66  {
67  if ( this->m_Coefficients != _arg )
68  {
69  this->m_Coefficients = _arg;
70  this->Modified();
71  }
72  }
74 
75 protected:
77  ~WaterPrecorrectionImageFilter() override = default;
78 
79 #if ITK_VERSION_MAJOR<5
80  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
81 #else
82  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
83 #endif
84 
85 private:
86  VectorType m_Coefficients; // Correction coefficients
87 };
88 } // end namespace rtk
89 
90 #ifndef ITK_MANUAL_INSTANTIATION
91 #include "rtkWaterPrecorrectionImageFilter.hxx"
92 #endif
93 
94 #endif
Performs the classical water precorrection for beam hardening (Kachelriess, Med. Phys. 2006)
typename TOutputImage::RegionType OutputImageRegionType
virtual void SetCoefficients(const VectorType _arg)
unsigned int ThreadIdType