Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some jupyter examples to the docs #1274

Closed
manthey opened this issue Aug 24, 2023 · 1 comment
Closed

Add some jupyter examples to the docs #1274

manthey opened this issue Aug 24, 2023 · 1 comment

Comments

@manthey
Copy link
Member

manthey commented Aug 24, 2023

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.

@manthey
Copy link
Member Author

manthey commented Aug 30, 2023

Added in #1281.

@manthey manthey closed this as completed Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant