Skip to content

Commit

Permalink
ENH: Manually register FFT factories in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tbirdso committed Nov 19, 2021
1 parent bb3c27e commit a7d1fdf
Show file tree
Hide file tree
Showing 26 changed files with 400 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ itkFFTConvolutionImageFilterDeltaFunctionTest(int argc, char * argv[])

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ itkFFTConvolutionImageFilterTest(int argc, char * argv[])

ITK_TRY_EXPECT_NO_EXCEPTION(reader2->Update());

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK tests
#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,15 @@ itkFFTConvolutionImageFilterTestInt(int argc, char * argv[])

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,19 @@ itkFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[])

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::FFTWForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::FFTWInverseFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::VnlForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::VnlInverseFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

auto filter = FilterType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,19 @@ itkMaskedFFTNormalizedCorrelationImageFilterTest(int argc, char * argv[])

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTWHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::FFTWForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::FFTWInverseFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlRealToHalfHermitianForwardFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::VnlHalfHermitianToRealInverseFFTImageFilterFactory>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::VnlForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<itk::FFTImageFilterFactory<itk::VnlInverseFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

auto filter = FilterType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
#include "itkImageFileWriter.h"
#include "itkTestingMacros.h"

#include "itkObjectFactoryBase.h"
#include "itkVnlRealToHalfHermitianForwardFFTImageFilter.h"
#include "itkVnlHalfHermitianToRealInverseFFTImageFilter.h"
#if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.h"
# include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.h"
#endif

int
itkInverseDeconvolutionImageFilterTest(int argc, char * argv[])
{
Expand Down Expand Up @@ -50,6 +58,19 @@ itkInverseDeconvolutionImageFilterTest(int argc, char * argv[])
itk::ConstantBoundaryCondition<ImageType> cbc;
cbc.SetConstant(0.0);

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
auto convolutionFilter = ConvolutionFilterType::New();
convolutionFilter->SetInput(reader1->GetOutput());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
#include "itkMath.h"
#include "itkTestingMacros.h"

#include "itkObjectFactoryBase.h"
#include "itkVnlRealToHalfHermitianForwardFFTImageFilter.h"
#include "itkVnlHalfHermitianToRealInverseFFTImageFilter.h"
#if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.h"
# include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.h"
#endif

int
itkLandweberDeconvolutionImageFilterTest(int argc, char * argv[])
{
Expand All @@ -50,6 +58,19 @@ itkLandweberDeconvolutionImageFilterTest(int argc, char * argv[])
kernelReader->SetFileName(argv[2]);
kernelReader->Update();

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

// Generate a convolution of the input image with the kernel image
using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
auto convolutionFilter = ConvolutionFilterType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
#include "itkParametricBlindLeastSquaresDeconvolutionImageFilter.h"
#include "itkTestingMacros.h"

#include "itkObjectFactoryBase.h"
#include "itkVnlRealToHalfHermitianForwardFFTImageFilter.h"
#include "itkVnlHalfHermitianToRealInverseFFTImageFilter.h"
#if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.h"
# include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.h"
#endif

// Define a version of the GaussianImageSource that has only the sigma
// parameters
namespace itk
Expand Down Expand Up @@ -157,6 +165,20 @@ itkParametricBlindLeastSquaresDeconvolutionImageFilterTest(int argc, char * argv
mean[1] = 0.5 * (size[1] - 1) * spacing[1];
kernelSource->SetMean(mean);


#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

// Generate a convolution of the input image with a kernel computed
// from a parametric image source. We'll try to recover those
// parameters later.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,33 @@
#include "itkProjectedIterativeDeconvolutionImageFilter.h"
#include "itkSimpleFilterWatcher.h"

#include "itkObjectFactoryBase.h"
#include "itkVnlRealToHalfHermitianForwardFFTImageFilter.h"
#include "itkVnlHalfHermitianToRealInverseFFTImageFilter.h"
#if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.h"
# include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.h"
#endif

int
itkProjectedIterativeDeconvolutionImageFilterTest(int, char *[])
{
// Declare the image type
using ImageType = itk::Image<float, 2>;

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

// Declare the base deconvolution filter choice
using BaseDeconvolutionFilterType = itk::LandweberDeconvolutionImageFilter<ImageType>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
#include "itkDeconvolutionIterationCommand.h"
#include "itkTestingMacros.h"

#include "itkObjectFactoryBase.h"
#include "itkVnlRealToHalfHermitianForwardFFTImageFilter.h"
#include "itkVnlHalfHermitianToRealInverseFFTImageFilter.h"
#if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.h"
# include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.h"
#endif

int
itkProjectedLandweberDeconvolutionImageFilterTest(int argc, char * argv[])
{
Expand All @@ -46,6 +54,19 @@ itkProjectedLandweberDeconvolutionImageFilterTest(int argc, char * argv[])
kernelReader->SetFileName(argv[2]);
kernelReader->Update();

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

// Generate a convolution of the input image with the kernel image
using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
auto convolutionFilter = ConvolutionFilterType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#include "itkSimpleFilterWatcher.h"
#include "itkTestingMacros.h"

#include "itkObjectFactoryBase.h"
#include "itkVnlRealToHalfHermitianForwardFFTImageFilter.h"
#include "itkVnlHalfHermitianToRealInverseFFTImageFilter.h"
#if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.h"
# include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.h"
#endif

int
itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[])
{
Expand All @@ -48,6 +56,19 @@ itkRichardsonLucyDeconvolutionImageFilterTest(int argc, char * argv[])
kernelReader->SetFileName(argv[2]);
kernelReader->Update();

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

// Generate a convolution of the input image with the kernel image
using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
auto convolutionFilter = ConvolutionFilterType::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
#include "itkImageFileWriter.h"
#include "itkTestingMacros.h"

#include "itkObjectFactoryBase.h"
#include "itkVnlRealToHalfHermitianForwardFFTImageFilter.h"
#include "itkVnlHalfHermitianToRealInverseFFTImageFilter.h"
#if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
# include "itkFFTWRealToHalfHermitianForwardFFTImageFilter.h"
# include "itkFFTWHalfHermitianToRealInverseFFTImageFilter.h"
#endif

int
itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[])
{
Expand Down Expand Up @@ -51,6 +59,19 @@ itkTikhonovDeconvolutionImageFilterTest(int argc, char * argv[])
itk::ConstantBoundaryCondition<ImageType> cbc;
cbc.SetConstant(0.0);

#ifndef ITK_FFT_FACTORY_REGISTER_MANAGER // Manual factory registration is required for ITK FFT tests
# if defined(ITK_USE_FFTWD) || defined(ITK_USE_FFTWF)
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::FFTWHalfHermitianToRealInverseFFTImageFilter>>();
# endif
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlRealToHalfHermitianForwardFFTImageFilter>>();
itk::ObjectFactoryBase::RegisterInternalFactoryOnce<
itk::FFTImageFilterFactory<itk::VnlHalfHermitianToRealInverseFFTImageFilter>>();
#endif

using ConvolutionFilterType = itk::FFTConvolutionImageFilter<ImageType>;
auto convolutionFilter = ConvolutionFilterType::New();
convolutionFilter->SetInput(reader1->GetOutput());
Expand Down
Loading

0 comments on commit a7d1fdf

Please sign in to comment.