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

Skip to content

Allow custom filters for TissueMask #375

@kishoresurendra

Description

@kishoresurendra

Describe the bug

The RemoveSmallObjects() class is removing essential small tissue islands in our WSI due to the pre-set filters.

In the current implementation, every operation under FilterComposition, i.e, BinaryDilation(), RemoveSmallHoles() and RemoveSmallObjects() have pre-determined filter sizes.

  1. For example, RemoveSmallHoles() has an area_threshold of 3000, but we may want a different threshold of, say 2000.
  2. Another example: RemoveSmallObjects() has a default min_size of 3000, but we may want to change it to 1500.

To Reproduce

Steps to reproduce the behavior:

  1. from histolab.masks import TissueMask
  2. all_tissue_mask = TissueMask()
  3. slidetox = Slide(slidepath, outputpath)
  4. slidetox.locate_mask(all_tissue_mask).show()

Expected behavior

To be able to add the custom filter(s) in the constructor of the TissueMask. In addition to the default constructor TissueMask(), we would like the following option as well:

TissueMask( 
    imf.RgbToGrayscale(),
    imf.OtsuThreshold(),
    mof.BinaryDilation(),
    mof.RemoveSmallObjects(min_size=2000),
    mof.RemoveSmallHoles(area_threshold=1500)
 )

or any other similar approach.

We are keen to provide the pool request for this issue.

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