Skip to content

Commit

Permalink
make additional border of patches conditional on use of offset and ov…
Browse files Browse the repository at this point in the history
…erlap
  • Loading branch information
JoeySpronck committed Oct 17, 2024
1 parent 002d059 commit b35b2ee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions wholeslidedata/buffer/patchcommander.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ def get_patch_messages(self):
y_max = self._y_dims + self._patch_configuration.offset[1] + self._patch_configuration.patch_shape[1] // 2 if self._patch_configuration.center else self._y_dims + self._patch_configuration.offset[1]

# Add one extra patch on all sides to avoid missing out on patches in more complex patch configurations (e.g. with overlap and offset)
x_min_extra = x_min - step_row
y_min_extra = y_min - step_col
x_max_extra = x_max + step_row
y_max_extra = y_max + step_col
if any(self._patch_configuration.offset) or any(self._patch_configuration.overlap):
x_min_extra = x_min - step_row
y_min_extra = y_min - step_col
x_max_extra = x_max + step_row
y_max_extra = y_max + step_col

for row in range(y_min_extra, y_max_extra, step_row):
for col in range(x_min_extra, x_max_extra, step_col):
Expand Down

0 comments on commit b35b2ee

Please sign in to comment.