Skip to content

Commit

Permalink
Always overlap image slices (omit zero-overlap case)
Browse files Browse the repository at this point in the history
  • Loading branch information
msorelli committed May 15, 2024
1 parent d80f5eb commit b84e604
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions foa3d/slicing.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def compute_slice_shape(img_shape, item_size, px_size=None, max_size=1e6, ovlp=0
return slice_shape


def compute_overlap_range(smooth_sigma, frangi_sigma, px_rsz_ratio, truncate=4):
def compute_overlap_range(smooth_sigma, frangi_sigma, px_rsz_ratio, truncate=2):
"""
Compute lateral slice extension range
for coping with smoothing-related boundary artifacts.
Expand Down Expand Up @@ -211,9 +211,7 @@ def compute_overlap_range(smooth_sigma, frangi_sigma, px_rsz_ratio, truncate=4):
if smooth_sigma is not None:
frangi_sigma = np.concatenate((smooth_sigma, frangi_sigma))

max_sigma = np.max(frangi_sigma)

ovlp = int(np.ceil(2 * truncate * max_sigma) // 2) if smooth_sigma is not None else 0
ovlp = int(np.ceil(2 * truncate * np.max(frangi_sigma)) // 2)

if px_rsz_ratio is not None:
rsz_ovlp = np.multiply(ovlp * np.ones((3,)), px_rsz_ratio).astype(int)
Expand Down

0 comments on commit b84e604

Please sign in to comment.