biigle / ptp

Ⓜ️ BIIGLE module for point to polygon conversion
GNU General Public License v3.0
0 stars 0 forks source link

PTP Module #1

Open mzur opened 1 week ago

mzur commented 1 week ago

This module should implement automatic point to polygon conversion using SAM in BIIGLE. It can work similar to biigle/maia:

A user starts a conversion job. The job runs on a GPU and processes all images with point annotations. Optionally, the user can limit this job to process only a subset of labels. Also, users can choose to ignore annotations that were already converted or set min/max size thresholds to ignore too small/large polygons. When the conversion job is finished, users can see a MAIA/Largo grid view of all converted annotations. The gird shows both the original point as well as the converted polygon outline. In the grid, users can select incorrectly converted annotations and delete them. Once finished, users can click "finish" and all converted annotation are added as actual annotations to the volume.

This can be implemented in several stages:

  1. Use the point to polygon script to create and upload polygon annotations. Implement the Largo filter by shape feature so Largo can be used to review the uploaded annotations.

  2. Similar to the laser point detection, users can just click on a new sidebar button in the volume overview to open a tab. There, they can press a button to start the conversion job (without any configuration options). Once the job is done, the user is notified. Then the user can use Largo (with the filter feature) to review the converted annotations.

  3. Next, the module can be made more similar to MAIA. In this iteration, database models such as ptp_jobs or ptp_annotations are created. This allows a similar UI that MAIA where users are redirected to a new page to create and configure a new "PTP job". Users can optionally choose to process only annotations with a certain label or annotations that were not previously processed. Also they can set the min/max size threshold. This iteration also implements the new interface to review converted annotations. These are initially not created as actual annotations but as temporary "ptp_annotations". These are linked to their original point annotations so both can be shown in the Largo-like grid. Once the review process is finished, the ptp_annotations are converted to actual annotations. In this process the ptp_annotations are also linked to the created annotation, so we can later check which annotations already have been converted and which are a result of a previous conversion.

  4. Finally, all this can be implemented for videos, too. This needs a preprocessing where video frames are extracted. Also, multi-frame annotations need special handling. Here, video frames can be extracted at fixed intervals of the multi-frame annotation (with interpolated point position). Then these frames and interpolated positions are used to convert the annotation to a polygon.

mzur commented 1 week ago

This module can be developed in the dev-modules-ptp branch of biigle/core.