Skip to content

jaspervdg/pynrrd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

Bugs and shortcomings

Most of the nrrd format specification is implemented. Exceptions are:

  • files where encoding is 'txt', 'text', or 'ascii'
  • 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.

About

Simple pure-python module for reading and nrrd files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%