Created
December 17, 2024 13:46
-
-
Save d-v-b/73dd5a7c01f10b5873b48fe99d35ad76 to your computer and use it in GitHub Desktop.
demo of panel-neuroglancer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "dc9888ce", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "# /// script\n", | |
| "# requires-python = \">=3.10\"\n", | |
| "# dependencies = [\n", | |
| "# \"panel-neuroglancer\",\n", | |
| "# ]\n", | |
| "# ///" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "5b7c37cb", | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "from panel_neuroglancer import Neuroglancer\n", | |
| "import neuroglancer\n", | |
| "import panel as pn\n", | |
| "pn.extension()\n", | |
| "\n", | |
| "viewer = neuroglancer.Viewer()\n", | |
| "\n", | |
| "with viewer.txn() as s:\n", | |
| " s.layers[\"em\"] = neuroglancer.ImageLayer(\n", | |
| " source=\"zarr://s3://janelia-cosem-datasets/jrc_mus-kidney-3/jrc_mus-kidney-3.zarr/recon-1/em/fibsem-uint8/\",\n", | |
| " )\n", | |
| " # Add a segmentation layer\n", | |
| " s.layers[\"segmentation\"] = neuroglancer.SegmentationLayer(\n", | |
| " source=\"zarr://s3://janelia-cosem-datasets/jrc_mus-kidney-3/jrc_mus-kidney-3.zarr/recon-1/labels/inference/segmentations/nuc/\",\n", | |
| " )\n", | |
| "Neuroglancer(source=viewer, show_state=True)" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": null, | |
| "id": "c20bb280-0ba0-4378-9119-f25e5ccd4bb8", | |
| "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.10.13" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 5 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment