Skip to content

Commit

Permalink
BUG: Add IsotropicWavelets_EXPORT macro
Browse files Browse the repository at this point in the history
Fix #89

Also reorder includes in those files
  • Loading branch information
phcerdan committed Oct 19, 2018
1 parent 6d8d550 commit 807f0f1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
24 changes: 14 additions & 10 deletions include/itkRieszUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@
#ifndef itkRieszUtilities_h
#define itkRieszUtilities_h

#include <algorithm>
#include <functional>
#include <set>
#include <vector>
#include <functional>
#include <algorithm>

#include "IsotropicWaveletsExport.h"

namespace itk
{
namespace utils
{
/// Factorial
long
Factorial(long n);
IsotropicWavelets_EXPORT long Factorial(long n);

/**
* Compute number of components p(N, d), where N = Order, d = Dimension.
Expand All @@ -40,8 +41,9 @@ Factorial(long n);
*
* @return NumberOfComponents given the order for the ImageDimension.
*/
unsigned int
ComputeNumberOfComponents( const unsigned int & order, const unsigned int & dimension );
IsotropicWavelets_EXPORT
unsigned int ComputeNumberOfComponents( const unsigned int & order,
const unsigned int & dimension );

/**
* Compute all possible unique indices given the subIndex: (X, 0, ..., 0).
Expand All @@ -55,8 +57,8 @@ ComputeNumberOfComponents( const unsigned int & order, const unsigned int & dime
* @param init position to evaluate subIndex. Needed for recursion purposes.
*/
template< typename TIndicesArrayType, unsigned int VImageDimension >
void
ComputeUniqueIndices( TIndicesArrayType subIndex,
IsotropicWavelets_EXPORT
void ComputeUniqueIndices( TIndicesArrayType subIndex,
std::set< TIndicesArrayType, std::greater< TIndicesArrayType > > & uniqueIndices,
unsigned int init = 0 )
{
Expand Down Expand Up @@ -99,6 +101,7 @@ ComputeUniqueIndices( TIndicesArrayType subIndex,
* Compute all the permutations from a set of uniqueIndices.
*/
template< typename TIndicesArrayType >
IsotropicWavelets_EXPORT
std::set< TIndicesArrayType, std::greater< TIndicesArrayType > >
ComputeAllPermutations(
const std::set< TIndicesArrayType, std::greater< TIndicesArrayType > > & uniqueIndices)
Expand All @@ -124,6 +127,7 @@ ComputeAllPermutations(
* where \f$ \text{index}[i]>=0 \f$
*/
template< typename TIndicesArrayType, unsigned int VImageDimension >
IsotropicWavelets_EXPORT
std::set< TIndicesArrayType, std::greater< TIndicesArrayType > >
ComputeAllPossibleIndices(const unsigned int & order)
{
Expand All @@ -137,8 +141,8 @@ ComputeAllPossibleIndices(const unsigned int & order)
}

template< typename TIndicesArrayType, unsigned int VImageDimension >
bool
LessOrEqualIndiceComparisson(
IsotropicWavelets_EXPORT
bool LessOrEqualIndiceComparisson(
const TIndicesArrayType& rhs,
const TIndicesArrayType& lhs)
{
Expand Down
13 changes: 8 additions & 5 deletions include/itkWaveletUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
#ifndef itkWaveletUtilities_h
#define itkWaveletUtilities_h

#include <vector>
#include <cmath>
#include <algorithm>
#include <cmath>
#include <vector>
#include <itkFixedArray.h>
#include <itkMath.h>
#include <itkSize.h>

#include "IsotropicWaveletsExport.h"

namespace itk
{
namespace utils
Expand All @@ -47,16 +49,17 @@ namespace utils
*
* Note that bands and levels are always >= 1. The level/bands returned here corresponds to an index.
*/
IndexPairType IndexToLevelBandSteerablePyramid(unsigned int linearIndex,
unsigned int levels, unsigned int bands);
IsotropicWavelets_EXPORT IndexPairType IndexToLevelBandSteerablePyramid(
unsigned int linearIndex, unsigned int levels, unsigned int bands);

/** Compute max number of levels depending on the size of the image.
* Return J: $ J = \text{min_element}\{J_0,\ldots, J_d\} $;
* where each $J_i$ is the number of integer divisions that can be done with the $i$ size and the scale factor.
* returns 1 if any size is not divisible by the scale factor.
*/
template < unsigned int VImageDimension >
unsigned int ComputeMaxNumberOfLevels(const Size< VImageDimension >& inputSize, const unsigned int & scaleFactor)
IsotropicWavelets_EXPORT unsigned int ComputeMaxNumberOfLevels(
const Size< VImageDimension >& inputSize, const unsigned int & scaleFactor)
{
FixedArray< unsigned int, VImageDimension > exponentPerAxis;
// The minimum level is 1.
Expand Down

0 comments on commit 807f0f1

Please sign in to comment.