Skip to content

Commit

Permalink
Add notebook (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
keller-mark authored Oct 2, 2024
1 parent b02d767 commit dc021eb
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions docs/notebooks/widget_segmentations_beta.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"nbsphinx": "hidden"
},
"source": [
"# Vitessce Widget Tutorial"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from vitessce import (\n",
" VitessceConfig,\n",
" Component as cm,\n",
" CoordinationType as ct,\n",
" OmeTiffWrapper,\n",
" MultiImageWrapper,\n",
" CoordinationLevel as CL,\n",
" ObsSegmentationsOmeTiffWrapper,\n",
" ImageOmeTiffWrapper,\n",
" get_initial_coordination_scope_prefix,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"vc = VitessceConfig(schema_version=\"1.0.16\")\n",
"dataset = vc.add_dataset(name='Spraggins').add_object(\n",
" ImageOmeTiffWrapper(\n",
" img_url=\"https://storage.googleapis.com/vitessce-demo-data/kpmp-f2f-march-2023/S-1905-017737/S-1905-017737_PAS_2of2_bf.ome.tif\",\n",
" offsets_url=\"https://storage.googleapis.com/vitessce-demo-data/kpmp-f2f-march-2023/S-1905-017737/S-1905-017737_PAS_2of2_bf.offsets.json\"\n",
" )\n",
").add_object(\n",
" ObsSegmentationsOmeTiffWrapper(\n",
" img_url=\"https://storage.googleapis.com/vitessce-demo-data/kpmp-f2f-march-2023/S-1905-017737/S-1905-017737_PAS_2of2.ome.tif\",\n",
" offsets_url=\"https://storage.googleapis.com/vitessce-demo-data/kpmp-f2f-march-2023/S-1905-017737/S-1905-017737_PAS_2of2.offsets.json\",\n",
" obs_types_from_channel_names=True\n",
" )\n",
")\n",
"\n",
"spatial = vc.add_view(\"spatialBeta\", dataset=dataset)\n",
"lc = vc.add_view(\"layerControllerBeta\", dataset=dataset)\n",
"\n",
"vc.link_views_by_dict([spatial, lc], {\n",
" \"imageLayer\": CL([\n",
" {\n",
" \"photometricInterpretation\": \"RGB\" \n",
" }\n",
" ]),\n",
"}, meta=True, scope_prefix=get_initial_coordination_scope_prefix(\"A\", \"image\"))\n",
"\n",
"vc.layout(spatial | lc);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"vw = vc.widget()\n",
"vw"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit dc021eb

Please sign in to comment.