Skip to main content

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

napari_data_inspection-1.0.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

napari_data_inspection-1.0.0-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file napari_data_inspection-1.0.0.tar.gz.

File metadata

  • Download URL: napari_data_inspection-1.0.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for napari_data_inspection-1.0.0.tar.gz
Algorithm Hash digest
SHA256 cf1a799e523a42467160f413d627f93323acc84033df5142cc07e8b2918dc7a9
MD5 2c435d61ada6e454ba4be8f74a47ebe4
BLAKE2b-256 c41ec7e9d62f8a6c68b1a146e7d808ab7d6180921811fb768111e3e45b579afe

See more details on using hashes here.

File details

Details for the file napari_data_inspection-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_data_inspection-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc718e624cb285081a41b9f634b44a4fbdeb394f4f81df7ac1682bc38eaac37e
MD5 3b687f19b30f6b8a1b459bf0f7f9c8a3
BLAKE2b-256 fc1eca4c42bf54d9611d00f7a93d65b51e3489e6269f56c9aefb3664144bff80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page