Commit 8519bd3f authored by Pierre Paleo's avatar Pierre Paleo
Browse files

SinoFilter working on 3D sinogram

parent ace5a174
......@@ -3,7 +3,7 @@ from bisect import bisect
from itertools import product
import numpy as np
import pycuda.gpuarray as garray
from silx.math.fft import FFT
from silx.math.fft.cufft import CUFFT
from silx.image.tomography import compute_fourier_filter, get_next_power
from ..cuda.kernel import CudaKernel
from ..cuda.processing import CudaProcessing
......@@ -51,9 +51,9 @@ class SinoFilter(CudaProcessing):
self.ndim = len(sino_shape)
if self.ndim == 2:
n_angles, dwidth = sino_shape
dwidth_z = 1
n_sinos = 1
elif self.ndim == 3:
dwidth_z, n_angles, dwidth = sino_shape
n_sinos, n_angles, dwidth = sino_shape
else:
raise ValueError("Invalid sinogram number of dimensions")
self.sino_shape = sino_shape
......@@ -64,7 +64,7 @@ class SinoFilter(CudaProcessing):
self.dwidth_padded = int(get_next_power(2*self.dwidth))
self.sino_padded_shape = (n_angles, self.dwidth_padded)
if self.ndim == 3:
self.sino_padded_shape = (dwidth_z, ) + self.sino_padded_shape
self.sino_padded_shape = (n_sinos, ) + self.sino_padded_shape
sino_f_shape = list(self.sino_padded_shape)
sino_f_shape[-1] = sino_f_shape[-1]//2+1
self.sino_f_shape = tuple(sino_f_shape)
......@@ -74,11 +74,10 @@ class SinoFilter(CudaProcessing):
def _init_fft(self):
self.fft = FFT(
self.fft = CUFFT(
self.sino_padded_shape,
dtype=np.float32,
axes=(-1,),
backend="cuda"
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment