-
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 correct_mask_method
- Loading branch information
Showing
19 changed files
with
367 additions
and
49 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
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"*) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## Read point data into Napari Format | ||
|
||
Save Points Labeled in Napari to a File | ||
|
||
**plantcv.napari_read_coor**(*coor, dataformat = 'yx'*) | ||
|
||
**returns** dictionary of points labeled by class | ||
|
||
- **Parameters:** | ||
- coor - dictionary object of coordinates, or a path to json datafile with dictionary of point coordinates | ||
- dataformat - either 'yx' or 'xy', Napari takes data as y,x format. If data is 'xy' data is converted from x,y to y,x | ||
|
||
- **Context:** | ||
- Import previously labeled points, or points from other functions (e.g. [`pcvan.napari_read_coor`](napari_read_coor.md)) | ||
|
||
- **Example use:** | ||
- Below | ||
|
||
|
||
```python | ||
import plantcv.plantcv as pcv | ||
import plantcv.annotate as pcvan | ||
|
||
# read in data | ||
|
||
data = pcvan.napari_read_points(coor ='coor.json', dataformat = 'xy') | ||
|
||
``` | ||
|
||
**Source Code:** [Here](https://github.com/danforthcenter/plantcv-annotate/blob/main/plantcv/annotate/napari_read_coor.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## Save Napari Labels to File | ||
|
||
Save Points Labeled in Napari to a File | ||
|
||
**plantcv.annotate.napari_save_coor**(*viewer, filepath*) | ||
|
||
**returns** dictionary of points labeled by class | ||
|
||
- **Parameters:** | ||
- viewer - Napari Viewer Object | ||
- Filepath - File to save data. If the file exits an extension will be added. | ||
|
||
- **Context:** | ||
- Save points labeled in Napari to a file to checkpoint annotation progress or reuse. | ||
|
||
- **Example use:** | ||
- Save points labeled to a file | ||
|
||
|
||
```python | ||
import plantcv.plantcv as pcv | ||
import plantcv.annotate as pcvan | ||
|
||
# Create an instance of the Points class | ||
img, path, name = pcv.readimage("./grayimg.png") | ||
# Should open interactive napari viewer | ||
viewer = pcvan.napari_label_classes(img=img, classes=['background', 'wing','seed']) | ||
|
||
dictobj = pcvan.napari_save_coor(viewer, 'testdata.txt') | ||
|
||
``` | ||
|
||
![Screenshot](img/documentation_images/napari_label_classes/napari_label_classes.png) | ||
|
||
![Screenshot](img/documentation_images/napari_save_coor/napari_save.png) | ||
|
||
|
||
|
||
**Source Code:** [Here](https://github.com/danforthcenter/plantcv-annotate/blob/main/plantcv/annotate/napari_save_coor.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
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.