Skip to content

Commit 2d1f804

Browse files
authored
Merge branch 'main' into theme_detection_update
2 parents a9630f7 + cf1b129 commit 2d1f804

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

Diff for: examples/features_hist.py

+42
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()

Diff for: setup.cfg

+1-1
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)