19 #ifndef rtkLookupTableImageFilter_h 20 #define rtkLookupTableImageFilter_h 46 template <
class TInput,
class TOutput>
47 class ITK_TEMPLATE_EXPORT
LUT 57 : m_LookupTableDataPointer(nullptr)
65 return m_LookupTablePointer;
70 m_LookupTablePointer = lut;
71 m_LookupTableDataPointer = lut->GetBufferPointer();
72 m_InverseLUTSpacing = 1. / m_LookupTablePointer->GetSpacing()[0];
73 m_Interpolator->SetInputImage(lut);
77 LookupTableDataPointer
80 return m_LookupTableDataPointer;
95 operator()(
const TInput & val)
const;
104 template <
class TInput,
class TOutput>
108 return m_LookupTableDataPointer[val];
115 InterpolatorType::ContinuousIndexType index;
116 index[0] = m_InverseLUTSpacing * (val - m_LookupTablePointer->GetOrigin()[0]);
117 return float(m_Interpolator->EvaluateAtContinuousIndex(index));
124 InterpolatorType::ContinuousIndexType index;
125 index[0] = m_InverseLUTSpacing * (val - m_LookupTablePointer->GetOrigin()[0]);
126 return double(m_Interpolator->EvaluateAtContinuousIndex(index));
144 template <
class TInputImage,
class TOutputImage>
148 Functor::LUT<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
167 #ifdef itkOverrideGetNameOfClassMacro 179 itkDebugMacro(
"setting " 183 if (this->m_LookupTable != _arg || (_arg && _arg->GetTimeStamp() > this->GetTimeStamp()))
185 this->m_LookupTable = _arg;
187 this->GetFunctor().SetLookupTable(_arg);
193 itkGetModifiableObjectMacro(LookupTable, LookupTableType);
198 BeforeThreadedGenerateData()
override;
208 #ifndef ITK_MANUAL_INSTANTIATION 209 # include "rtkLookupTableImageFilter.hxx"
typename itk::LinearInterpolateImageFunction< LookupTableType, double > InterpolatorType
LookupTablePointer GetLookupTable()
void SetLookupTable(LookupTablePointer lut)
double m_InverseLUTSpacing
virtual void SetLookupTable(LookupTableType *_arg)
Function to do the lookup operation.
LookupTableDataPointer m_LookupTableDataPointer
TOutput operator()(const TInput &val) const
typename LookupTableType::PixelType * LookupTableDataPointer
LookupTableType::Pointer m_LookupTable
LookupTablePointer m_LookupTablePointer
InterpolatorPointer m_Interpolator
typename InterpolatorType::Pointer InterpolatorPointer
bool operator==(const LUT &lut) const
typename FunctorType::LookupTableType LookupTableType
LookupTableDataPointer GetLookupTable() const
typename LookupTableType::Pointer LookupTablePointer
bool operator!=(const LUT &lut) const