From 757675a35233d45c49eacc4052502f014521355f Mon Sep 17 00:00:00 2001 From: HaleySchuhl Date: Tue, 4 Jun 2024 13:22:50 -0500 Subject: [PATCH] aadd view, print_coords, import_list, and import_file --- docs/Points.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/docs/Points.md b/docs/Points.md index 93e1052..5233315 100644 --- a/docs/Points.md +++ b/docs/Points.md @@ -43,6 +43,12 @@ marker = an.Points(img=img, figsize=(12,6)) roi = pcv.roi.custom(img=img, vertices=marker.coords['default']) ``` +**plantcv.annotate.Points.view**(*label="default", color="r", view_all=False*) + +- **Parameters:** + - label - The current label (default = "default") + - color - The current color for annotations (default = "r") + - view_all - View all classes or a single class, by (default =`False`) **plantcv.annotate.Points.save_coords**() @@ -123,4 +129,45 @@ pcv.outputs.observations 'label': 'none'}}} ``` +**plantcv.annotate.Points.print_coords**(*filename*) + +- **Context:** + - Once point annotations are collected, save the list of coordinates out to a text file called `filename`. + Can be utilized by non-PlantCV analysis or read back in with `.import_file` annotation method. + +**plantcv.annotate.Points.import_list**(*coords, label="default"*) + +- **Context:** + - Import a list of coordinates into an instance of the `Points` class. + +- **Example use:** + - Below + +```python +import plantcv.plantcv as pcv +import plantcv.annotate as pcvan + +centers = pcvan.get_centroids() +counter = pcvan.Points(img=img, figsize=(12,6)) +counter.import_list(coords=centers, label="detected") + +``` + +**plantcv.annotate.Points.import_file**(*filename*) + +- **Context:** + - Import a list of coordinates into an instance of the `Points` class. + +- **Example use:** + - Below + +```python +import plantcv.plantcv as pcv +import plantcv.annotate as pcvan + +drawer = pcvan.Points(img=img, figsize=(12,6)) +drawer.import_file(filename="replicate101_saved_coords.txt") ) + +``` + **Source Code:** [Here](https://github.com/danforthcenter/plantcv-annotate/blob/main/plantcv/annoate/classes.py)