Pure python module for reading and writing NRRD files.
Project description
pynrrd
pynrrd is a pure-Python module for reading and writing nrrd files into and from numpy arrays.
Dependencies
The module's only dependency is numpy.
Installation
Install via pip and PyPi repository (recommended)
pip install pynrrd
Install via pip and GitHub
pip install git+https://github.com/mhe/pynrrd.git
Install from source
python setup.py install
Example usage
import numpy as np
import nrrd
# some sample numpy data
data = np.zeros((5,4,3,2))
filename = 'testdata.nrrd'
# write to a nrrd file
nrrd.write(filename, data)
# read the data back from file
readdata, options = nrrd.read(filename)
print readdata.shape
print options
Tests
To run the tests:
python tests/test_nrrd.py
Bugs and shortcomings
Most of the nrrd format specification is implemented. Exceptions are:
- files where "data file" is "LIST"
Other shortcomings:
- More documentation is desirable, in particular for the options that can be passed to the write function.
- pynrrd is currently probably fairly forgiving in what it accepts for as nrrd files and could be made stricter.
License
See LICENSE.
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
pynrrd-0.2.5.tar.gz
(11.8 kB
view hashes)
Built Distribution
pynrrd-0.2.5-py2.py3-none-any.whl
(10.1 kB
view hashes)
Close
Hashes for pynrrd-0.2.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 063f3a15822b4bd15d7f2ab657a32f968a8b55bdc64328e31986db110f016c88 |
|
MD5 | 1fdb4c20df9752b80b2988336d2aaf51 |
|
BLAKE2b-256 | 14334444d8394ec050c7bb52ed6379296f0e5e7732954e9aa063710304a45ca6 |