I used all of these commands to make sure I have everything that's needed for loading dpi pyramidal images on google collab with no luck so far.
!pip install large_image
!apt update && apt install -y openslide-tools
!pip install openslide-python
!pip install libtiff openslide_python pyvips gdal mapnik pyproj glymur -f https://girder.github.io/large_image_wheels
I get the following error:
---------------------------------------------------------------------------
TileSourceException Traceback (most recent call last)
<ipython-input-23-0584be72095d> in <module>()
27 print(os.listdir(ndpi_dir))
28 print(target_filename)
---> 29 ts = large_image.getTileSource(target_filename)
30
31 # print(ts.getMetadata())
1 frames
/usr/local/lib/python3.6/dist-packages/large_image/tilesource/__init__.py in getTileSourceFromDict(availableSources, pathOrUri, *args, **kwargs)
65 if availableSources[sourceName].canRead(sourceObj, *args, **kwargs):
66 return availableSources[sourceName](sourceObj, *args, **kwargs)
---> 67 raise TileSourceException('No available tilesource for %s' % pathOrUri)
68
69
TileSourceException: No available c for ndpi_images/Li88TDCLAMP.ndpi
I made sure the the file is there, it's loading okay in other platforms using the same command, so it's not the file.
How can I resolve this issue?
Thanks
It turns out that (at least today, maybe not when the original question was posted), that you can ask Google CoLab to proxy a port. With
large_image >= 1.23.5
, there are some convenience functions to help this. There is a sample notebook here: https://github.com/girder/large_image/blob/master/docs/large_image_examples.ipynbThe main method is, given a local file
sample.npdi
:Internally, there is a bunch of work to get a tile layer in pixel coordinates in iPyLeaflet (and, at least present, I've only figure out how to have the pixel coordinates bottom-up (y, x), not top-down (x,y) which is what you'd expect.