You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.7 KiB

10 years ago
8 years ago
8 years ago
8 years ago
8 years ago
9 years ago
8 years ago
8 years ago
8 years ago
8 years ago
10 years ago
8 years ago
9 years ago
9 years ago
10 years ago
  1. # nd2reader
  2. [![Build Status](https://travis-ci.org/rbnvrw/nd2reader.svg?branch=master)](https://travis-ci.org/rbnvrw/nd2reader)
  3. [![Test Coverage](https://codeclimate.com/github/rbnvrw/nd2reader/badges/coverage.svg)](https://codeclimate.com/github/rbnvrw/nd2reader/coverage)
  4. [![Code Climate](https://codeclimate.com/github/rbnvrw/nd2reader/badges/gpa.svg)](https://codeclimate.com/github/rbnvrw/nd2reader)
  5. ![(score out of 4.0)](https://cdn.rawgit.com/rbnvrw/nd2reader/6f4536f1/badge.svg)
  6. ### About
  7. `nd2reader` is a pure-Python package that reads images produced by NIS Elements 4.0+. It has only been definitively tested on NIS Elements 4.30.02 Build 1053. Support for older versions is being actively worked on.
  8. The reader is written in the [pims](https://github.com/soft-matter/pims) framework, enabling easy access to multidimensional files, lazy slicing, and nice display in IPython.
  9. ### Documentation
  10. The documentation is available [here](http://www.lighthacking.nl/nd2reader/).
  11. ### Installation
  12. The package is available on PyPi. Install it using:
  13. ```
  14. pip install nd2reader
  15. ```
  16. If you don't already have the packages `numpy`, `pims`, `six` and `xmltodict`, they will be installed automatically if you use the `setup.py` script.
  17. `nd2reader` is an order of magnitude faster in Python 3. I recommend using it unless you have no other choice. Python 2.7 and Python >= 3.4 are supported.
  18. ### ND2s
  19. `nd2reader` follows the [pims](https://github.com/soft-matter/pims) framework. To open a file and show the first frame:
  20. ```python
  21. from nd2reader import ND2Reader
  22. import matplotlib.pyplot as plt
  23. with ND2Reader('my_directory/example.nd2') as images:
  24. plt.imshow(images[0])
  25. ```
  26. After opening the file, all `pims` features are supported. Please refer to the [pims documentation](http://soft-matter.github.io/pims/).
  27. #### Backwards compatibility
  28. Older versions of `nd2reader` do not use the `pims` framework. To provide backwards compatibility, a legacy [Nd2](http://www.lighthacking.nl/nd2reader/nd2reader.html#module-nd2reader.legacy) class is provided.
  29. ### Contributing
  30. If you'd like to help with the development of nd2reader or just have an idea for improvement, please see the [contributing](https://github.com/rbnvrw/nd2reader/blob/master/CONTRIBUTING.md) page
  31. for more information.
  32. ### Bug Reports and Features
  33. If this fails to work exactly as expected, please open an [issue](https://github.com/rbnvrw/nd2reader/issues).
  34. If you get an unhandled exception, please paste the entire stack trace into the issue as well.
  35. ### Acknowledgments
  36. PIMS modified version by Ruben Verweij.
  37. Original version by Jim Rybarski. Support for the development of this package was partially provided by the [Finkelstein Laboratory](http://finkelsteinlab.org/).