scikit-image/scikit-image — pull request #453 by cgohlke (2013-03-05 01:44:52+00:00)
Title: Fix `ValueError: Buffer dtype mismatch` on win-amd64 

This fixes the following skimage 0.8 test failures on win-amd64:
```
======================================================================
ERROR: test_regionprops.test_all_props
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\skimage\measure\tests\test_regionprops.py", line 30, in test_all_props
props = regionprops(SAMPLE, 'all', INTENSITY_SAMPLE)[0]
File "X:\Python27-x64\lib\site-packages\skimage\measure\_regionprops.py", line 288, in regionprops
_convex_image = convex_hull_image(array)
File "X:\Python27-x64\lib\site-packages\skimage\morphology\convex_hull.py", line 36, in convex_hull_image
coords = possible_hull(image.astype(np.uint8))
File "_convex_hull.pyx", line 33, in skimage.morphology._convex_hull.possible_hull (skimage\morphology\_convex_hull.c:1201)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_regionprops.test_convex_area
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\skimage\measure\tests\test_regionprops.py", line 70, in test_convex_area
area = regionprops(SAMPLE, ['ConvexArea'])[0]['ConvexArea']
File "X:\Python27-x64\lib\site-packages\skimage\measure\_regionprops.py", line 288, in regionprops
_convex_image = convex_hull_image(array)
File "X:\Python27-x64\lib\site-packages\skimage\morphology\convex_hull.py", line 36, in convex_hull_image
coords = possible_hull(image.astype(np.uint8))
File "_convex_hull.pyx", line 33, in skimage.morphology._convex_hull.possible_hull (skimage\morphology\_convex_hull.c:1201)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_regionprops.test_convex_image
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\skimage\measure\tests\test_regionprops.py", line 76, in test_convex_image
img = regionprops(SAMPLE, ['ConvexImage'])[0]['ConvexImage']
File "X:\Python27-x64\lib\site-packages\skimage\measure\_regionprops.py", line 293, in regionprops
_convex_image = convex_hull_image(array)
File "X:\Python27-x64\lib\site-packages\skimage\morphology\convex_hull.py", line 36, in convex_hull_image
coords = possible_hull(image.astype(np.uint8))
File "_convex_hull.pyx", line 33, in skimage.morphology._convex_hull.possible_hull (skimage\morphology\_convex_hull.c:1201)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_regionprops.test_solidity
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\skimage\measure\tests\test_regionprops.py", line 256, in test_solidity
solidity = regionprops(SAMPLE, ['Solidity'])[0]['Solidity']
File "X:\Python27-x64\lib\site-packages\skimage\measure\_regionprops.py", line 365, in regionprops
_convex_image = convex_hull_image(array)
File "X:\Python27-x64\lib\site-packages\skimage\morphology\convex_hull.py", line 36, in convex_hull_image
coords = possible_hull(image.astype(np.uint8))
File "_convex_hull.pyx", line 33, in skimage.morphology._convex_hull.possible_hull (skimage\morphology\_convex_hull.c:1201)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_convex_hull.test_basic
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\numpy\testing\decorators.py", line 146, in skipper_func
return f(*args, **kwargs)
File "X:\Python27-x64\lib\site-packages\skimage\morphology\tests\test_convex_hull.py", line 32, in test_basic
assert_array_equal(convex_hull_image(image), expected)
File "X:\Python27-x64\lib\site-packages\skimage\morphology\convex_hull.py", line 36, in convex_hull_image
coords = possible_hull(image.astype(np.uint8))
File "_convex_hull.pyx", line 33, in skimage.morphology._convex_hull.possible_hull (skimage\morphology\_convex_hull.c:1201)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_convex_hull.test_possible_hull
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\numpy\testing\decorators.py", line 146, in skipper_func
return f(*args, **kwargs)
File "X:\Python27-x64\lib\site-packages\skimage\morphology\tests\test_convex_hull.py", line 65, in test_possible_hull
ph = possible_hull(image)
File "_convex_hull.pyx", line 33, in skimage.morphology._convex_hull.possible_hull (skimage\morphology\_convex_hull.c:1201)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_felzenszwalb.test_grey
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\skimage\segmentation\tests\test_felzenszwalb.py", line 13, in test_grey
seg = felzenszwalb(img, sigma=0)
File "X:\Python27-x64\lib\site-packages\skimage\segmentation\_felzenszwalb.py", line 49, in felzenszwalb
return _felzenszwalb_grey(image, scale=scale, sigma=sigma)
File "_felzenszwalb_cy.pyx", line 75, in skimage.segmentation._felzenszwalb_cy._felzenszwalb_grey (skimage\segmentation\_felzenszwalb_cy.c:2370)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_felzenszwalb.test_color
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\skimage\segmentation\tests\test_felzenszwalb.py", line 28, in test_color
seg = felzenszwalb(img, sigma=0)
File "X:\Python27-x64\lib\site-packages\skimage\segmentation\_felzenszwalb.py", line 66, in felzenszwalb
min_size=min_size)
File "_felzenszwalb_cy.pyx", line 75, in skimage.segmentation._felzenszwalb_cy._felzenszwalb_grey (skimage\segmentation\_felzenszwalb_cy.c:2370)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

======================================================================
ERROR: test_hough_transform.test_houghcircle
----------------------------------------------------------------------
Traceback (most recent call last):
File "X:\Python27-x64\lib\site-packages\nose\case.py", line 197, in runTest
self.test(*self.arg)
File "X:\Python27-x64\lib\site-packages\skimage\transform\tests\test_hough_transform.py", line 120, in test_houghcircle
out = tf.hough_circle(img, np.array([radius]))
File "X:\Python27-x64\lib\site-packages\skimage\transform\hough_transform.py", line 167, in hough_circle
return _hough_circle(img, radius, normalize)
File "_hough_transform.pyx", line 23, in skimage.transform._hough_transform._hough_circle (skimage\transform\_hough_transform.c:1572)
ValueError: Buffer dtype mismatch, expected 'intp_t' but got 'long'

```