Skip to content

Add feature histogram widget #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added test
  • Loading branch information
haesleinhuepf committed Nov 5, 2022
commit 210a35a29f0da00337db0748dac957d6fce69146
22 changes: 22 additions & 0 deletions src/napari_matplotlib/tests/test_feature_histogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from napari_matplotlib import FeatureHistogramWidget
import numpy as np

def test_example_q_widget(make_napari_viewer):
# Smoke test adding a histogram widget
viewer = make_napari_viewer()

image = np.asarray([[0, 1], [2, 1]])
labels = image.astype(int)


viewer.add_image(image)

labels_layer = viewer.add_labels(labels)

labels_layer.features = {
'labels': [1, 2],
'area': [2, 1],
'aspect_ratio': [2, 1]
}

FeatureHistogramWidget(viewer)