girder/large_image

Add some jupyter examples to the docs

Closed this issue · 1 comments

We probably want two sets of jupyter examples showing off some of the convenience functions, one without girder and one with.

The one without girder would show off some convenience methods:

!pip install large_image[sources] --find-links=https://girder.github.io/large_image_wheels
!curl "https://data.kitware.com/api/v1/file/5fdcf3dd2fa25629b99e0a9e/download" -o sample.svs
import large_image
ts = large_image.open('sample.svs')
ts
ts.metadata
ts.getThumbnail()[0]
large_image.tilesource.jupyter.IPyLeafletMixin.JUPYTER_PROXY = True
ts

And one with girder:

import girder_client, large_image, numpy as np, pickle
gc = girder_client.GirderClient(apiUrl='https://<server>/api/v1')
resource = '/collection/TCGA/single/TCGA-DX-A6BG-01Z-00-DX2.34763958-0613-4069-9ACC-13D6633FE415.svs'
itemId = gc.get('resource/lookup', parameters={'path': resource})['_id']
metadata = gc.get(f'item/{itemId}/tiles')
metadata
tileUrl = gc.urlBase + f'item/{itemId}/tiles' + '/zxy/{z}/{x}/{y}'
regionUrl = gc.urlBase + f'item/{itemId}/tiles/region?encoding=pickle'
thumbUrl = gc.urlBase + f'item/{itemId}/tiles/thumbnail?encoding=pickle'
pickle.loads(requests.get(thumbUrl).content)
# TODO: get thumbnail image, get actual region, show ipyleaflet layer

We can't use colab to render the first item fully, since the proxy doesn't work in colab.

Added in #1281.