Skip to content


Repository files navigation

Build Status


Python version

PyPi version

Documentation Status



pynrrd is a pure-Python module for reading and writing NRRD files into and from numpy arrays.


  • numpy
  • nptyping
  • typing_extensions

v1.0+ requires Python 3.7 or above. If you have an older Python version, please install a v0.x release instead.


pip install pynrrd

Install via pip and GitHub

pip install git+

For developers that want to contribute to pynrrd, you can clone the pynrrd repository and install it using the following commands:

git clone
cd pynrrd
pip install .

or, for the last line, instead use:

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.


The tests can be run via the following command from the base directory:

python -m unittest discover -v nrrd/tests

Format and Lint code

This repository uses pre-commit hooks to run format and lint the code and they are enforced in CI. See [pre-commit](

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, header =

Next Steps

For more information, see the documentation.


See the LICENSE for more information.