From 2cade421497b741fdb94864e47830fdc98973550 Mon Sep 17 00:00:00 2001 From: Zaccharie Ramzi Date: Thu, 16 Jul 2020 15:38:46 +0200 Subject: [PATCH 1/2] changed the default table type to be complex64 in order to gain in memory --- tfkbnufft/kbnufft.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tfkbnufft/kbnufft.py b/tfkbnufft/kbnufft.py index 3359060..2f0d9c1 100644 --- a/tfkbnufft/kbnufft.py +++ b/tfkbnufft/kbnufft.py @@ -38,7 +38,7 @@ class KbNufftModule(KbModule): def __init__(self, im_size, grid_size=None, numpoints=6, n_shift=None, table_oversamp=2**10, kbwidth=2.34, order=0, norm='None', - coil_broadcast=False, matadj=False): + coil_broadcast=False, matadj=False, table_dtype=np.complex64): super(KbNufftModule, self).__init__() self.im_size = im_size @@ -82,7 +82,7 @@ def __init__(self, im_size, grid_size=None, numpoints=6, n_shift=None, order=self.order, alpha=self.alpha ) - self.table = table + self.table = table.astype(table_dtype) assert len(self.table) == len(self.im_size) scaling_coef = compute_scaling_coefs( From 0ae893fe97ac2f3a3f8c2f5c76b28333544c6851 Mon Sep 17 00:00:00 2001 From: Zaccharie Ramzi Date: Thu, 16 Jul 2020 15:42:12 +0200 Subject: [PATCH 2/2] corrected table type change cos list --- tfkbnufft/kbnufft.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfkbnufft/kbnufft.py b/tfkbnufft/kbnufft.py index 2f0d9c1..9fb43e3 100644 --- a/tfkbnufft/kbnufft.py +++ b/tfkbnufft/kbnufft.py @@ -82,7 +82,7 @@ def __init__(self, im_size, grid_size=None, numpoints=6, n_shift=None, order=self.order, alpha=self.alpha ) - self.table = table.astype(table_dtype) + self.table = [t.astype(table_dtype) for t in table] assert len(self.table) == len(self.im_size) scaling_coef = compute_scaling_coefs(