R: Problem with OpenSlide Python

Francesco Daneluzzi fdane at live.it
Tue Nov 7 16:56:26 EST 2017


I solved by running OpenSlide on Python 2.7 instead of 3.5. The same code now works and w and h are float. I don’t know if this can help you. I post you my configuration:
- Anaconda Python 5.0.1 with 2.7 env (previously 3.5)
- Windows 10 Edu (x64)
- OpenSlide 1.1.1 installed from whl



However, thanks for the answer.

Kind regards,
Francesco



________________________________
Da: Benjamin Gilbert <bgilbert at cs.cmu.edu>
Inviato: Tuesday, November 7, 2017 9:14:03 PM
A: openslide-users at lists.andrew.cmu.edu
Cc: Francesco Daneluzzi
Oggetto: Re: Problem with OpenSlide Python

On Mon, Nov 06, 2017 at 12:08:04PM +0000, Francesco Daneluzzi wrote:
>   File "C:\Users\Francesco\Anaconda3\envs\py35\lib\site-packages\openslide\lowlevel.py", line 260, in read_region
>     buf = (w * h * float(c_uint32))()
> TypeError: float() argument must be a string or a number, not '_ctypes.PyCSimpleType'
>
> The fact is that, in the last row, w and h are float (I printed them for
> debugging), but c_uint32 is not and I am getting that error.  What should
> I do about it?

Hi Francesco,

Are you using a modified version of OpenSlide Python?  Upstream OpenSlide
Python 1.1.1 doesn't have that float conversion:

    https://github.com/openslide/openslide-python/blob/v1.1.1/openslide/lowlevel.py#L258

Note that w and h must be int, not float.

--Benjamin Gilbert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/openslide-users/attachments/20171107/483069ed/attachment.html>


More information about the openslide-users mailing list