Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions src/napari_clusters_plotter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ._sample_data import (
bbbc_1_dataset,
cells3d_curvatures,
granule_compression_vectors,
skan_skeleton,
tgmm_mini_dataset,
)
Expand All @@ -23,4 +24,5 @@
"tgmm_mini_dataset",
"cells3d_curvatures",
"skan_skeleton",
"granule_compression_vectors",
]
34 changes: 34 additions & 0 deletions src/napari_clusters_plotter/_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,37 @@ def cells3d_curvatures() -> List["LayerData"]: # noqa: F821
)

return [layer_data_nuclei, layer_data_surface]


def granule_compression_vectors() -> List["LayerData"]: # noqa: F821
import numpy as np
import pandas as pd
from napari.utils import notifications

path = Path(__file__).parent / "sample_data" / "compression_vectors"

features = pd.read_csv(path / "granular_compression_test.csv")
features["iterations"] = features["iterations"].astype("category")
features["returnStatus"] = features["returnStatus"].astype("category")
features["Label"] = features["Label"].astype("category")
features.drop(columns=["PSCC"], inplace=True)

points_4d = features[["frame", "Zpos", "Ypos", "Xpos"]].to_numpy()
vectors_4d = features[["frame", "Zdisp", "Ydisp", "Xdisp"]].to_numpy()
vectors_4d = np.stack([points_4d, vectors_4d], axis=1)
vectors_4d[:, 1, 0] = 0

layerdata_vectors = (
vectors_4d,
{
"name": "granule_compression_vectors",
"features": features,
},
"vectors",
)

notifications.show_info(
"Granule compression vectors dataset obtained from https://zenodo.org/records/17668709"
)

return [layerdata_vectors]
8 changes: 7 additions & 1 deletion src/napari_clusters_plotter/_tests/test_sample_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@

@pytest.mark.parametrize(
"sample_data_function",
["bbbc1", "cells3d_curvatures", "tgmm_mini", "skan_skeleton"],
[
"bbbc1",
"cells3d_curvatures",
"tgmm_mini",
"skan_skeleton",
"granule_compression_vectors",
],
)
def test_bbbc_1_sample_data(make_napari_viewer, sample_data_function):

Expand Down
6 changes: 6 additions & 0 deletions src/napari_clusters_plotter/napari.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ contributions:
- id: napari-clusters-plotter.skan_skeleton
python_name: napari_clusters_plotter:skan_skeleton
title: Load skan skeleton dataset
- id: napari-clusters-plotter.granule_compression_vectors
python_name: napari_clusters_plotter:granule_compression_vectors
title: Load granule compression vectors

menus:
napari/layers/visualize:
Expand Down Expand Up @@ -61,3 +64,6 @@ contributions:
- command: napari-clusters-plotter.skan_skeleton
key: skan_skeleton
display_name: Skan skeleton dataset (labels and paths)
- command: napari-clusters-plotter.granule_compression_vectors
key: granule_compression_vectors
display_name: Granule compression vectors dataset
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
It can be cited under the DOI: https://doi.org/10.5281/zenodo.17668708

Citation:
@dataset{ando_2025_17668709,
author = {Andò, Edward},
title = {M2EA05 analysis results from spam},
month = nov,
year = 2025,
publisher = {Zenodo},
doi = {10.5281/zenodo.17668709},
url = {https://doi.org/10.5281/zenodo.17668709},
}
Loading