openslide-python icon indicating copy to clipboard operation
openslide-python copied to clipboard

ValueError: Argument is not writable

Open tnnandi opened this issue 1 year ago • 3 comments

Operating system

Ubuntu

Platform

64 bit x86

OpenSlide Python version

1.3.1

OpenSlide version

4.0.0

Slide format

SVS

Issue details

Hi,

When I try to use the read_region function as follows: level = slide.get_best_level_for_downsample(32) region = slide.read_region((0, 0), level, slide.level_dimensions[level])

I get the following error: region = slide.read_region((0, 0), level, slide.level_dimensions[level]) *** ValueError: Argument is not writable

I'd appreciate it if you could suggest a solution.

Thanks

tnnandi avatar Feb 11 '24 02:02 tnnandi

I can't reproduce this behavior:

$ cat test.py 
import openslide
slide = openslide.OpenSlide('Aperio/CMU-1.svs')
level = slide.get_best_level_for_downsample(32)
region = slide.read_region((0, 0), level, slide.level_dimensions[level])
print(region)
$ python test.py 
<PIL.Image.Image image mode=RGBA size=2875x2057 at 0x7EFFF1440E00>

Can you provide any more details that would help reproduce it?

bgilbert avatar Feb 11 '24 06:02 bgilbert

Thanks for your input! I think the issue was tied to the pillow version. With Pillow 10.1.0, I was encountering another issue related to the ANTIALIAS attribute of PIL.image, and I had to downgrade the Pillow version to 9.5.0 to get around both.

tnnandi avatar Feb 11 '24 07:02 tnnandi

Hmm, okay. I've now tried with both Pillow 9.5.0 and 10.1.0 and still cannot reproduce this. Can you provide any more information, such as a full backtrace for the ValueError? How did you install OpenSlide and OpenSlide Python?

bgilbert avatar Feb 11 '24 07:02 bgilbert

Closing due to lack of response. If you're able to provide additional information that would help reproduce this, please feel free to post it here.

bgilbert avatar Sep 07 '24 04:09 bgilbert