MicroMedIAn / PathAIA

Digital Pathology Analysis Tools
GNU General Public License v3.0
3 stars 3 forks source link

added getter function for json2pathaia slide filter #33

Closed schwobr closed 3 years ago

schwobr commented 3 years ago

I created a get_json2pathaia_filter function that takes a path to an annotation file and a label and returns a filter that only keeps patches within the zone annotated with this label. I tested it on a specific case and it works, but I am yet to add unit tests.

schwobr commented 3 years ago

To integrate it in the functional api I would use an encoding to allow specifying it as a string. When the filter name ends with "#", it means it expects other arguments to be added, some of which can be variables. For instance, if we use slide_filters=["json2pathaia#/path/to/annot/folder/{slidename}.json#K"], it means use the function get_json2pathaia_filter using the arguments annotfile="/path/to/annot/folder/{slidename}.json" (where slidename must be replaced using current slide name) and label="K". It might look overly complicated but I think it would allow this to integrate quite well with the existing API.