Skip to content

Commit

Permalink
Fixed test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewHerzing committed Mar 14, 2024
1 parent 1af8f0d commit d06020d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 0 additions & 8 deletions tomotools/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
3 changes: 2 additions & 1 deletion tomotools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down

0 comments on commit d06020d

Please sign in to comment.