Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display and Extract tiles issues on binary .tiff #512

Open
neoMerz opened this issue Jan 30, 2023 · 0 comments
Open

Display and Extract tiles issues on binary .tiff #512

neoMerz opened this issue Jan 30, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@neoMerz
Copy link

neoMerz commented Jan 30, 2023

Describe the bug
I have binary mask .tiff files.

  1. Attribute .show() shows a black image, but taking the .resampled_array() * 255 shows the correct mask.
  2. Tile extraction on these .tiff binary mask doesnt work (but works with OpenSlide .read_region())

To Reproduce
Steps to reproduce the Issue 1:

  1. from histolab.slide import Slide
  2. annotation_mask = Slide(annotation_path, processed_annotation_path)
  3. annotation_mask.show() # shows a black image
  4. (annotation_mask.resampled_array() * 255) shows the correct mask

Steps to reproduce the Issue 2:

  1. from histolab.slide import Slide
    from histolab.tiler import RandomTiler
  2. annotation_mask = Slide(annotation_path, processed_annotation_path)
  3. random_tiles_extractor = RandomTiler(tile_size=(256, 256),
    n_tiles=30,
    level=3,
    seed=42,
    check_tissue=True,
    tissue_percent=80.0,
    prefix=prefix + '_',
    suffix=".png"
    )
  4. random_tiles_extractor.extract(annotation_mask )
  5. ValueError: n should be smaller than the number of regions [0], got 1

Expected behavior issue 2
import openslide as ops
reader = ops.OpenSlide(test_annotation_path)
patch = reader.read_region(location=(47800, 12901), level=3, size=(256, 256))
reader.close()

Screenshots
histolab_show_1
histolab_show_2
histolab_extract_1

ID-29_HE_active_tile_0_level3_47800-12901-49848-14949
ID_29_HE_active_tile_0_level3_47800_12901_49848_14949

Software (please complete the following information):

  • OS: Ubuntu
  • Python Version: 3.8
  • histolab version: 0.5.1

Additional context
Data can be downloaded here
images: WSI_part_02/ID-29_HE_active.ndpi
mask: TIFF-annotations/ID-29_HE_active.tiff

@neoMerz neoMerz added the bug Something isn't working label Jan 30, 2023
@nicolebussola nicolebussola added enhancement New feature or request and removed bug Something isn't working labels Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants