diff options
Diffstat (limited to 'silx/opencl/sinofilter.py')
-rw-r--r-- | silx/opencl/sinofilter.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/silx/opencl/sinofilter.py b/silx/opencl/sinofilter.py index ad17acb..d608744 100644 --- a/silx/opencl/sinofilter.py +++ b/silx/opencl/sinofilter.py @@ -2,7 +2,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2016 European Synchrotron Radiation Facility +# Copyright (c) 2016-2019 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -38,19 +38,20 @@ from math import pi import pyopencl.array as parray from .common import pyopencl as cl from .processing import OpenclProcessing -from ..math.fft import FFT -from ..math.fft.clfft import __have_clfft__ +from ..math.fft.clfft import CLFFT, __have_clfft__ +from ..math.fft.npfft import NPFFT from ..image.tomography import generate_powers, get_next_power, compute_fourier_filter from ..utils.deprecation import deprecated class SinoFilter(OpenclProcessing): - """ - A class for performing sinogram filtering on GPU using OpenCL. + """A class for performing sinogram filtering on GPU using OpenCL. + This is a convolution in the Fourier space, along one dimension: - - In 2D: (n_a, d_x): n_a filterings (1D FFT of size d_x) - - In 3D: (n_z, n_a, d_x): n_z*n_a filterings (1D FFT of size d_x) + + - In 2D: (n_a, d_x): n_a filterings (1D FFT of size d_x) + - In 3D: (n_z, n_a, d_x): n_z*n_a filterings (1D FFT of size d_x) """ kernel_files = ["array_utils.cl"] powers = generate_powers() @@ -121,11 +122,10 @@ class SinoFilter(OpenclProcessing): def _init_fft(self): if __have_clfft__ and not(self.extra_options["use_numpy_fft"]): self.fft_backend = "opencl" - self.fft = FFT( + self.fft = CLFFT( self.sino_padded_shape, dtype=np.float32, axes=(-1,), - backend="opencl", ctx=self.ctx, ) else: @@ -133,10 +133,9 @@ class SinoFilter(OpenclProcessing): print("The gpyfft module was not found. The Fourier transforms " "will be done on CPU. For more performances, it is advised " "to install gpyfft.""") - self.fft = FFT( + self.fft = NPFFT( template=np.zeros(self.sino_padded_shape, "f"), axes=(-1,), - backend="numpy", ) def _allocate_memory(self): |