Skip to content

Commit 5b1adfb

Browse files
committed
add compression vectors dataset
1 parent c325edc commit 5b1adfb

File tree

5 files changed

+47240
-0
lines changed

5 files changed

+47240
-0
lines changed

src/napari_clusters_plotter/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
cells3d_curvatures,
1414
skan_skeleton,
1515
tgmm_mini_dataset,
16+
granule_compression_vectors
1617
)
1718

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

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)