18#ifndef itkWaveletUtilities_h
19#define itkWaveletUtilities_h
28#include "IsotropicWaveletsExport.h"
70template <
unsigned int VImageDimension>
71ITK_TEMPLATE_EXPORT
unsigned int
76 exponentPerAxis.
Fill(1);
77 for (
unsigned int axis = 0; axis < VImageDimension; ++axis)
79 size_t sizeAxis = inputSize[axis];
80 double exponent = std::log(
static_cast<double>(sizeAxis)) / std::log(
static_cast<double>(scaleFactor));
82 double exponentIntPart;
83 double exponentFractionPart = std::modf(exponent, &exponentIntPart);
88 exponentPerAxis[axis] =
static_cast<unsigned int>(exponent);
93 auto sizeAtLevel =
static_cast<double>(sizeAxis);
96 double division = sizeAtLevel /
static_cast<double>(scaleFactor);
97 double intPartDivision;
98 double fractionPartDivision = std::modf(division, &intPartDivision);
101 exponentPerAxis[axis]++;
102 sizeAtLevel = intPartDivision;
113 return *std::min_element(exponentPerAxis.
Begin(), exponentPerAxis.
End());
Simulate a standard C array with copy semantics.
void Fill(const ValueType &)
Define additional traits for native types such as int or float.
bool FloatAlmostEqual(T x1, T x2, typename Detail::FloatIEEE< T >::IntType maxUlps=4, typename Detail::FloatIEEE< T >::FloatType maxAbsoluteDifference=0.1 *itk::NumericTraits< T >::epsilon())
Compare two floats and return if they are effectively equal.
ITK_TEMPLATE_EXPORT unsigned int ComputeMaxNumberOfLevels(const Size< VImageDimension > &inputSize, const unsigned int &scaleFactor)
std::pair< unsigned int, unsigned int > IndexPairType
IsotropicWavelets_EXPORT IndexPairType IndexToLevelBandSteerablePyramid(unsigned int linearIndex, unsigned int levels, unsigned int bands)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Represent a n-dimensional size (bounds) of a n-dimensional image.