From 2ac0210febb3612609097cf935c2d7f4b3be214c Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Fri, 10 Mar 2017 11:30:06 +0100 Subject: [PATCH 1/2] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 96c8709..0617e73 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ If you don't already have the packages `numpy`, `pims`, `six` and `xmltodict`, t ```python from nd2reader import ND2Reader -images = ND2Reader('my_directory/example.nd2') +with ND2Reader('my_directory/example.nd2') as images: + plt.imshow(images[0]) ``` After opening the file, all `pims` features are supported. Please refer to the [pims documentation](http://soft-matter.github.io/pims/). From 4df98c13a6e209ba0bc2e9fd92ed554f4322c06c Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Fri, 10 Mar 2017 11:31:13 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0617e73..ab0cd34 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,12 @@ If you don't already have the packages `numpy`, `pims`, `six` and `xmltodict`, t ### ND2s -`nd2reader` follows the [pims](https://github.com/soft-matter/pims) framework. To open a file: +`nd2reader` follows the [pims](https://github.com/soft-matter/pims) framework. To open a file and show the first frame: ```python from nd2reader import ND2Reader +import matplotlib.pyplot as plt + with ND2Reader('my_directory/example.nd2') as images: plt.imshow(images[0]) ```