From 2f05992148a1f9245e9f31b60f84a32bb83d1e97 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Thu, 22 Jan 2015 13:01:04 +1100 Subject: [PATCH] Expand on skimage support for 3D processing --- doc/source/user_guide/numpy_images.txt | 29 ++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/doc/source/user_guide/numpy_images.txt b/doc/source/user_guide/numpy_images.txt index 89ee5e41..802cdf6e 100644 --- a/doc/source/user_guide/numpy_images.txt +++ b/doc/source/user_guide/numpy_images.txt @@ -162,14 +162,31 @@ Image type coordinates ======================== ======================================== -In many cases, -the third imaging dimension has lower resolution than the other two, -and processing must be done frame-wise. When frames are the leading -dimension, we can use the following syntax: +Many functions in scikit-image operate on 3D images directly: - >>> for image in image3d: # doctest: +SKIP + >>> im3d = np.random.rand(100, 1000, 1000) + >>> from skimage import morphology + >>> from scipy import ndimage as nd + >>> seeds = nd.label(im3d < 0.1)[0] + >>> ws = morphology.watershed(im3d, seeds) + +In many cases, +the third imaging dimension has lower resolution than the other two. +Some scikit-image functions provide a ``spacing`` keyword argument +to process these images: + + >>> from skimage import segmentation + >>> slics = segmentation.slic(im3d, spacing=[5, 1, 1], multichannel=False) + + +Other times, processing must be done frame-wise. When frames are the +leading dimension, we can use the following syntax: + + >>> from skimage import filters + >>> edges = np.zeros_like(im3d) + >>> for frm, image in enumerate(im3d): ... # iterate over the leading dimension (frames) - ... do_something_to(image) + ... edges[frm] = filters.sobel(image) Notes on array order