DigitalSlideArchive / HistomicsTK

A Python toolkit for pathology image analysis algorithms.
https://digitalslidearchive.github.io/HistomicsTK/
Apache License 2.0
394 stars 117 forks source link

How to render text annotation on frontend? #1071

Open abhisheklomsh opened 1 year ago

abhisheklomsh commented 1 year ago

I am working on cell counting model and using DSA+Histomics for it, Can i also include a text number in the middle of the region of interest for which the nuclei segmentation boundaries are generated?

Screenshot 2023-09-11 at 2 42 23 PM
lomshabhishek commented 1 year ago

I was able to create annotation using numpy which "draws" those characters instead of being able to pass "text" type annotation.

annotations.append({
                'type': 'polyline',
                'points': [[segment[0][0], segment[0][1], 0.0], [segment[1][0], segment[1][1], 0.0]],
                'closed': False,
                'fillColor': 'rgba(0,0,0,0)',
                'lineColor': color,
                'lineWidth': line_width
            })
manthey commented 1 year ago

There is an intent (not realized) of having an option to render the labels on each annotation element. One of the reasons it hasn't been implemented yet is that we have to decide what to do when there are massive numbers of elements, as that will slow rendering down critically. Adding a text annotation would be another approach.