Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2d1f804

Browse filesBrowse files
authored
Merge branch 'main' into theme_detection_update
2 parents a9630f7 + cf1b129 commit 2d1f804
Copy full SHA for 2d1f804

File tree

2 files changed

+43
-1
lines changed
Filter options

2 files changed

+43
-1
lines changed

‎examples/features_hist.py

Copy file name to clipboard
+42Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""
2+
Hisogram of features
3+
====================
4+
"""
5+
6+
import napari
7+
import numpy as np
8+
import numpy.typing as npt
9+
from skimage.measure import regionprops_table
10+
11+
# make a test label image
12+
label_image: npt.NDArray[np.uint16] = np.zeros((100, 100), dtype=np.uint16)
13+
14+
label_image[10:20, 10:20] = 1
15+
label_image[50:70, 50:70] = 2
16+
17+
feature_table_1 = regionprops_table(
18+
label_image, properties=("label", "area", "perimeter")
19+
)
20+
feature_table_1["index"] = feature_table_1["label"]
21+
22+
# make the points data
23+
n_points = 100
24+
points_data = 100 * np.random.random((100, 2))
25+
points_features = {
26+
"feature_0": np.random.random((n_points,)),
27+
"feature_1": np.random.random((n_points,)),
28+
"feature_2": np.random.random((n_points,)),
29+
}
30+
31+
# create the viewer
32+
viewer = napari.Viewer()
33+
viewer.add_labels(label_image, features=feature_table_1)
34+
viewer.add_points(points_data, features=points_features)
35+
36+
# make the widget
37+
viewer.window.add_plugin_dock_widget(
38+
plugin_name="napari-matplotlib", widget_name="FeaturesHistogram"
39+
)
40+
41+
if __name__ == "__main__":
42+
napari.run()

‎setup.cfg

Copy file name to clipboardExpand all lines: setup.cfg
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ napari.manifest =
4747

4848
[options.extras_require]
4949
docs =
50-
napari[all]==0.4.17
50+
napari[all]==0.4.19rc3
5151
numpydoc
5252
pydantic<2
5353
pydata-sphinx-theme

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.