From 2147812ab479b09797355aa8fdebc3c558ee1f08 Mon Sep 17 00:00:00 2001 From: walter Date: Tue, 14 Jun 2016 16:40:21 +0200 Subject: [PATCH] small corrections on the doc string --- skimage/feature/_texture.pyx | 10 +++++----- skimage/feature/texture.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/skimage/feature/_texture.pyx b/skimage/feature/_texture.pyx index 132e19b8..ff77e0a7 100644 --- a/skimage/feature/_texture.pyx +++ b/skimage/feature/_texture.pyx @@ -12,7 +12,7 @@ from .._shared.transform cimport integrate cdef extern from "numpy/npy_math.h": double NAN "NPY_NAN" -ctypedef fused uint_8_16: +ctypedef fused any_int: cnp.uint8_t cnp.uint16_t cnp.uint32_t @@ -22,7 +22,7 @@ ctypedef fused uint_8_16: cnp.int32_t cnp.int64_t -def _glcm_loop(uint_8_16[:, ::1] image, double[:] distances, +def _glcm_loop(any_int[:, ::1] image, double[:] distances, double[:] angles, Py_ssize_t levels, cnp.uint32_t[:, :, :, ::1] out): """Perform co-occurrence matrix accumulation. @@ -31,7 +31,7 @@ def _glcm_loop(uint_8_16[:, ::1] image, double[:] distances, ---------- image : ndarray Integer typed input image. Only positive valued images are supported. - If type is uint16, the argument `levels` needs to be set. + If type is other than uint8, the argument `levels` needs to be set. distances : ndarray List of pixel pair distance offsets. angles : ndarray @@ -40,7 +40,7 @@ def _glcm_loop(uint_8_16[:, ::1] image, double[:] distances, The input image should contain integers in [0, `levels`-1], where levels indicate the number of grey-levels counted (typically 256 for an 8-bit image). This argument is required for - 16-bit images and is typically the maximum of the image. + 16-bit images or higher and is typically the maximum of the image. As the output matrix is at least `levels` x `levels`, it might be preferable to use binning of the input image rather than large values for `levels`. @@ -52,7 +52,7 @@ def _glcm_loop(uint_8_16[:, ::1] image, double[:] distances, cdef: Py_ssize_t a_idx, d_idx, r, c, rows, cols, row, col - uint_8_16 i, j + any_int i, j cnp.float64_t angle, distance with nogil: diff --git a/skimage/feature/texture.py b/skimage/feature/texture.py index 49763433..5317964d 100644 --- a/skimage/feature/texture.py +++ b/skimage/feature/texture.py @@ -20,9 +20,9 @@ def greycomatrix(image, distances, angles, levels=None, symmetric=False, Parameters ---------- - image : array_like of uint8 or uint16. + image : array_like Integer typed input image. Only positive valued images are supported. - If type is uint16, the argument `levels` needs to be set. + If type is other than uint8, the argument `levels` needs to be set. distances : array_like List of pixel pair distance offsets. angles : array_like @@ -31,7 +31,7 @@ def greycomatrix(image, distances, angles, levels=None, symmetric=False, The input image should contain integers in [0, `levels`-1], where levels indicate the number of grey-levels counted (typically 256 for an 8-bit image). This argument is required for - 16-bit images and is typically the maximum of the image. + 16-bit images or higher and is typically the maximum of the image. As the output matrix is at least `levels` x `levels`, it might be preferable to use binning of the input image rather than large values for `levels`.