From 22320614026da0622c7d3eab7548e973154708ea Mon Sep 17 00:00:00 2001 From: Noah Stier Date: Sun, 29 May 2016 03:56:06 -0700 Subject: [PATCH] Move description and todos from README into docstring. --- skimage/filters/rank/README.rst | 32 ----------------------------- skimage/filters/rank/generic.py | 36 +++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 34 deletions(-) delete mode 100644 skimage/filters/rank/README.rst diff --git a/skimage/filters/rank/README.rst b/skimage/filters/rank/README.rst deleted file mode 100644 index 6e063ec2..00000000 --- a/skimage/filters/rank/README.rst +++ /dev/null @@ -1,32 +0,0 @@ -To do ------ - -* add simple examples, adapt documentation on existing examples -* add/check existing doc -* adapting tests for each type of filter - -General remarks ---------------- - -Basically these filters compute local histogram for each pixel. A histogram is -built using a moving window in order to limit redundant computation. The path -followed by the moving window is given hereunder - - ...-----------------------\ -/--------------------------/ -\-------------------------- ... - -We compare grey.dilate to this histogram based method to show how -computational costs increase with respect to image size or structuring element -size. This implementation gives better results for large structuring elements. - -The local histogram is updated at each pixel as the structuring element window -moves by, i.e. only those pixels entering and leaving the structuring element -update the local histogram. The histogram size is 8-bit (256 bins) for 8-bit -images and 2 to 16-bit for 16-bit images depending on the maximum value of the -image. - -The filter is applied up to the image border, the neighborhood used is -adjusted accordingly. The user may provide a mask image (same size as input -image) where non zero values are the part of the image participating in the -histogram computation. By default the entire image is filtered. diff --git a/skimage/filters/rank/generic.py b/skimage/filters/rank/generic.py index ec369153..998796c6 100644 --- a/skimage/filters/rank/generic.py +++ b/skimage/filters/rank/generic.py @@ -1,5 +1,29 @@ -"""The local histogram is computed using a sliding window similar to the method -described in [1]_. +""" + +General Description +------------------- + +These filters compute the local histogram at each pixel, using a sliding window +similar to the method described in [1]_. A histogram is built using a moving +window in order to limit redundant computation. The moving window follows a +snake-like path: + +...------------------------\ +/--------------------------/ +\--------------------------... + +The local histogram is updated at each pixel as the structuring element window +moves by, i.e. only those pixels entering and leaving the structuring element +update the local histogram. The histogram size is 8-bit (256 bins) for 8-bit +images and 2- to 16-bit for 16-bit images depending on the maximum value of the +image. + +The filter is applied up to the image border, the neighborhood used is +adjusted accordingly. The user may provide a mask image (same size as input +image) where non zero values are the part of the image participating in the +histogram computation. By default the entire image is filtered. + +This implementation outperforms grey.dilation for large structuring elements. Input image can be 8-bit or 16-bit, for 16-bit input images, the number of histogram bins is determined from the maximum value present in the image. @@ -7,6 +31,14 @@ histogram bins is determined from the maximum value present in the image. Result image is 8-/16-bit or double with respect to the input image and the rank filter operation. +To do +----- + +* add simple examples, adapt documentation on existing examples +* add/check existing doc +* adapting tests for each type of filter + + References ----------