Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pixel_overlap not work in GridTiler #370

@nipeone

Description

@nipeone

Describe the bug
1.i have set "pixel_overlap" to 64 in GridTiler,but it seemingly does not work。adjacent tiles have no overlapping area.
2.if i set check_tissue to True, only a few tiles can be generated.

To Reproduce
Steps to reproduce the behavior:

class CustomTissueMask(TissueMask):
    def __init__(self, scale_factor=32):
        self.scale_factor = scale_factor

    def _mask(self, slide):
        img = slide.scaled_image(self.scale_factor)
        filters = FiltersComposition(Slide).tissue_mask_filters
        mask = filters(img)
        return mask
grid_tiles_extractor = GridTiler(
    tile_size=(512, 512),
    level=0,
    check_tissue=False, # default
    pixel_overlap=64, # default
    prefix="grid/", # save tiles in the "grid" subdirectory of slide's processed_path
    suffix=".png" # default
    )
thumb = grid_tiles_extractor.locate_tiles(
    slide=slide,
    extraction_mask=CustomTissueMask(),
    scale_factor=32,
    alpha=200,
    outline="#046C4C",
)
thumb.save("./tmp/1900991B_grid_thumb.png")

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Software (please complete the following information):

  • OS: ubuntu
  • Python Version: 3.8
  • histolab version: 0.4.1

Additional context
if i change source code in tiler.py like below, i can get desired result.
image

desired result:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions