Skip to content

Commit 3057e4a

Browse files
authored
Merge pull request #131 from DiamondLightSource/vomem
Vo Centering memory estimator fixes
2 parents 11b6d74 + 3275edd commit 3057e4a

File tree

12 files changed

+247
-25
lines changed

12 files changed

+247
-25
lines changed

docs/source/examples/Cor_largesino.ipynb

Lines changed: 201 additions & 0 deletions
Large diffs are not rendered by default.

docs/source/examples/DistortionCorr.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
],
8181
"metadata": {
8282
"kernelspec": {
83-
"display_name": "httomo",
83+
"display_name": "Python 3 (ipykernel)",
8484
"language": "python",
8585
"name": "python3"
8686
},
@@ -98,5 +98,5 @@
9898
}
9999
},
100100
"nbformat": 4,
101-
"nbformat_minor": 2
101+
"nbformat_minor": 4
102102
}

docs/source/examples/pipeline1_FBP.ipynb

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

docs/source/examples/pipeline2_iterative.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"#### This example shows how to use methods from the HTTomolibgpu library to do the following:\n",
1515
"\n",
1616
"* normalise the data \n",
17-
"* calculate the centre of rotation \n",
17+
"* calculate the centre of rotation using phase-cross correlation method\n",
1818
"* reconstruct using the iterative algorithm"
1919
]
2020
},
@@ -159,7 +159,7 @@
159159
],
160160
"metadata": {
161161
"kernelspec": {
162-
"display_name": "httomo",
162+
"display_name": "Python 3 (ipykernel)",
163163
"language": "python",
164164
"name": "python3"
165165
},
@@ -177,5 +177,5 @@
177177
}
178178
},
179179
"nbformat": 4,
180-
"nbformat_minor": 2
180+
"nbformat_minor": 4
181181
}

docs/source/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
examples/pipeline1_FBP
2020
examples/pipeline2_iterative
21-
examples/DistortionCorr
21+
examples/Cor_largesino
22+
examples/DistortionCorr
2223

2324
.. _reference_content:
2425

httomolibgpu/prep/stripe.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def __remove_all_stripe(
238238
sino = data[:, m, :]
239239
sino = _rs_dead(sino, snr, la_size, matindex)
240240
sino = _rs_sort2(sino, sm_size, matindex, dim)
241+
sino = cp.nan_to_num(sino)
241242
data[:, m, :] = sino
242243
return data
243244

httomolibgpu/recon/rotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def _calculate_chunks(
246246
shift_size # it needs only half (RFFT), but complex64, so it's the same
247247
)
248248
fft_plan_size = freq_domain_size
249-
size_per_shift = fft_plan_size + freq_domain_size + shift_size
249+
size_per_shift = 2 * (fft_plan_size + freq_domain_size + shift_size)
250250
nshift_max = available_memory // size_per_shift
251251
assert nshift_max > 0, "Not enough memory to process"
252252
num_chunks = int(np.ceil(nshifts / nshift_max))

tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ def ensure_clean_memory():
6565
cp.get_default_pinned_memory_pool().free_all_blocks()
6666

6767

68+
@pytest.fixture(scope="session")
69+
def sino3600_file(test_data_path):
70+
in_file = os.path.join(test_data_path, "3600proj_sino.npz")
71+
return np.load(in_file)
72+
73+
74+
@pytest.fixture
75+
def sino3600(sino3600_file):
76+
return cp.asarray(sino3600_file["sinogram"])
77+
78+
6879
@pytest.fixture
6980
def host_data(data_file):
7081
return np.copy(data_file["data"])

tests/test_data/3600proj_sino.npz

35.2 MB
Binary file not shown.
-14.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)