From 4854dc830f0aeb4b771b33c9fcdd19dcafd2bb50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 4 Mar 2013 21:22:20 +0100 Subject: [PATCH 01/12] Increase version number to 0.9 --- bento.info | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bento.info b/bento.info index 10ee84f2..71ef558e 100644 --- a/bento.info +++ b/bento.info @@ -1,5 +1,5 @@ Name: scikit-image -Version: 0.8.0 +Version: 0.9.dev0 Summary: Image processing routines for SciPy Url: http://scikit-image.org DownloadUrl: http://github.com/scikit-image/scikit-image diff --git a/setup.py b/setup.py index 22971ba7..d62a0d86 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ MAINTAINER_EMAIL = 'stefan@sun.ac.za' URL = 'http://scikit-image.org' LICENSE = 'Modified BSD' DOWNLOAD_URL = 'http://github.com/scikit-image/scikit-image' -VERSION = '0.8.0' +VERSION = '0.9dev' PYTHON_VERSION = (2, 5) DEPENDENCIES = { 'numpy': (1, 6), From 19e938a3deb4562cecbebd484afb2cd201cf6b83 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Mon, 4 Mar 2013 17:29:44 -0800 Subject: [PATCH 02/12] Fix `ValueError: Buffer dtype mismatch` on win-amd64 --- skimage/morphology/_convex_hull.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/morphology/_convex_hull.pyx b/skimage/morphology/_convex_hull.pyx index e4b6470c..7298e1ed 100644 --- a/skimage/morphology/_convex_hull.pyx +++ b/skimage/morphology/_convex_hull.pyx @@ -31,7 +31,7 @@ def possible_hull(cnp.ndarray[dtype=cnp.uint8_t, ndim=2, mode="c"] img): # rows storage slots for right boundary pixels # cols storage slots for bottom boundary pixels cdef cnp.ndarray[dtype=cnp.intp_t, ndim=2] nonzero = \ - np.ones((2 * (rows + cols), 2), dtype=np.int) + np.ones((2 * (rows + cols), 2), dtype=np.intp) nonzero *= -1 for r in range(rows): From dda83fdb5586d69b06043d57ba312a12f277c05c Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Mon, 4 Mar 2013 17:30:40 -0800 Subject: [PATCH 03/12] Fix `ValueError: Buffer dtype mismatch` on win-amd64 --- skimage/segmentation/_felzenszwalb_cy.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/segmentation/_felzenszwalb_cy.pyx b/skimage/segmentation/_felzenszwalb_cy.pyx index f285e3db..b525a0d9 100644 --- a/skimage/segmentation/_felzenszwalb_cy.pyx +++ b/skimage/segmentation/_felzenszwalb_cy.pyx @@ -73,7 +73,7 @@ def _felzenszwalb_grey(image, double scale=1, sigma=0.8, Py_ssize_t min_size=20) cdef cnp.intp_t *edges_p = edges.data cdef cnp.float_t *costs_p = costs.data cdef cnp.ndarray[cnp.intp_t, ndim=1] segment_size \ - = np.ones(width * height, dtype=np.int) + = np.ones(width * height, dtype=np.intp) # inner cost of segments cdef cnp.ndarray[cnp.float_t, ndim=1] cint = np.zeros(width * height) cdef int seg0, seg1, seg_new, e From 7ca08cf7630787201636da4ea4409741b558d613 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Mon, 4 Mar 2013 17:32:22 -0800 Subject: [PATCH 04/12] Fix `ValueError: Buffer dtype mismatch` on win-amd64 --- skimage/transform/hough_transform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/transform/hough_transform.py b/skimage/transform/hough_transform.py index 17b76826..e83cecd5 100644 --- a/skimage/transform/hough_transform.py +++ b/skimage/transform/hough_transform.py @@ -164,7 +164,7 @@ def hough_circle(img, radius, normalize=True): Hough transform accumulator for each radius """ - return _hough_circle(img, radius, normalize) + return _hough_circle(img, radius.astype(np.intp), normalize) def hough_peaks(hspace, angles, dists, min_distance=10, min_angle=10, threshold=None, num_peaks=np.inf): From 97fd434314b2a42af50d39e1ed11b5a2bfaab5a9 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Mon, 4 Mar 2013 17:33:15 -0800 Subject: [PATCH 05/12] Fix `ValueError: Buffer dtype mismatch` on win-amd64 --- skimage/draw/_draw.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/draw/_draw.pyx b/skimage/draw/_draw.pyx index 8a2572c4..f14fb1b2 100644 --- a/skimage/draw/_draw.pyx +++ b/skimage/draw/_draw.pyx @@ -281,7 +281,7 @@ def circle_perimeter(Py_ssize_t cy, Py_ssize_t cx, Py_ssize_t radius, y = y - 1 x = x + 1 - return np.array(rr) + cy, np.array(cc) + cx + return np.array(rr, dtype=np.intp) + cy, np.array(cc, dtype=np.intp) + cx def ellipse_perimeter(Py_ssize_t cy, Py_ssize_t cx, Py_ssize_t yradius, From 211d64644f92d1e01a5d0196d85f8997c0ce44ed Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Mon, 4 Mar 2013 22:45:46 -0800 Subject: [PATCH 06/12] Use np.intp type for indices --- skimage/draw/_draw.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skimage/draw/_draw.pyx b/skimage/draw/_draw.pyx index f14fb1b2..eb9293d5 100644 --- a/skimage/draw/_draw.pyx +++ b/skimage/draw/_draw.pyx @@ -126,7 +126,7 @@ def polygon(y, x, shape=None): rr.append(r) cc.append(c) - return np.array(rr), np.array(cc) + return np.array(rr, dtype=np.intp), np.array(cc, dtype=np.intp) def ellipse(double cy, double cx, double yradius, double xradius, shape=None): @@ -174,7 +174,7 @@ def ellipse(double cy, double cx, double yradius, double xradius, shape=None): rr.append(r) cc.append(c) - return np.array(rr), np.array(cc) + return np.array(rr, dtype=np.intp), np.array(cc, dtype=np.intp) def circle(double cy, double cx, double radius, shape=None): @@ -368,7 +368,7 @@ def ellipse_perimeter(Py_ssize_t cy, Py_ssize_t cx, Py_ssize_t yradius, err += ychange ychange += twobsquared - return np.array(py) + cy, np.array(px) + cx + return np.array(py, dtype=np.intp) + cy, np.array(px, dtype=np.intp) + cx def set_color(img, coords, color): From a4654b4b4517b1a049a27903d0a5951b333af35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 5 Mar 2013 08:51:30 +0100 Subject: [PATCH 07/12] Add mailing list adresses to release instructions --- RELEASE.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASE.txt b/RELEASE.txt index e42d1c85..dfde6209 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -51,6 +51,12 @@ How to make a new release of ``skimage`` - Post release notes on mailing lists, blog, G+, etc. + - scikit-image@googlegroups.com + - scipy-user@scipy.org + - scikit-learn-general@lists.sourceforge.net + - pythonvision@googlegroups.com + + Debian ------ From 631a3bc687322e8f9acfa8c935bf0b2515ac98cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 5 Mar 2013 08:55:37 +0100 Subject: [PATCH 08/12] Add release instruction to update dev docs --- RELEASE.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE.txt b/RELEASE.txt index dfde6209..1131a91a 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -49,6 +49,8 @@ How to make a new release of ``skimage`` - Build using ``make gh-pages``. - Push upstream: ``git push`` in ``gh-pages``. +- Update the development docs for the new version ``0.Xdev`` just like above + - Post release notes on mailing lists, blog, G+, etc. - scikit-image@googlegroups.com From e6ee2c0db607c09454f630d6f10372b4e12e81db Mon Sep 17 00:00:00 2001 From: "Thouis (Ray) Jones" Date: Tue, 5 Mar 2013 10:37:56 -0500 Subject: [PATCH 09/12] BUG: not all histogram memory was aligned correctly --- skimage/filter/_ctmf.pyx | 24 +++++++++++------------- skimage/filter/setup.py | 3 ++- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/skimage/filter/_ctmf.pyx b/skimage/filter/_ctmf.pyx index 1a03ff5a..7cb5251f 100644 --- a/skimage/filter/_ctmf.pyx +++ b/skimage/filter/_ctmf.pyx @@ -20,7 +20,7 @@ from libc.stdlib cimport malloc, free from libc.string cimport memset -cdef extern from "../_shared/vectorized_ops.h": +cdef extern from "vectorized_ops.h": void add16(cnp.uint16_t *dest, cnp.uint16_t *src) void sub16(cnp.uint16_t *dest, cnp.uint16_t *src) @@ -91,8 +91,9 @@ cdef struct SCoord: Py_ssize_t y cdef struct Histograms: - void *memory # pointer to the allocated memory - Histogram *histogram # pointer to the histogram memory + HistogramPiece accumulator # running histogram (32-byte aligned) + void *memory # pointer to the unaligned allocated memory + Histogram *histogram # pointer to the histogram memory (aligned) PixelCount *pixel_count # pointer to the pixel count memory cnp.uint8_t *data # pointer to the image data cnp.uint8_t *mask # pointer to the image mask @@ -142,9 +143,6 @@ cdef struct Histograms: Py_ssize_t row_stride # stride between one row and the next Py_ssize_t col_stride # stride between one column and the next - # The accumulator holds the running histogram - # - HistogramPiece accumulator # # The running count of pixels in the accumulator # @@ -188,10 +186,12 @@ cdef Histograms *allocate_histograms(Py_ssize_t rows, memory_size = (adjusted_stripe_length * (sizeof(Histogram) + sizeof(PixelCount)) + - sizeof(Histograms) + 32) + sizeof(Histograms) + 64) ptr = malloc(memory_size) memset(ptr, 0, memory_size) - ph = ptr + # align ph.accumulator to 32-byte boundary + roundoff = ( ptr + 31) % 32 + ph = (ptr + 31 - roundoff) if not ptr: return ph ph.memory = ptr @@ -201,10 +201,8 @@ cdef Histograms *allocate_histograms(Py_ssize_t rows, # # Align histogram memory to a 32-byte boundary # - roundoff = ptr - roundoff += 31 - roundoff -= roundoff % 32 - ptr = roundoff + roundoff = ( ptr + 31) % 32 + ptr += 31 - roundoff ph.histogram = ptr # # Fill in the statistical things we keep around @@ -696,7 +694,7 @@ cdef int c_median_filter(Py_ssize_t rows, # # Initialize the accumulator (octagon histogram) to zero # - memset(&ph.accumulator, 0, sizeof(ph.accumulator)) + memset(&(ph.accumulator), 0, sizeof(ph.accumulator)) ph.accumulator_count = 0 for i in range(16): ph.last_update_column[i] = -radius-1 diff --git a/skimage/filter/setup.py b/skimage/filter/setup.py index 934d3f2e..dba8172c 100644 --- a/skimage/filter/setup.py +++ b/skimage/filter/setup.py @@ -26,7 +26,8 @@ def configuration(parent_package='', top_path=None): cython(['rank/bilateral_rank.pyx'], working_path=base_path) config.add_extension('_ctmf', sources=['_ctmf.c'], - include_dirs=[get_numpy_include_dirs()]) + depends=['../_shared/vectorized_ops.h'], + include_dirs=[get_numpy_include_dirs(), '../_shared']) config.add_extension('_denoise_cy', sources=['_denoise_cy.c'], include_dirs=[get_numpy_include_dirs(), '../_shared']) config.add_extension('rank._core8', sources=['rank/_core8.c'], From 44350f56c99dcfc9ddf13dda5ab660697dc579f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 6 Mar 2013 16:42:18 +0100 Subject: [PATCH 10/12] Fix vectorized_ops for bento --- skimage/filter/_ctmf.pyx | 2 +- skimage/filter/setup.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/skimage/filter/_ctmf.pyx b/skimage/filter/_ctmf.pyx index 7cb5251f..302ab4c6 100644 --- a/skimage/filter/_ctmf.pyx +++ b/skimage/filter/_ctmf.pyx @@ -20,7 +20,7 @@ from libc.stdlib cimport malloc, free from libc.string cimport memset -cdef extern from "vectorized_ops.h": +cdef extern from "../_shared/vectorized_ops.h": void add16(cnp.uint16_t *dest, cnp.uint16_t *src) void sub16(cnp.uint16_t *dest, cnp.uint16_t *src) diff --git a/skimage/filter/setup.py b/skimage/filter/setup.py index dba8172c..b1d070fc 100644 --- a/skimage/filter/setup.py +++ b/skimage/filter/setup.py @@ -26,8 +26,7 @@ def configuration(parent_package='', top_path=None): cython(['rank/bilateral_rank.pyx'], working_path=base_path) config.add_extension('_ctmf', sources=['_ctmf.c'], - depends=['../_shared/vectorized_ops.h'], - include_dirs=[get_numpy_include_dirs(), '../_shared']) + include_dirs=[get_numpy_include_dirs()]) config.add_extension('_denoise_cy', sources=['_denoise_cy.c'], include_dirs=[get_numpy_include_dirs(), '../_shared']) config.add_extension('rank._core8', sources=['rank/_core8.c'], From 387c72b018f1fa08babf0543b0b63d4758c48d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 6 Mar 2013 16:43:41 +0100 Subject: [PATCH 11/12] Remove colon as multi-line comment symbol --- skimage/draw/_draw.pyx | 6 +++--- skimage/measure/tests/test_regionprops.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/skimage/draw/_draw.pyx b/skimage/draw/_draw.pyx index eb9293d5..4316cadc 100644 --- a/skimage/draw/_draw.pyx +++ b/skimage/draw/_draw.pyx @@ -109,14 +109,14 @@ def polygon(y, x, shape=None): cdef Py_ssize_t r, c - #: make contigous arrays for r, c coordinates + # make contigous arrays for r, c coordinates cdef cnp.ndarray contiguous_rdata, contiguous_cdata contiguous_rdata = np.ascontiguousarray(y, 'double') contiguous_cdata = np.ascontiguousarray(x, 'double') cdef cnp.double_t* rptr = contiguous_rdata.data cdef cnp.double_t* cptr = contiguous_cdata.data - #: output coordinate arrays + # output coordinate arrays cdef list rr = list() cdef list cc = list() @@ -164,7 +164,7 @@ def ellipse(double cy, double cx, double yradius, double xradius, shape=None): cdef Py_ssize_t r, c - #: output coordinate arrays + # output coordinate arrays cdef list rr = list() cdef list cc = list() diff --git a/skimage/measure/tests/test_regionprops.py b/skimage/measure/tests/test_regionprops.py index 8185bf67..c1396670 100644 --- a/skimage/measure/tests/test_regionprops.py +++ b/skimage/measure/tests/test_regionprops.py @@ -49,7 +49,7 @@ def test_bbox(): def test_central_moments(): mu = regionprops(SAMPLE, ['CentralMoments'])[0]['CentralMoments'] - #: determined with OpenCV + # determined with OpenCV assert_almost_equal(mu[0,2], 436.00000000000045) # different from OpenCV results, bug in OpenCV assert_almost_equal(mu[0,3], -737.333333333333) @@ -198,7 +198,7 @@ def test_minor_axis_length(): def test_moments(): m = regionprops(SAMPLE, ['Moments'])[0]['Moments'] - #: determined with OpenCV + # determined with OpenCV assert_almost_equal(m[0,0], 72.0) assert_almost_equal(m[0,1], 408.0) assert_almost_equal(m[0,2], 2748.0) @@ -213,7 +213,7 @@ def test_moments(): def test_normalized_moments(): nu = regionprops(SAMPLE, ['NormalizedMoments'])[0]['NormalizedMoments'] - #: determined with OpenCV + # determined with OpenCV assert_almost_equal(nu[0,2], 0.08410493827160502) assert_almost_equal(nu[1,1], -0.016846707818929982) assert_almost_equal(nu[1,2], -0.002899800614433943) From cbcb31330604d56bb6b5f6fcb29e7f281dd16853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 6 Mar 2013 16:50:30 +0100 Subject: [PATCH 12/12] Update version to 0.8.1 --- bento.info | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bento.info b/bento.info index 71ef558e..518888e0 100644 --- a/bento.info +++ b/bento.info @@ -1,5 +1,5 @@ Name: scikit-image -Version: 0.9.dev0 +Version: 0.8.1 Summary: Image processing routines for SciPy Url: http://scikit-image.org DownloadUrl: http://github.com/scikit-image/scikit-image diff --git a/setup.py b/setup.py index d62a0d86..da93dadb 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ MAINTAINER_EMAIL = 'stefan@sun.ac.za' URL = 'http://scikit-image.org' LICENSE = 'Modified BSD' DOWNLOAD_URL = 'http://github.com/scikit-image/scikit-image' -VERSION = '0.9dev' +VERSION = '0.8.1' PYTHON_VERSION = (2, 5) DEPENDENCIES = { 'numpy': (1, 6),