fftkernel.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef mia_2d_fftkernel_hh
#define mia_2d_fftkernel_hh
#include <complex>
#include <fftw3.h>
#include <mia/core/defines.hh>
#include <mia/core/factory.hh>
#include <mia/core/spacial_kernel.hh>
#include <mia/2d/defines2d.hh>
#include <mia/2d/vector.hh>
NS_MIA_BEGIN
struct EXPORT_2D fft2d_kernel_data {
static const char *data_descr;
};
class EXPORT_2D CFFT2DKernel : public CProductBase
{
public:
typedef fft2d_kernel_data plugin_data;
typedef kernel_plugin_type plugin_type;
CFFT2DKernel();
virtual ~CFFT2DKernel();
void apply() const;
float *prepare(const C2DBounds& size);
private:
/*
free all the FFT structures
*/
void tear_down();
virtual void do_apply(const C2DBounds& m_size, size_t m_realsize_x,
fftwf_complex *m_cbuffer) const = 0;
C2DBounds m_size;
fftwf_complex *m_cbuffer;
float *m_fbuffer;
float m_scale;
fftwf_plan m_forward_plan;
fftwf_plan m_backward_plan;
size_t m_realsize_x;
};
typedef std::shared_ptr<CFFT2DKernel > PFFT2DKernel;
typedef TFactory<CFFT2DKernel> CFFT2DKernelPlugin;
typedef THandlerSingleton<TFactoryPluginHandler<CFFT2DKernelPlugin>> CFFT2DKernelPluginHandler;
NS_MIA_END
#endif
vector.hh
C2DBounds
T2DVector< unsigned int > C2DBounds
unsigned int valued 2D vector - used as 2D size parameter
Definition 2d/vector.hh:540
CProductBase
The base class for all plug-in created object.
Definition product_base.hh:41
TFactory
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition factory.hh:51
THandlerSingleton
the singleton that a plug-in handler really is
Definition handler.hh:159
defines2d.hh
EXPORT_2D
#define EXPORT_2D
Definition defines2d.hh:37
defines.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
factory.hh
spacial_kernel.hh
fft2d_kernel_data
Definition fftkernel.hh:35
fft2d_kernel_data::data_descr
static const char * data_descr
Definition fftkernel.hh:36
kernel_plugin_type
Definition spacial_kernel.hh:38