You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[python api] openslide.read_region broke when svs too large #122
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
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
Activity
jxu commentedon Jul 5, 2019
read_regionis 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
jxu commentedon Jul 5, 2019
Maybe duplicate of openslide/openslide#73