Pure python module for reading and writing NRRD files.
Project description
.. image:: https://travis-ci.org/mhe/pynrrd.svg?branch=master :target: https://travis-ci.org/mhe/pynrrd :alt: Build Status
.. image:: https://zenodo.org/badge/doi/10.5281/zenodo.62065.svg :target: https://doi.org/10.5281/zenodo.62065 :alt: DOI
.. image:: https://img.shields.io/pypi/pyversions/pynrrd.svg :target: https://img.shields.io/pypi/pyversions/pynrrd.svg :alt: Python version
.. image:: https://badge.fury.io/py/pynrrd.svg :target: https://badge.fury.io/py/pynrrd :alt: PyPi version
.. image:: https://readthedocs.org/projects/pynrrd/badge/?version=latest :target: https://pynrrd.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://codecov.io/gh/mhe/pynrrd/branch/master/graph/badge.svg :target: https://codecov.io/gh/mhe/pynrrd
|
pynrrd
pynrrd is a pure-Python module for reading and writing NRRD <http://teem.sourceforge.net/nrrd/>
_ files into and
from numpy arrays.
Dependencies
The module's only dependency is numpy <http://numpy.scipy.org/>
_.
Installation
Install via pip and PyPi repository (recommended)
.. code-block:: bash
pip install pynrrd
Install via pip and GitHub
~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: bash
pip install git+https://github.com/mhe/pynrrd.git
Install from source (recommended for contributing to pynrrd)
For developers that want to contribute to pynrrd, you can clone the pynrrd repository and install it using the following commands:
.. code-block:: bash
git clone https://github.com/mhe/pynrrd.git
cd pynrrd
pip install .
or, for the last line, instead use:
.. code-block:: bash
pip install -e .
to install in 'develop' or 'editable' mode, where changes can be made to the local working code and Python will use the updated pynrrd code.
Example usage
.. code-block:: python
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, header = nrrd.read(filename)
print(readdata.shape)
print(header)
Tests
Run the following command in the base directory to run the tests:
.. code-block:: bash
python -m unittest discover -v nrrd/tests
Next Steps
For more information, see the documentation <http://pynrrd.readthedocs.io/>
_.
License
See the LICENSE <https://github.com/mhe/pynrrd/blob/master/LICENSE>
_ for more information.
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
Built Distribution
Hashes for pynrrd-0.3.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c119e7628d40dedba7fce02cee44a261c84013fdba57a4928adc4370ba4497c |
|
MD5 | 271b7869d901275145a789878311a5e0 |
|
BLAKE2b-256 | d036b71766f37a598e72321b62472ab068d30f3bb2715e17cb30aab340e88e10 |