Skip to content

Commit 61c1760

Browse files
authored
Merge pull request #464 from jo-mueller/add-vectors-sample-data
Add vectors dataset
2 parents c325edc + 9e192f0 commit 61c1760

File tree

6 files changed

+47247
-1
lines changed

6 files changed

+47247
-1
lines changed

src/napari_clusters_plotter/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from ._sample_data import (
1212
bbbc_1_dataset,
1313
cells3d_curvatures,
14+
granule_compression_vectors,
1415
skan_skeleton,
1516
tgmm_mini_dataset,
1617
)
@@ -23,4 +24,5 @@
2324
"tgmm_mini_dataset",
2425
"cells3d_curvatures",
2526
"skan_skeleton",
27+
"granule_compression_vectors",
2628
]

src/napari_clusters_plotter/_sample_data.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,37 @@ def cells3d_curvatures() -> List["LayerData"]: # noqa: F821
204204
)
205205

206206
return [layer_data_nuclei, layer_data_surface]
207+
208+
209+
def granule_compression_vectors() -> List["LayerData"]: # noqa: F821
210+
import numpy as np
211+
import pandas as pd
212+
from napari.utils import notifications
213+
214+
path = Path(__file__).parent / "sample_data" / "compression_vectors"
215+
216+
features = pd.read_csv(path / "granular_compression_test.csv")
217+
features["iterations"] = features["iterations"].astype("category")
218+
features["returnStatus"] = features["returnStatus"].astype("category")
219+
features["Label"] = features["Label"].astype("category")
220+
features.drop(columns=["PSCC"], inplace=True)
221+
222+
points_4d = features[["frame", "Zpos", "Ypos", "Xpos"]].to_numpy()
223+
vectors_4d = features[["frame", "Zdisp", "Ydisp", "Xdisp"]].to_numpy()
224+
vectors_4d = np.stack([points_4d, vectors_4d], axis=1)
225+
vectors_4d[:, 1, 0] = 0
226+
227+
layerdata_vectors = (
228+
vectors_4d,
229+
{
230+
"name": "granule_compression_vectors",
231+
"features": features,
232+
},
233+
"vectors",
234+
)
235+
236+
notifications.show_info(
237+
"Granule compression vectors dataset obtained from https://zenodo.org/records/17668709"
238+
)
239+
240+
return [layerdata_vectors]

src/napari_clusters_plotter/_tests/test_sample_data.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33

44
@pytest.mark.parametrize(
55
"sample_data_function",
6-
["bbbc1", "cells3d_curvatures", "tgmm_mini", "skan_skeleton"],
6+
[
7+
"bbbc1",
8+
"cells3d_curvatures",
9+
"tgmm_mini",
10+
"skan_skeleton",
11+
"granule_compression_vectors",
12+
],
713
)
814
def test_bbbc_1_sample_data(make_napari_viewer, sample_data_function):
915

src/napari_clusters_plotter/napari.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ contributions:
2626
- id: napari-clusters-plotter.skan_skeleton
2727
python_name: napari_clusters_plotter:skan_skeleton
2828
title: Load skan skeleton dataset
29+
- id: napari-clusters-plotter.granule_compression_vectors
30+
python_name: napari_clusters_plotter:granule_compression_vectors
31+
title: Load granule compression vectors
2932

3033
menus:
3134
napari/layers/visualize:
@@ -61,3 +64,6 @@ contributions:
6164
- command: napari-clusters-plotter.skan_skeleton
6265
key: skan_skeleton
6366
display_name: Skan skeleton dataset (labels and paths)
67+
- command: napari-clusters-plotter.granule_compression_vectors
68+
key: granule_compression_vectors
69+
display_name: Granule compression vectors dataset
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
The data in this folder has been made available under the Creative Commons Attribution 4.0 International (CC BY 4.0) license on Zenodo: https://zenodo.org/records/17668709
2+
It can be cited under the DOI: https://doi.org/10.5281/zenodo.17668708
3+
4+
Citation:
5+
@dataset{ando_2025_17668709,
6+
author = {Andò, Edward},
7+
title = {M2EA05 analysis results from spam},
8+
month = nov,
9+
year = 2025,
10+
publisher = {Zenodo},
11+
doi = {10.5281/zenodo.17668709},
12+
url = {https://doi.org/10.5281/zenodo.17668709},
13+
}

0 commit comments

Comments
 (0)