Skip to content

Commit

Permalink
Fix compute_error
Browse files Browse the repository at this point in the history
Signed-off-by: ashmeigh <[email protected]>
  • Loading branch information
ashmeigh committed Jul 15, 2024
1 parent 4e3a225 commit 6e9c510
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mantidimaging/core/rotation/polyfit_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def find_center(images: ImageStack, progress: Progress) -> tuple[ScalarCoR, Degr
# corresponding to (search_range, square sum). This is awkward to navigate
# we transpose store to make the array hold (square sum, search range)
# so that each store[row] accesses the information for the row's square sum across all search ranges
_find_shift(images, search_range, min_correlation_error, shift)
_find_shift(images, search_range, min_correlation_error.array, shift.array)

par = np.polyfit(slices, shift, 1)
par = np.polyfit(slices, shift.array, deg=1)
m = par[0]
q = par[1]
LOG.debug(f"m={m}, q={q}")
Expand Down Expand Up @@ -97,4 +97,5 @@ def _find_shift(images: ImageStack, search_range: range, min_correlation_error:
def get_search_range(width: int) -> range:
tmin = -width // 2
tmax = width - width // 2
return range(tmin, tmax + 1)
search_range = range(tmin, tmax + 1)
return search_range

0 comments on commit 6e9c510

Please sign in to comment.