+
Skip to content

Display and Extract tiles issues on binary .tiff #512

@neoMerz

Description

@neoMerz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载