From 416f4f69fc38f5893fa92439dc3870215e9a9905 Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Sun, 2 Apr 2017 17:43:48 +0200 Subject: [PATCH] Update documentation, quick start tutorial --- docs | 2 +- sphinx/conf.py | 4 ++-- sphinx/nd2reader.rst | 2 +- sphinx/tutorial.md | 33 ++++++++++++++++++++++++++++++++- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/docs b/docs index 6e17cad..f4e4a67 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 6e17cadb9d79143c4e41ababeb309d4e88f9038b +Subproject commit f4e4a67ac24cf12b3c0b6e5aae0dbb2f3497bb73 diff --git a/sphinx/conf.py b/sphinx/conf.py index 94c5592..c03f0cc 100644 --- a/sphinx/conf.py +++ b/sphinx/conf.py @@ -44,9 +44,9 @@ author = 'Ruben Verweij' # built documents. # # The short X.Y version. -version = '' +version = '3.0.0' # The full version, including alpha/beta/rc tags. -release = '' +release = '3.0.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/sphinx/nd2reader.rst b/sphinx/nd2reader.rst index 668ad6e..c0b2722 100644 --- a/sphinx/nd2reader.rst +++ b/sphinx/nd2reader.rst @@ -55,7 +55,7 @@ nd2reader.exceptions module :undoc-members: :show-inheritance: -nd2reader.exceptions artificial +nd2reader.artificial module ------------------------------- .. automodule:: nd2reader.artificial diff --git a/sphinx/tutorial.md b/sphinx/tutorial.md index 60fb2d1..7b69627 100644 --- a/sphinx/tutorial.md +++ b/sphinx/tutorial.md @@ -23,4 +23,35 @@ 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/). \ No newline at end of file +After opening the file, all `pims` features are supported. Please refer to the [pims documentation](http://soft-matter.github.io/pims/). + +### ND2 metadata + +The ND2 file contains various metadata, such as acquisition information, +regions of interest and custom user comments. Most of this metadata is parsed +and available in dictionary form. For example: + +```python +from nd2reader import ND2Reader + +with ND2Reader('my_directory/example.nd2') as images: + # width and height of the image + print('%d x %d px' % (images.metadata['width'], images.metadata['height'])) + +``` + +All metadata properties are: + +* `width`: the width of the image in pixels +* `height`: the height of the image in pixels +* `date`: the date the image was taken +* `fields_of_view`: the fields of view in the image +* `frames`: a list of all frame numbers +* `z_levels`: the z levels in the image +* `total_images_per_channel`: the number of images per color channel +* `channels`: the color channels +* `pixel_microns`: the amount of microns per pixel +* `rois`: the regions of interest (ROIs) defined by the user +* `experiment`: information about the nature and timings of the ND experiment + +