21 #ifndef otbProlateInterpolateImageFunction_hxx
22 #define otbProlateInterpolateImageFunction_hxx
30 template <
class TInput,
class TOutput>
33 vnl_vector<std::complex<double>> resampledProfile(1024);
34 resampledProfile.fill(0);
36 for (
unsigned int i = 0; i < m_Radius + 1; ++i)
38 unsigned int ival =
static_cast<unsigned int>(
static_cast<double>(m_OriginalProfile.size() * i) /
static_cast<double>(m_Radius + 1));
39 resampledProfile[i] = m_OriginalProfile[ival];
41 vnl_fft_1d<double> v1d(1024);
42 v1d.fwd_transform(resampledProfile);
45 unsigned int sampleNb =
static_cast<unsigned int>(1024 / (2 * resampleRatio));
49 for (
unsigned int j = 0; j < sampleNb + 1; ++j)
51 energy += std::abs(resampledProfile[j]) * std::abs(resampledProfile[j]);
54 for (
unsigned int j = 1023; j > 1023 - sampleNb; j--)
56 energy += std::abs(resampledProfile[j]) * std::abs(resampledProfile[j]);
59 double totalEnergy = energy;
61 for (
unsigned int j = sampleNb + 1; j < 1023 - sampleNb + 1; ++j)
63 totalEnergy += std::abs(resampledProfile[j]) * std::abs(resampledProfile[j]);
66 return std::sqrt(energy) / std::sqrt(totalEnergy);
72 template <
class TInputImage,
class TBoundaryCondition,
class TCoordRep,
class TInputInterpolator,
class TOutputInterpolator>
76 this->SetNormalizeWeight(
true);
81 template <
class TInputImage,
class TBoundaryCondition,
class TCoordRep,
class TInputInterpolator,
class TOutputInterpolator>
86 template <
class TInputImage,
class TBoundaryCondition,
class TCoordRep,
class TInputInterpolator,
class TOutputInterpolator>
88 itk::Indent indent)
const
90 Superclass::PrintSelf(os, indent);