NKI-AI / dlup

Dlup are the Deep Learning Utilities for Pathology developed at the Netherlands Cancer Institute
Apache License 2.0
25 stars 7 forks source link

Extend `ConvertAnnotationsToMask` features #218

Closed BPdeRooij closed 5 months ago

BPdeRooij commented 7 months ago

Is your feature request related to a problem? Please describe. ConvertAnnotationsToMask transforms annotations in one way using the convert_annotations function. I want to convert annotations to a mask with some custom behavior for point annotations among other things (https://github.com/NKI-AI/ahcore/issues/6). There is no way of overwriting this conversion behavior.   Describe the solution you'd like I would like to suggest three features:

  1. Add a callable function parameter to ConvertAnnotationsToMask to make it more configurable (e.g. convert_fn=convert_annotations). The output of these values should be the same as the current convert_annotations function.
  2. Add an ignore_name to skip annotations with a certain label.
  3. Add buffer_point_radius to convert_annotations. This would transform Point annotations into Polygons with a certain radius (if given).

Describe alternatives you've considered Creating another conversion class ConvertPointAnnotationsToMask with the desired behavior.   Additional context An initial start to implement these features can be found on this branch.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days