Data Inspection Plugin, designed to streamline file navigation and enhance the efficiency of data inspection.
Project description
Napari Data Inspection
A napari plugin for fast, high-throughput inspection of 2D/3D segmentation datasets.
Select one or more images and/or labels layers; files are paired and loaded automatically so you can browse entire datasets without manual effort.
Features
- Multi-folder pairing: any number of image/label folders
- Prefetching & caching for steamless navigation
- Supports common formats (e.g., NIfTI, TIFF, PNG, NRRD, MHA, B2ND) out of the box.
- Extensible loaders (add your own formats if needed).
Installation
# a) Install the plugin
pip install napari-data-inspection
# b) Install the plugin and napari if necessary
pip install napari-data-inspection[all]
Quickstart
napari -w napari-data-inspection
Data organization
- Filter files by patterns (e.g., *_img.nii.gz, *_seg.nii.gz) and/or separate folders per layer.
- Number of files must match across layers; pairs are made by sorted order.
1. Separate folders per layer
Put each layer’s files in its own directory.
/data/images/
case001.nii.gz
case002.nii.gz
/data/labels/
case001.nii.gz
case002.nii.gz
2. By Patterns
Use patterns (globs) per layer.
/data/
case001_img.nii.gz
case001_seg.nii.gz
case002_img.nii.gz
case002_seg.nii.gz
Patterns
Images: *_img.nii.gz
Labels: *_seg.nii.gz
Supported file types
The data loading is based on the ViData package. The following Extensions and Backends are available.
| Extension(s) | Backend(s) | Notes |
|---|---|---|
.png, .jpg, .jpeg, .bmp |
imageio |
Standard 2D image formats |
.tif, .tiff |
tifffile |
Multipage TIFF; high bit-depths supported |
.nii.gz, .nii, .mha, .nrrd |
sitk |
Medical image formats (3D volumes) |
.nii.gz, .nii |
nibabel |
Alternative medical imaging backend |
.b2nd |
blosc2 |
Compressed N-dimensional arrays |
.b2nd |
blosc2pkl |
Compressed N-dimensional arrays with metadata in a separate .pkl |
.npy |
numpy |
Single NumPy array |
Custom Load Functions
- Register a reader with a decorator.
- Reader must return (numpy_array, metadata_dict).
- Registration happens at import time—make sure this module is imported (e.g., from your package’s init.py).
- See here for an example.
- metadata should contain an "affine" if entry, if any spatial transformation should be applied
# custom_io_template.py — fill in the TODOs and import this module somewhere at startup.
import numpy as np
from typing import Tuple, Dict, List
# TODO: import your backend library (e.g., imageio, tifffile, nibabel, SimpleITK, ...)
# import imageio.v3 as iio
from vidata.registry import register_loader, register_writer
# --------------------------- READER ------------------------------------------
# Replace file extension and backend name to your custom function
@register_loader("image", ".png", ".jpg", ".jpeg", ".bmp", backend="imageio") # To Register Image Loading
@register_loader("mask", ".png", ".bmp", backend="imageio") # To Register Label Loading
def load_custom(file: str) -> tuple[np.ndarray, dict]:
"""
Load a file and return (data, metadata).
metadata can be empty or include keys like: spacing, origin, direction, shear, dtype, etc.
"""
# data = iio.imread(file) # example for imageio
data = ... # TODO: replace
meta = {} # TODO: replace
return data, meta
Acknowledgments
This repository is developed and maintained by the Applied Computer Vision Lab (ACVL) of Helmholtz Imaging and the Division of Medical Image Computing at DKFZ.
This napari plugin was generated with copier using the napari-plugin-template.
Project details
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 napari_data_inspection-1.0.1.tar.gz.
File metadata
- Download URL: napari_data_inspection-1.0.1.tar.gz
- Upload date:
- Size: 23.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e6eda393562e103d3754661c632c18acff6a8070c8db8495ab6abb652456775
|
|
| MD5 |
e380c01a3e73442f8b5411adaeaa4324
|
|
| BLAKE2b-256 |
594781feb8132dda5f23c602f65e8b71a0eeae76f595fccba918f1157d1fcb19
|
File details
Details for the file napari_data_inspection-1.0.1-py3-none-any.whl.
File metadata
- Download URL: napari_data_inspection-1.0.1-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
177e1236c0331f759dc17444fa533ad5af89b17265780749dea8a7d179dfc509
|
|
| MD5 |
65f323fa2609bdb13559b8107662527b
|
|
| BLAKE2b-256 |
76e60b80ffc7290ea38fd8d761aaff57f5456704cd3d51ee2d9b5c3033174b48
|