From ae06dca96c5614278fe8ed017d63a071775178d5 Mon Sep 17 00:00:00 2001 From: Jim Rybarski Date: Sat, 23 May 2015 18:32:27 +0000 Subject: [PATCH] #27 better instructions --- README.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c7c8213..709db26 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # nd2reader -## Simple access to .nd2 files - ### About `nd2reader` is a pure-Python package that reads images produced by NIS Elements. .nd2 files contain images and metadata, which can be split along multiple dimensions: time, fields of view (xy-plane), focus (z-plane), and filter channel. -`nd2reader` produces data in numpy arrays, which makes it trivial to use with the image analysis packages `scikit-image` and `OpenCV`. +`nd2reader` produces data in numpy arrays, which makes it trivial to use with the image analysis packages such as `scikit-image` and `OpenCV`. ### Installation @@ -20,9 +18,9 @@ If you want to install via git, clone the repo and run: `python setup.py install` -### Usage +### Simple Iteration -nd2reader provides two main ways to view image data. For most cases, you'll just want to iterate over each image: +For most cases, you'll just want to iterate over each image: ``` import nd2reader @@ -31,10 +29,12 @@ for image in nd2: do_something(image.data) ``` +### Image Sets + If you have complicated hierarchical data, it may be easier to use image sets, which groups images together if they share the same time index and field of view: -``` +```python import nd2reader nd2 = nd2reader.Nd2("/path/to/my_complicated_images.nd2") for image_set in nd2.image_sets: @@ -47,6 +47,14 @@ for image_set in nd2.image_sets: do_something_out_of_focus_related(out_of_focus_image) ``` +### Direct Image Access + +There is a method, `get_image`, which allows random access to images. This might not always return an image, however, +if you acquired different numbers of images in each cycle of a program. For example, if you acquire GFP images every +other minute, but acquire bright field images every minute, `get_image` will return `None` at certain time indexes. + +### Images + `Image` objects provide several pieces of useful data. ```