3d spatial visualization napari plugin
Project description
SEU-3D
3D visualization and analysis plugin for spatial transcriptomics embryo data based on napari.
Features
- 3D Visualization: Render spatial transcriptomics data in 3D with napari
- Tissue Filtering: Filter cells by tissue type, slice, germ layer, and XYZ range
- Gene Expression Analysis: Single, dual, and triple gene expression coloring
- Similarity Search: Find genes with similar expression patterns
- Moran's I Spatial Autocorrelation: Compute spatial gene enrichment
- Differential Expression: Identify tissue-specific marker genes
- Annotation: Cluster and label cell populations in 3D space
- Surface Reconstruction: Generate 3D surfaces for tissue regions (pyvista)
- Automatic Color Mapping: Deterministic tissue colors from a discrete colormap
Installation
pip install seu-3d
Then open napari and look for "Load spatial transcriptomics data" in the plugins menu.
Environment
All runtime dependencies are declared in pyproject.toml and installed automatically via pip:
pip install seu-3d # core functionality
pip install "seu-3d[surface]" # + pyvista, for 3D surface reconstruction
- Python >= 3.9
Data Format
The plugin reads .h5ad files. Two fields are chosen in the widget when
loading; everything else is auto-detected by fixed names:
| Field | Location | Required | Used for |
|---|---|---|---|
| (your choice) | adata.obsm key |
Yes | Spatial coordinates. 3D (x, y, z) preferred; if 2D (x, y), obs['z'] is used as z |
| (your choice) | adata.obs column |
Yes | Tissue / cell-type labels (coloring, filtering, diff-expression) |
z |
adata.obs |
Only when the coordinate key is 2D | Z position of each cell |
slices |
adata.obs |
Optional | Slice/sample filter (falls back to orig.ident) |
orig.ident |
adata.obs |
Optional | Fallback slice/sample filter |
germ_layer |
adata.obs |
Optional | Germ-layer filter |
x_flatten, y_flatten |
adata.obs |
Optional | "Show Flatten" 2D projection |
Missing optional fields simply disable the corresponding tab; the rest of the plugin keeps working.
Quick Start
import napari
viewer = napari.Viewer()
# Add spatial transcriptomics h5ad file via the napari plugin menu
Update Log
[2.0.0] — 2026-07-19
- Packaging:
- Declare runtime dependencies in
pyproject.toml(previouslypip install seu-3dpulled in nothing) - Restrict
packages.findtoseu_3d*so stray directories are never published - Remove the unused, broken
weiwei/source tree and the dead_umap_selectionmodule - Single-source the version from
seu_3d.__version__
- Declare runtime dependencies in
- Bug Fixes:
- Fix slice filtering never applying (
obs['slice']vsobs['slices']mismatch) - Fix differential-expression tissue selection reading only the first character of the tissue name
- Fix annotation coordinate matching failing on floats (cKDTree nearest-neighbour matching) and guard empty selections
- Fix saving annotations before annotating raised
AttributeError - Fix NaN colors for genes with constant expression
- Deterministic tissue colors (removed random shuffle)
- Re-filtering and XY preview now reuse their napari layers instead of piling up new ones
- Fix slice filtering never applying (
- Performance:
- Remove redundant full
AnnData.copy()in filtering and surface generation; filtering now applies one combined mask (a single copy per click instead of four) - Annotations accumulate in one persistent copy (no per-click dataset copy, and repeated annotations no longer reset earlier ones)
- Move h5ad reading, Moran's I, surface reconstruction and similar-gene search to worker threads (no more GUI freezing)
- Sparse-aware cosine similarity and column means (no full-matrix densification)
- Remove redundant full
- UX:
- Gene-expression views reuse a single
gene_expressionlayer instead of stacking a new view per click - Dock panel width is bounded and scrollable; AnnData info box is read-only and height-capped
- Documented the expected
obs/obsmfield names (see Data Format above)
- Gene-expression views reuse a single
- Code Quality: remove duplicate/unused imports, unify gene-expression coloring into shared helpers
- Housekeeping:
- Centralize 2D->3D coordinate stacking in
Embryo(written back toobsm) - Add MIT
LICENSEand unit tests forEmbryo
- Centralize 2D->3D coordinate stacking in
[1.1.17] — 2026-05-30
- First public release as a napari manifest plugin: h5ad loading, tissue/slice/germ-layer/XY filtering, 1-3 gene expression coloring, similar-gene search, Moran's I, differential expression, annotation, pyvista surface reconstruction
[1.1.6]
First release with napari manifest support
[1.0.4]
Fix error that plugin could not show
[1.0.3]
Fix napari.yaml
[1.0.2]
Forgot to upload napari.yaml
[1.0.1]
First release
Acknowledgements
License
Released under the MIT License, like the upstream sc3D project it is derived from.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file seu_3d-2.0.0.tar.gz.
File metadata
- Download URL: seu_3d-2.0.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a3620418003cda92e9388d718c9ad8038d8e30254f1e050f82a2e5104bbc819
|
|
| MD5 |
7389dffee1700978cad346ba3eda2023
|
|
| BLAKE2b-256 |
d5c90bf285f7199bbb6a7c23931ac6039bae43bc609d65cfa1a3d5bd66e1eedc
|
File details
Details for the file seu_3d-2.0.0-py3-none-any.whl.
File metadata
- Download URL: seu_3d-2.0.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bbe7bbbd5b80372f63c176f672fdf46a8f4db8bd7d35511c33b35f8e831a190
|
|
| MD5 |
bd127f0c8f207fdf7bf9d92b8ac64eff
|
|
| BLAKE2b-256 |
1ea899e77d1ecf821babdc4b67331bd3ea4e4534350ef2db84dba97ba607fc85
|