Skip to content

Commit

Permalink
Added shift_limit kwarg to MaxImage tilt_align
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewHerzing committed Jul 15, 2024
1 parent c0b0205 commit 3b2c2f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tomotools/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def fit_line(x, m, b):
return final


def tilt_maximage(stack, limit=10, delta=0.1, plot_results=False, also_shift=False):
def tilt_maximage(stack, limit=10, delta=0.1, plot_results=False, also_shift=False, shift_limit=20):
"""
Perform automated determination of the tilt axis of a TomoStack.
Expand Down Expand Up @@ -743,7 +743,7 @@ def tilt_maximage(stack, limit=10, delta=0.1, plot_results=False, also_shift=Fal

if also_shift:
idx = ali.data.shape[2] // 2
shifts = np.arange(-20, 20, 1)
shifts = np.arange(-shift_limit, shift_limit, 1)
nshifts = shifts.shape[0]
shifted = ali.isig[0:nshifts, :].deepcopy()
for i in range(0, nshifts):
Expand Down
4 changes: 3 additions & 1 deletion tomotools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ def tilt_align(self, method, **kwargs):
- delta (float): Angular increment in degrees for MaxImage calculation
- plot_results (bool): if True, plot results of Hough line analysis
- also_shift (bool): if True, also calculate global shift of tilt axis
- shift_limit (int): Search range for global shift of tilt axis
Returns
----------
Expand Down Expand Up @@ -660,7 +661,8 @@ def tilt_align(self, method, **kwargs):
delta = kwargs.get('delta', 0.3)
plot_results = kwargs.get('plot_results', False)
also_shift = kwargs.get('also_shift', False)
out = align.tilt_maximage(self, limit, delta, plot_results, also_shift)
shift_limit = kwargs.get('shift_limit', 20)
out = align.tilt_maximage(self, limit, delta, plot_results, also_shift, shift_limit)
else:
raise ValueError(
"Invalid alignment method: %s."
Expand Down

0 comments on commit 3b2c2f3

Please sign in to comment.