zarrnii


Namezarrnii JSON
Version 0.4.0a1 PyPI version JSON
download
home_pageNone
SummaryPackage for working with OME-Zarr and NIFTI images in a unified manner, with a focus on spatial transformations
upload_time2025-09-16 14:39:24
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseMIT
keywords biomedical imaging microscopy mri neuroimaging nifti ome-zarr
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # zarrnii

 **ZarrNii** is a Python library for working with OME-Zarr and NIfTI formats. ZarrNii bridges the gap between these two popular formats, enabling seamless data transformation, metadata preservation, and efficient processing of biomedical images. The motivating application is for whole brain lightsheet microscopy and ultra-high field MRI, but it can generally be used for any 3T+channel datasets.

ZarrNii allows you to:

 - Read and write OME-Zarr and NIfTI datasets
 - Perform transformations like cropping, downsampling, and interpolation.
 - Preserve and manipulate metadata from OME-Zarr (e.g., axes, coordinate transformations, OME annotations).

---

## Installation

### Using pip (recommended)
```bash
pip install zarrnii
```

### Development installation  
For contributing or development, clone the repository and install with [uv](https://docs.astral.sh/uv/):

```bash
git clone https://github.com/khanlab/zarrnii.git
cd zarrnii
uv sync --dev
```

---

## Key Features

 - **Seamless Format Conversion**: Easily convert between OME-Zarr and NIfTI while preserving spatial metadata.
 - **Transformations**: Apply common operations like affine transformations, downsampling, and upsampling.
 - **Multiscale Support**: Work with multiscale OME-Zarr pyramids.
 - **Metadata Handling**: Access and modify OME-Zarr metadata like axes and transformations.
 - **Lazy Loading**: Leverage Dask arrays for efficient processing of large datasets.

---

## Quick Start

```python
from zarrnii import ZarrNii

# Load an OME-Zarr dataset
znimg = ZarrNii.from_ome_zarr("path/to/zarr_dataset.ome.zarr")

# Perform a transformation (e.g., downsample)
downsampled_znimg = znimg.downsample(level=2)

# Save as NIfTI
downsampled_znimg.to_nifti("output_dataset.nii")
```

---

## Development

For development, this project uses:

- **[uv](https://docs.astral.sh/uv/)** for fast dependency management
- **[pytest](https://pytest.org/)** for testing
- **[black](https://black.readthedocs.io/)** for code formatting  
- **[flake8](https://flake8.pycqa.org/)** for linting
- **[mkdocs](https://www.mkdocs.org/)** for documentation

### Available commands (using `uv run`):
```bash
# Run tests
uv run pytest

# Format code
uv run black .

# Check linting  
uv run flake8 .

# Build documentation
uv run mkdocs build

# Serve docs locally
uv run mkdocs serve
```

### Using the justfile:
If you have [just](https://just.systems/) installed:
```bash
# See all available tasks
just help

# Run tests
just test

# Format and lint
just format
just lint
```

---

## Learn More

Explore the [documentation](https://www.khanlab.ca/zarrnii) to get started.

## Contributing

Contributions are welcome! Please read our contributing guidelines and ensure all tests pass before submitting pull requests.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "zarrnii",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "biomedical, imaging, microscopy, mri, neuroimaging, nifti, ome-zarr",
    "author": null,
    "author_email": "Ali Khan <alik@robarts.ca>",
    "download_url": "https://files.pythonhosted.org/packages/68/7b/b912a482af6342b602baf1e7689df72c3a07ded76687a0e98cf9c9759d81/zarrnii-0.4.0a1.tar.gz",
    "platform": null,
    "description": "# zarrnii\n\n **ZarrNii** is a Python library for working with OME-Zarr and NIfTI formats. ZarrNii bridges the gap between these two popular formats, enabling seamless data transformation, metadata preservation, and efficient processing of biomedical images. The motivating application is for whole brain lightsheet microscopy and ultra-high field MRI, but it can generally be used for any 3T+channel datasets.\n\nZarrNii allows you to:\n\n - Read and write OME-Zarr and NIfTI datasets\n - Perform transformations like cropping, downsampling, and interpolation.\n - Preserve and manipulate metadata from OME-Zarr (e.g., axes, coordinate transformations, OME annotations).\n\n---\n\n## Installation\n\n### Using pip (recommended)\n```bash\npip install zarrnii\n```\n\n### Development installation  \nFor contributing or development, clone the repository and install with [uv](https://docs.astral.sh/uv/):\n\n```bash\ngit clone https://github.com/khanlab/zarrnii.git\ncd zarrnii\nuv sync --dev\n```\n\n---\n\n## Key Features\n\n - **Seamless Format Conversion**: Easily convert between OME-Zarr and NIfTI while preserving spatial metadata.\n - **Transformations**: Apply common operations like affine transformations, downsampling, and upsampling.\n - **Multiscale Support**: Work with multiscale OME-Zarr pyramids.\n - **Metadata Handling**: Access and modify OME-Zarr metadata like axes and transformations.\n - **Lazy Loading**: Leverage Dask arrays for efficient processing of large datasets.\n\n---\n\n## Quick Start\n\n```python\nfrom zarrnii import ZarrNii\n\n# Load an OME-Zarr dataset\nznimg = ZarrNii.from_ome_zarr(\"path/to/zarr_dataset.ome.zarr\")\n\n# Perform a transformation (e.g., downsample)\ndownsampled_znimg = znimg.downsample(level=2)\n\n# Save as NIfTI\ndownsampled_znimg.to_nifti(\"output_dataset.nii\")\n```\n\n---\n\n## Development\n\nFor development, this project uses:\n\n- **[uv](https://docs.astral.sh/uv/)** for fast dependency management\n- **[pytest](https://pytest.org/)** for testing\n- **[black](https://black.readthedocs.io/)** for code formatting  \n- **[flake8](https://flake8.pycqa.org/)** for linting\n- **[mkdocs](https://www.mkdocs.org/)** for documentation\n\n### Available commands (using `uv run`):\n```bash\n# Run tests\nuv run pytest\n\n# Format code\nuv run black .\n\n# Check linting  \nuv run flake8 .\n\n# Build documentation\nuv run mkdocs build\n\n# Serve docs locally\nuv run mkdocs serve\n```\n\n### Using the justfile:\nIf you have [just](https://just.systems/) installed:\n```bash\n# See all available tasks\njust help\n\n# Run tests\njust test\n\n# Format and lint\njust format\njust lint\n```\n\n---\n\n## Learn More\n\nExplore the [documentation](https://www.khanlab.ca/zarrnii) to get started.\n\n## Contributing\n\nContributions are welcome! Please read our contributing guidelines and ensure all tests pass before submitting pull requests.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Package for working with OME-Zarr and NIFTI images in a unified manner, with a focus on spatial transformations",
    "version": "0.4.0a1",
    "project_urls": {
        "Documentation": "https://www.khanlab.ca/zarrnii",
        "Homepage": "https://github.com/khanlab/zarrnii",
        "Issues": "https://github.com/khanlab/zarrnii/issues",
        "Repository": "https://github.com/khanlab/zarrnii"
    },
    "split_keywords": [
        "biomedical",
        " imaging",
        " microscopy",
        " mri",
        " neuroimaging",
        " nifti",
        " ome-zarr"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f6151fd31d5734b4c1f3ad83c31633c444517aa8481675b230325664c42d686d",
                "md5": "58834db6a92de95d6f1feb37a374ea37",
                "sha256": "82b50e80fc5c5a64502bbb3264bc5991364cacd6363cc644248256407136173f"
            },
            "downloads": -1,
            "filename": "zarrnii-0.4.0a1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "58834db6a92de95d6f1feb37a374ea37",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 20521,
            "upload_time": "2025-09-16T14:39:23",
            "upload_time_iso_8601": "2025-09-16T14:39:23.371514Z",
            "url": "https://files.pythonhosted.org/packages/f6/15/1fd31d5734b4c1f3ad83c31633c444517aa8481675b230325664c42d686d/zarrnii-0.4.0a1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "687bb912a482af6342b602baf1e7689df72c3a07ded76687a0e98cf9c9759d81",
                "md5": "1b6bed0e1869c475c65c55fc23c181c9",
                "sha256": "3d4bda4fc3add86444f2c281c17f29877bf40f1dd1f4a416eb39bebe8ad802d9"
            },
            "downloads": -1,
            "filename": "zarrnii-0.4.0a1.tar.gz",
            "has_sig": false,
            "md5_digest": "1b6bed0e1869c475c65c55fc23c181c9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 345007,
            "upload_time": "2025-09-16T14:39:24",
            "upload_time_iso_8601": "2025-09-16T14:39:24.626657Z",
            "url": "https://files.pythonhosted.org/packages/68/7b/b912a482af6342b602baf1e7689df72c3a07ded76687a0e98cf9c9759d81/zarrnii-0.4.0a1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-16 14:39:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "khanlab",
    "github_project": "zarrnii",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "zarrnii"
}
        
Elapsed time: 0.46536s