Skip to content

Commit

Permalink
docs pattern of markdown, link to related functions
Browse files Browse the repository at this point in the history
  • Loading branch information
HaleySchuhl committed Sep 13, 2024
1 parent 16cbb67 commit 0d1a29a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions docs/napari_points_mask.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
## Make Mask of Napari Points

This function is to generate a mask from napari point information.
This function is to generate a mask from Napari point information.
This application of this function could be to get information about image
at particular points (e.g. color or intensity information)

**plantcv.annotate.napari_points_mask*(*img, viewer)
**plantcv.annotate.napari_points_mask**(*img, viewer*)

**returns** dictionary of masks for each class
**returns** dictionary of masks, one for each class where the class label is the key to access

- **Parameters:**
- img - image data (compatible with gray, RGB, and hyperspectral data. If data is hyperspecral it should be the array e.g. hyperspectral.array_data)
- viewer = Napari Viewer with point classes labeled. The size of the points in the mask will be from the viewer parameters.
- viewer = Napari Viewer with point classes labeled (likely created with [`napari_label_classes`](napari_label_classes.md)). The size of the points in the mask will be determined from the viewer parameters.

- **Context:**
- This function can be used to generate a mask from Napari points in order to get information about point data.

- **Example use:**
- An application of this function might be collection of color data for the Naive Bayes module.
- An application of this function might be collection of color data for the [Naive Bayes module](https://plantcv.readthedocs.io/en/latest/tutorials/machine_learning_tutorial/).


```python
Expand All @@ -27,11 +27,15 @@ import napari
# Create an instance of the Points class
img, path, name = pcv.readimage("./wheat.png")

# Should open interactive napari viewer
viewer = pcvan.napari_label_classes(img,['background','healthy', 'rust', 'chlorosis'], size = 4)

maskdict = pcvan.napari_points_mask(img,viewer)

# Should open interactive napari viewer
pcv.plot_image(maskdict['background'])
pcv.plot_image(maskdict['healthy'])
pcv.plot_image(maskdict['rust'])
pcv.plot_image(maskdict['chlorosis'])

```

Expand Down

0 comments on commit 0d1a29a

Please sign in to comment.