RTK  2.5.0
Reconstruction Toolkit
rtkLUTbasedVariableI0RawToAttenuationImageFilter.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 rtkLUTbasedVariableI0RawToAttenuationImageFilter_h
20 #define rtkLUTbasedVariableI0RawToAttenuationImageFilter_h
21 
22 #include <itkNumericTraits.h>
23 #include <itkSubtractImageFilter.h>
24 #include <itkLogImageFilter.h>
26 
28 
29 namespace rtk
30 {
77 template <class TInputImage, class TOutputImage>
79  : public LookupTableImageFilter<TInputImage, TOutputImage>
80 {
81 public:
82  ITK_DISALLOW_COPY_AND_MOVE(LUTbasedVariableI0RawToAttenuationImageFilter);
83 
89 
90  using InputImagePixelType = typename TInputImage::PixelType;
91  using OutputImagePixelType = typename TOutputImage::PixelType;
92  using LookupTableType = typename Superclass::FunctorType::LookupTableType;
96 
98  itkNewMacro(Self);
99 
101 #ifdef itkOverrideGetNameOfClassMacro
102  itkOverrideGetNameOfClassMacro(LUTbasedVariableI0RawToAttenuationImageFilter);
103 #else
105 #endif
106 
107 
110  itkGetMacro(I0, double);
111  itkSetMacro(I0, double);
113 
116  itkGetMacro(IDark, double);
117  itkSetMacro(IDark, double);
119 
120  void
121  BeforeThreadedGenerateData() override;
122 
123 protected:
125  ~LUTbasedVariableI0RawToAttenuationImageFilter() override = default;
126 
127 private:
128  double m_I0;
129  double m_IDark;
130  typename SubtractLUTFilterType::Pointer m_SubtractRampFilter;
131  typename ThresholdLUTFilterType::Pointer m_ThresholdRampFilter;
132  typename LogLUTFilterType::Pointer m_LogRampFilter;
133  typename SubtractLUTFilterType::Pointer m_SubtractLUTFilter;
134 };
135 } // end namespace rtk
136 
137 #ifndef ITK_MANUAL_INSTANTIATION
138 # include "rtkLUTbasedVariableI0RawToAttenuationImageFilter.hxx"
139 #endif
140 
141 #endif
Function to do the lookup operation.
typename OutputImageType::PixelType OutputImagePixelType
typename InputImageType::PixelType InputImagePixelType
#define itkSetMacro(name, type)
typename itk::LogImageFilter< LookupTableType, LookupTableType > LogLUTFilterType
typename FunctorType::LookupTableType LookupTableType
typename itk::ThresholdImageFilter< LookupTableType > ThresholdLUTFilterType
typename itk::SubtractImageFilter< LookupTableType > SubtractLUTFilterType