Skip to content

Commit

Permalink
fix: Fixed bugs originating from feature f3a3922
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol-G committed Jan 10, 2024
1 parent 66c6615 commit f0b31aa
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion patchly/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.0.14"
__version__ = "0.0.15"

from patchly.sampler import GridSampler, SamplingMode
from patchly.aggregator import Aggregator
Expand Down
2 changes: 1 addition & 1 deletion patchly/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def compute_patches(self) -> Tuple[_AdaptiveGridSampler, defaultdict, defaultdic
:return: Tuple[_AdaptiveGridSampler, defaultdict, defaultdict] - Returns a tuple containing the chunk sampler, a dictionary mapping chunk IDs to patch data, and a dictionary mapping patch bounding boxes to chunk IDs.
"""
patch_sampler = self.sampler
chunk_sampler = _AdaptiveGridSampler(image_size_s=self.image_size_s, patch_size_s=self.chunk_size_s, step_size_s=self.chunk_size_s)
chunk_sampler = _AdaptiveGridSampler(image_h=None, image_size_s=self.image_size_s, patch_size_s=self.chunk_size_s, step_size_s=self.chunk_size_s)
chunk_patch_dict = defaultdict(dict)
patch_chunk_dict = defaultdict(dict)

Expand Down
2 changes: 1 addition & 1 deletion patchly/tests/test_adaptive/test_adaptive_grid_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def _test_sampler(self, image, spatial_size, patch_size, step_size=None, spatial

# Test without image
result = np.zeros_like(image)
sampler = GridSampler(spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_ADAPTIVE)
sampler = GridSampler(image=None, spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_ADAPTIVE)

for patch_bbox in sampler:
result[slicer(result, patch_bbox)] = 1
Expand Down
2 changes: 1 addition & 1 deletion patchly/tests/test_crop/test_crop_grid_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _test_sampler(self, image, result_size, spatial_size, patch_size, step_size=

# Test without image
result = np.zeros(result_size)
sampler = GridSampler(spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_CROP)
sampler = GridSampler(image=None, spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_CROP)

for patch_bbox in sampler:
result[slicer(result, patch_bbox)] = 1
Expand Down
2 changes: 1 addition & 1 deletion patchly/tests/test_edge/test_edge_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _test_sampler(self, image, spatial_size, patch_size, step_size=None, spatial

# Test without image
result = np.zeros_like(image)
sampler = GridSampler(spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_EDGE)
sampler = GridSampler(image=None, spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_EDGE)

for patch_bbox in sampler:
result[slicer(result, patch_bbox)] = 1
Expand Down
2 changes: 1 addition & 1 deletion patchly/tests/test_squeeze/test_squeeze_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _test_sampler(self, image, spatial_size, patch_size, step_size=None, spatial

# Test without image
result = np.zeros_like(image)
sampler = GridSampler(spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_SQUEEZE)
sampler = GridSampler(image=None, spatial_size=spatial_size, patch_size=patch_size, step_size=step_size, spatial_first=spatial_first, mode=SamplingMode.SAMPLE_SQUEEZE)

for patch_bbox in sampler:
result[slicer(result, patch_bbox)] = 1
Expand Down

0 comments on commit f0b31aa

Please sign in to comment.