This package provides a unified entry point and organized task modules for managing N5/Zarr dataset conversions and downsampling. It centralizes your workflow into a single pipeline to reduce manual work and errors.
tensorswitch/
├── pixi.lock
├── pyproject.toml
├── README.md
├── src
│ └── tensorswitch
│ ├── __init__.py
│ ├── __main__.py # Main dispatcher script
│ ├── tasks
│ │ ├── __init__.py
│ │ ├── downsample_shard_zarr3.py # Downsample using shards
│ │ ├── n5_to_n5.py # N5 to N5 conversion logic
│ │ ├── n5_to_zarr2.py # N5 to Zarr V2 conversion logic
│ └── utils.py # Common utilities (chunk domain calculation)
└── tests
├── test_n5_to_n5.py
├── test_n5_to_zarr2.py
├── test_n5_to_zarr3_downsample_shard.py
├── test_zarr3_to_downsample_noshard_zarr3.py
└── test_zarr3_to_downsample_shard_zarr3.py
pip install git+https://github.com/JaneliaSciComp/tensorswitch
pixi add python
pixi add --pypi "tensorswitch @ git+https://github.com/JaneliaSciComp/tensorswitch"
Use the python -m tensorswitch
as the entry point. Example:
python -m tensorswitch --task n5_to_zarr2 --base_path /path/to/n5 --output_path /path/to/zarr2 --level 0
Task Name | Description |
---|---|
n5_to_zarr2 |
Convert N5 to Zarr V2 |
n5_to_n5 |
Convert N5 to N5 (new chunking) |
downsample_zarr |
Downsample existing Zarr dataset |
submit_downsample |
Submit downsampling jobs to the cluster |
submit_n5_zarr |
Submit N5 to Zarr jobs to the cluster |
submit_n5_n5 |
Submit N5 to N5 jobs to the cluster |
python -m tensorswitch --task n5_to_zarr2 --base_path /path/to/n5 --output_path /path/to/zarr2 --level 0
python -m tensorswitch --task downsample_zarr --base_path /path/to/zarr --level 1 --use_shard 1
python -m tensorswitch --task submit_n5_zarr
- Python 3.10+
- TensorStore
- NumPy
- psutil
- requests (for N5 over HTTP)
If you need more enhancements (like adding logging or progress tracking), feel free to extend the tasks
modules.