21 #ifndef otbShiftScaleImageFilter_h
22 #define otbShiftScaleImageFilter_h
24 #include "itkUnaryFunctorImageFilter.h"
25 #include "itkVariableLengthVector.h"
47 template <
class TInput,
class TOutput>
53 typedef typename itk::NumericTraits<typename TInput::ValueType>::RealType
RealType;
87 for (
unsigned int i = 0; i <
m_Shift.Size(); ++i)
97 for (
unsigned int i = 0; i <
m_Scale.Size(); ++i)
110 return !(*
this != other);
118 result.SetSize(x.GetSize());
121 if (result.GetSize() !=
m_Scale.GetSize() || result.GetSize() !=
m_Shift.GetSize())
123 itkGenericExceptionMacro(<<
"Pixel size different from scale or shift size !");
127 for (
unsigned int i = 0; i < x.GetSize(); ++i)
132 result[i] =
static_cast<typename TOutput::ValueType
>(invertedScale * (x[i] -
m_Shift[i]));
136 result[i] =
static_cast<typename TOutput::ValueType
>(x[i] -
m_Shift[i]);
164 template <
class TInputImage,
class TOutputImage = TInputImage>
166 :
public itk::UnaryFunctorImageFilter<TInputImage, TOutputImage,
167 Functor::VectorShiftScale<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
173 typedef itk::UnaryFunctorImageFilter<TInputImage, TOutputImage, FunctorType>
Superclass;
181 typedef typename itk::NumericTraits<InputValueType>::RealType
InputRealType;
188 itkTypeMacro(ShiftScaleImageFilter, itk::UnaryFunctorImageFilter);
205 void BeforeThreadedGenerateData(
void)
override;
208 void GenerateOutputInformation(
void)
override;
211 void GenerateInputRequestedRegion(
void)
override;
215 void operator=(
const Self&) =
delete;
223 #ifndef OTB_MANUAL_INSTANTIATION