Open fengzhi09 opened 6 years ago
read_region
is for reading relatively small regions that will fit into memory (probably image area < 2^32)
It's usually not possible to read the whole region into memory anyway. That's the point of OpenSlide
Maybe duplicate of https://github.com/openslide/openslide/issues/73
Context
Issue type (bug report or feature request): bug report Operating system (e.g. Fedora 24, Mac OS 10.11, Windows 10): Windows 10 Platform (e.g. 64-bit x86, 32-bit ARM): 64-bit x86 OpenSlide version: 1.1.1 Slide format (e.g. SVS, NDPI, MRXS): svs
Details
call like this: openslide.open_slide(svs_file) level = 1 dimension=slide.level_dimensions[level] // It broken many times. // Among all broken dimensions of all svs files, min is (25895,21005) max is (89639,51222) slide.read_region((0, 0), level, dimension)
stack_trace: File "D:\projects\cancer_ml_project\tools\SVS2PNGConverter.py", line 31, in convert_for_file imsave(out_folder + "/" + png_file, np.array(slide.read_region((0, 0), level, dimension))) File "D:\projects\cancer_ml_project\venv\lib\site-packages\openslide__init__.py", line 223, in read_region level, size[0], size[1]) File "D:\projects\cancer_ml_project\venv\lib\site-packages\openslide\lowlevel.py", line 258, in read_region buf = (w h c_uint32)() OverflowError: The 'length' attribute is too large