-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 30-napari-draw-mask
- Loading branch information
Showing
28 changed files
with
1,206 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[run] | ||
omit = | ||
config.py | ||
config-3.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
## Changelog | ||
|
||
All notable changes to this project will be documented below. | ||
|
||
#### annotate.get_centroids | ||
|
||
* v0.1dev: coords_list = **annotate.get_centroids**(*bin_img*) | ||
|
||
#### annotate.napari_classes | ||
|
||
* v0.1dev: class_list = **annotate.napari_classes**(*viewer*) | ||
|
||
#### annotate.napari_join_labels | ||
|
||
* v0.1dev: relabeled_mask, mask_dict = **annotate.napari_join_labels**(*img, viewer*) | ||
|
||
#### annotate.napari_label_classes | ||
|
||
* v0.1dev: viewer = **annotate.napari_label_classes**(*img, classes, size=10, shape='square', importdata=False, show=True*) | ||
|
||
#### annotate.napari_open | ||
|
||
* v0.1dev: viewer = **annotate.napari_open**(*img, mode = 'native', show=True*) | ||
|
||
#### annotate.napari_read_coor | ||
|
||
* v0.1dev: data = **annotate.napari_read_coor**(*coor, dataformat='yx'*) | ||
|
||
#### annotate.napari_save_coor | ||
|
||
* v0.1dev: datadict = **annotate.napari_save_coor**(*viewer, filepath*) | ||
|
||
#### annotate.Points | ||
|
||
* v0.1dev: viewer = **annotate.Points**(*img, figsize=(12,6), label="dafault"*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
## Get Centroids | ||
|
||
Extract the centroid coordinate (column,row) from regions in a binary image. | ||
|
||
**plantcv.annotate.get_centroids**(*bin_img*) | ||
|
||
**returns** list containing coordinates of centroids | ||
|
||
- **Parameters:** | ||
- bin_img - Binary image containing the connected regions to consider | ||
- **Context:** | ||
- Given an arbitrary mask of the objects of interest, `get_centroids` | ||
returns a list of coordinates that can the be imported into the annotation class [Points](Points.md). | ||
|
||
- **Example use:** | ||
- Below | ||
|
||
**Binary image** | ||
|
||
![count_img](img/documentation_images/get_centroids/discs_mask.png) | ||
|
||
```python | ||
|
||
from plantcv import plantcv as pcv | ||
|
||
# Set global debug behavior to None (default), "print" (to file), | ||
# or "plot" | ||
pcv.params.debug = "plot" | ||
|
||
# Apply get centroids to the binary image | ||
coords = pcv.annotate.get_centroids(bin_img=binary_img) | ||
print(coords) | ||
# [[1902, 600], [1839, 1363], [1837, 383], [1669, 1977], [1631, 1889], [1590, 1372], [1550, 1525], | ||
# [1538, 1633], [1522, 1131], [1494, 2396], [1482, 1917], [1446, 1808], [1425, 726], [1418, 2392], | ||
# [1389, 198], [1358, 1712], [1288, 522], [1289, 406], [1279, 368], [1262, 1376], [1244, 1795], | ||
# [1224, 1327], [1201, 624], [1181, 725], [1062, 85], [999, 840], [885, 399], [740, 324], [728, 224], | ||
# [697, 860], [660, 650], [638, 2390], [622, 1565], [577, 497], [572, 2179], [550, 2230], [547, 1826], | ||
# [537, 892], [538, 481], [524, 2144], [521, 2336], [497, 201], [385, 1141], [342, 683], [342, 102], | ||
# [332, 1700], [295, 646], [271, 60], [269, 1626], [210, 1694], [189, 878], [178, 1570], [171, 2307], | ||
# [61, 286], [28, 2342]] | ||
|
||
``` | ||
|
||
**Source Code:** [Here](https://github.com/danforthcenter/plantcv-annotate/blob/main/plantcv/annotate/get_centroids.py) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.