ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkPolynomialGainCorrectionImageFilter.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 rtkPolynomialGainCorrectionImageFilter_h
20#define rtkPolynomialGainCorrectionImageFilter_h
21
23
24#include <vector>
25
26#include "rtkMacro.h"
27
39
40namespace rtk
41{
42
43template <class TInputImage, class TOutputImage>
44class ITK_TEMPLATE_EXPORT PolynomialGainCorrectionImageFilter
45 : public itk::ImageToImageFilter<TInputImage, TOutputImage>
46{
47public:
48 ITK_DISALLOW_COPY_AND_MOVE(PolynomialGainCorrectionImageFilter);
49
55
57 using InputImageType = TInputImage;
58 using OutputImageType = TOutputImage;
59 using InputImagePointer = typename InputImageType::Pointer;
60 using OutputImagePointer = typename OutputImageType::Pointer;
61 using InputImageRegionType = typename InputImageType::RegionType;
62 using OutputImageRegionType = typename TOutputImage::RegionType;
63 using VectorType = typename std::vector<float>;
64 using OutputSizeType = typename OutputImageType::SizeType;
65
67 itkNewMacro(Self);
68
70 itkOverrideGetNameOfClassMacro(PolynomialGainCorrectionImageFilter);
71
73 void
75
78 void
80
81 /* if K==0, the filter is bypassed */
82 itkSetMacro(K, float);
83 itkGetMacro(K, float);
84
85protected:
88
89 void
91
92 void
94
95 void
96 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
97
98 bool m_MapsLoaded{ false }; // True if gain maps loaded
99 int m_VModelOrder{ 1 }; // Polynomial correction order
100 float m_K{ 1.0F }; // Scaling constant, a 0 means no correction
101 VectorType m_PowerLut; // Vector containing I^n
103 OutputImagePointer m_GainImage; // Gain coefficients (A matrix)
104 OutputSizeType m_GainSize; // Gain map size
105}; // end of class
106
107} // namespace rtk
108
109#ifndef ITK_MANUAL_INSTANTIATION
110# include "rtkPolynomialGainCorrectionImageFilter.hxx"
111#endif
112
113#endif
Base class for filters that take an image as input and produce an image as output.
Implements transparent reference counting.
~PolynomialGainCorrectionImageFilter() override=default
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
itk::ImageToImageFilter< TInputImage, TOutputImage > Superclass
void SetDarkImage(InputImageType *darkImage)
void SetGainCoefficients(OutputImageType *gain)
#define itkSetMacro(name, type)