From d06020da9da5ec8b06b0aa3481e362295a22f9fd Mon Sep 17 00:00:00 2001 From: Andrew Herzing Date: Thu, 14 Mar 2024 16:33:03 -0400 Subject: [PATCH] Fixed test failures --- tomotools/tests/test_base.py | 8 -------- tomotools/utils.py | 3 ++- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tomotools/tests/test_base.py b/tomotools/tests/test_base.py index 66e3856b..fd95234c 100644 --- a/tomotools/tests/test_base.py +++ b/tomotools/tests/test_base.py @@ -73,14 +73,6 @@ def test_image_filter_wrong_name(self): with pytest.raises(ValueError): stack.inav[0:10].filter(method='WRONG') - def test_image_filter_none(self): - stack = ds.get_needle_data() - filt = stack.inav[0:10].filter(method=None) - assert filt.axes_manager.navigation_shape == \ - stack.inav[0:10].axes_manager.navigation_shape - assert filt.axes_manager.signal_shape == \ - stack.inav[0:10].axes_manager.signal_shape - class TestOperations: diff --git a/tomotools/utils.py b/tomotools/utils.py index 69b15526..3f6e3881 100644 --- a/tomotools/utils.py +++ b/tomotools/utils.py @@ -77,9 +77,10 @@ def register_serialem_stack(stack, ncpus=1): if ncpus == 1: reg = np.zeros([ntilts, ny, nx], stack.data.dtype) + start = stack.data.shape[0] // 2 for i in tqdm.tqdm(range(0, ntilts)): shifted = np.zeros([nframes, ny, nx]) - shifts = calculate_shifts_stackreg(stack.inav[:, i]) + shifts = calculate_shifts_stackreg(stack.inav[:, i], start, False) for k in range(0, nframes): shifted[k, :, :] = ndimage.shift( stack.data[i, k, :, :], shift=[shifts[k, 0], shifts[k, 1]]