diff --git a/RELEASE.txt b/RELEASE.txt index e42d1c85..1131a91a 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -49,8 +49,16 @@ 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 + - scipy-user@scipy.org + - scikit-learn-general@lists.sourceforge.net + - pythonvision@googlegroups.com + + Debian ------ diff --git a/bento.info b/bento.info index 10ee84f2..518888e0 100644 --- a/bento.info +++ b/bento.info @@ -1,5 +1,5 @@ Name: scikit-image -Version: 0.8.0 +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 22971ba7..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.8.0' +VERSION = '0.8.1' PYTHON_VERSION = (2, 5) DEPENDENCIES = { 'numpy': (1, 6), diff --git a/skimage/draw/_draw.pyx b/skimage/draw/_draw.pyx index 8a2572c4..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() @@ -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): @@ -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() @@ -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): @@ -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, @@ -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): diff --git a/skimage/filter/_ctmf.pyx b/skimage/filter/_ctmf.pyx index 1a03ff5a..302ab4c6 100644 --- a/skimage/filter/_ctmf.pyx +++ b/skimage/filter/_ctmf.pyx @@ -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..b1d070fc 100644 --- a/skimage/filter/setup.py +++ b/skimage/filter/setup.py @@ -26,7 +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'], - include_dirs=[get_numpy_include_dirs()]) + 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'], 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) 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): 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 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):