RTK  1.4.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  * 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:
49 
51  typedef typename TOutputImage::RegionType OutputImageRegionType;
52  typedef std::vector< double > VectorType;
53 
55  itkNewMacro(Self);
56 
59 
62  itkGetMacro(Coefficients, VectorType);
63  virtual void SetCoefficients (const VectorType _arg)
64  {
65  if ( this->m_Coefficients != _arg )
66  {
67  this->m_Coefficients = _arg;
68  this->Modified();
69  }
70  }
72 
73 protected:
75  virtual ~WaterPrecorrectionImageFilter() ITK_OVERRIDE {}
76 
77 #if ITK_VERSION_MAJOR<5
78  void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE;
79 #else
80  void DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) ITK_OVERRIDE;
81 #endif
82 
83 private:
84  WaterPrecorrectionImageFilter(const Self &); //purposely not implemented
85  void operator=(const Self &); //purposely not implemented
86 
87  VectorType m_Coefficients; // Correction coefficients
88 };
89 } // end namespace rtk
90 
91 #ifndef ITK_MANUAL_INSTANTIATION
92 #include "rtkWaterPrecorrectionImageFilter.hxx"
93 #endif
94 
95 #endif
Performs the classical water precorrection for beam hardening (Kachelriess, Med. Phys. 2006)
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
virtual void SetCoefficients(const VectorType _arg)
unsigned int ThreadIdType