Spaces:
Running on Zero
Running on Zero
Connect your tool panel: the fields and scans by URL, snippets run 25 Oct 2026
Browse files- CONNECT.md +168 -0
- app.py +4 -0
- connect.html +119 -0
- connect.json +32 -0
CONNECT.md
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Connect your tool: Lasagna Fields
|
| 2 |
+
|
| 3 |
+
The ten whole-scan fields read straight from the public bucket by URL, logged out, with no download step; the scans they came from are open data. The page is also an API and an MCP server that makes a field for any box of any public scan.
|
| 4 |
+
|
| 5 |
+
Checked 2026-10-25. Generated from `connect.json` by `kit spaceconnect` in [ChaseHendrick/Scrolls](https://github.com/ChaseHendrick/Scrolls).
|
| 6 |
+
|
| 7 |
+
## A whole-scan field: PHerc0175A cos, level 1 (every 2nd scan voxel)
|
| 8 |
+
|
| 9 |
+
`https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr`
|
| 10 |
+
|
| 11 |
+
License: CC BY-NC 4.0 (derived from Vesuvius Challenge open data). Model output (villa lasagna at db3dbea2, scrollprize/lasagna at de45f011). grad_mag, nx and ny sit beside it, from level 2; PHerc0175A.lasagna.json in the same folder is villa's manifest. The other nine scans: replace the scan and run folder as listed on the Ten whole scans tab.
|
| 12 |
+
|
| 13 |
+
### Python (zarr) (tested 2026-10-24)
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
# pip install "zarr>=3" fsspec aiohttp
|
| 17 |
+
import zarr
|
| 18 |
+
|
| 19 |
+
root = zarr.open_group("https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr", mode="r") # OME-Zarr, zarr v2
|
| 20 |
+
a = root["1"] # level 0 is full resolution; level L is 2**L times coarser
|
| 21 |
+
print(a.shape, a.dtype, a.chunks)
|
| 22 |
+
block = a[3186:3250, 2900:2964, 2200:2264] # (z, y, x); reads only the chunks it touches
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
### villa's vesuvius package (tested 2026-10-24)
|
| 26 |
+
|
| 27 |
+
```python
|
| 28 |
+
# pip install "vesuvius[volume-only]"
|
| 29 |
+
from vesuvius import Volume
|
| 30 |
+
|
| 31 |
+
v = Volume(type="zarr", path="https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr/1") # one pyramid level
|
| 32 |
+
block = v[3186:3250, 2900:2964, 2200:2264]
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
### VC3D (from villa's source)
|
| 36 |
+
|
| 37 |
+
```text
|
| 38 |
+
In VC3D (villa's volume-cartographer), open or create a project, then
|
| 39 |
+
File > Attach Remote Zarr... and paste:
|
| 40 |
+
|
| 41 |
+
https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr
|
| 42 |
+
|
| 43 |
+
It accepts http, https and s3 OME-Zarr roots.
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
### neuroglancer (tested 2026-10-24)
|
| 47 |
+
|
| 48 |
+
```text
|
| 49 |
+
https://neuroglancer-demo.appspot.com/#!%7B%22layers%22%3A%5B%7B%22type%22%3A%22image%22%2C%22source%22%3A%22zarr%3A%2F%2Fhttps%3A%2F%2Fhuggingface.co%2Fbuckets%2FSharpMeow%2Flasagna-fields%2Fresolve%2FPHerc0175A%2Frepresentations%2Fpredictions%2Flasagna%2F20250521115057-lasagna-de45f011%2FPHerc0175A_cos.ome.zarr%2F%22%2C%22name%22%3A%22A%20whole-scan%20field%3A%20PHerc0175A%20cos%2C%20level%201%20%28every%202nd%20scan%20voxel%29%22%7D%5D%2C%22layout%22%3A%224panel%22%7D
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
### curl (tested 2026-10-24)
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
curl -s https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr/.zattrs # OME multiscales metadata
|
| 56 |
+
curl -s https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr/1/.zarray # one level: shape, chunks, dtype, codec
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
## X-ray CT that field came from, PHerc0175A 8.640 um
|
| 60 |
+
|
| 61 |
+
`https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr`
|
| 62 |
+
|
| 63 |
+
License: CC BY-NC 4.0 (Vesuvius Challenge open data). Read live from the open-data bucket, never copied here. The field's level 1 is the scan's level 1 grid.
|
| 64 |
+
|
| 65 |
+
### Python (zarr) (tested 2026-10-24)
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
# pip install "zarr>=3" fsspec aiohttp
|
| 69 |
+
import zarr
|
| 70 |
+
|
| 71 |
+
root = zarr.open_group("https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr", mode="r") # OME-Zarr, zarr v2
|
| 72 |
+
a = root["2"] # level 0 is full resolution; level L is 2**L times coarser
|
| 73 |
+
print(a.shape, a.dtype, a.chunks)
|
| 74 |
+
block = a[1593:1657, 1170:1234, 1170:1234] # (z, y, x); reads only the chunks it touches
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
### villa's vesuvius package (tested 2026-10-24)
|
| 78 |
+
|
| 79 |
+
```python
|
| 80 |
+
# pip install "vesuvius[volume-only]"
|
| 81 |
+
from vesuvius import Volume
|
| 82 |
+
|
| 83 |
+
v = Volume(type="zarr", path="https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr/2") # one pyramid level
|
| 84 |
+
block = v[1593:1657, 1170:1234, 1170:1234]
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
### VC3D (from villa's source)
|
| 88 |
+
|
| 89 |
+
```text
|
| 90 |
+
In VC3D (villa's volume-cartographer), open or create a project, then
|
| 91 |
+
File > Attach Remote Zarr... and paste:
|
| 92 |
+
|
| 93 |
+
https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr
|
| 94 |
+
|
| 95 |
+
It accepts http, https and s3 OME-Zarr roots.
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
### neuroglancer (tested 2026-10-24)
|
| 99 |
+
|
| 100 |
+
```text
|
| 101 |
+
https://neuroglancer-demo.appspot.com/#!%7B%22layers%22%3A%5B%7B%22type%22%3A%22image%22%2C%22source%22%3A%22zarr%3A%2F%2Fhttps%3A%2F%2Fvesuvius-challenge-open-data.s3.us-east-1.amazonaws.com%2FPHerc0175A%2Fvolumes%2F20250521115057-8.640um-1.2m-116keV-masked.zarr%2F%22%2C%22name%22%3A%22X-ray%20CT%20that%20field%20came%20from%2C%20PHerc0175A%208.640%20um%22%7D%5D%2C%22layout%22%3A%224panel%22%7D
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
### curl (tested 2026-10-24)
|
| 105 |
+
|
| 106 |
+
```bash
|
| 107 |
+
curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr/.zattrs # OME multiscales metadata
|
| 108 |
+
curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr/2/.zarray # one level: shape, chunks, dtype, codec
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
## Make a field for any box, from code or an agent
|
| 112 |
+
|
| 113 |
+
`https://huggingface.co/spaces/SharpMeow/lasagna-fields`
|
| 114 |
+
|
| 115 |
+
License: Code Apache 2.0; villa lasagna and its checkpoint MIT; scans and fields CC BY-NC 4.0. make_field (same arguments as plan_field) runs villa's lasagna on ZeroGPU and uses the caller's ZeroGPU time, so pass a Hugging Face token. Model output, not a reading.
|
| 116 |
+
|
| 117 |
+
### Python /list_models (tested 2026-10-24)
|
| 118 |
+
|
| 119 |
+
```python
|
| 120 |
+
# pip install gradio_client
|
| 121 |
+
from gradio_client import Client
|
| 122 |
+
|
| 123 |
+
client = Client("SharpMeow/lasagna-fields")
|
| 124 |
+
result = client.predict(api_name="/list_models")
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
### Python /example_points (tested 2026-10-24)
|
| 128 |
+
|
| 129 |
+
```python
|
| 130 |
+
# pip install gradio_client
|
| 131 |
+
from gradio_client import Client
|
| 132 |
+
|
| 133 |
+
client = Client("SharpMeow/lasagna-fields")
|
| 134 |
+
result = client.predict(api_name="/example_points")
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
### Python /plan_field (tested 2026-10-24)
|
| 138 |
+
|
| 139 |
+
```python
|
| 140 |
+
# pip install gradio_client
|
| 141 |
+
from gradio_client import Client
|
| 142 |
+
|
| 143 |
+
client = Client("SharpMeow/lasagna-fields")
|
| 144 |
+
result = client.predict(volume="20260930100252", z=39424, y=10752, x=13824, size=256, model="lasagna", api_name="/plan_field")
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
### curl /list_models (tested 2026-10-24)
|
| 148 |
+
|
| 149 |
+
```bash
|
| 150 |
+
URL=https://sharpmeow-lasagna-fields.hf.space
|
| 151 |
+
EVENT=$(curl -s -X POST $URL/gradio_api/call/list_models -H 'Content-Type: application/json' \
|
| 152 |
+
-d '{"data": []}' | python3 -c 'import json,sys; print(json.load(sys.stdin)["event_id"])')
|
| 153 |
+
curl -sN $URL/gradio_api/call/list_models/$EVENT
|
| 154 |
+
```
|
| 155 |
+
|
| 156 |
+
### MCP (Claude, Cursor and other agents) (tested 2026-10-24)
|
| 157 |
+
|
| 158 |
+
```json
|
| 159 |
+
{
|
| 160 |
+
"mcpServers": {
|
| 161 |
+
"lasagna-fields": {
|
| 162 |
+
"url": "https://sharpmeow-lasagna-fields.hf.space/gradio_api/mcp/sse"
|
| 163 |
+
}
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
|
| 167 |
+
Tool list: https://sharpmeow-lasagna-fields.hf.space/gradio_api/mcp/schema
|
| 168 |
+
```
|
app.py
CHANGED
|
@@ -32,6 +32,7 @@ WORK = Path(tempfile.gettempdir()) / "lasagna-fields-work"
|
|
| 32 |
OUT = Path(tempfile.gettempdir()) / "lasagna-fields-out"
|
| 33 |
GUIDE = HERE / "guide" / "index.html"
|
| 34 |
MEDIA = HERE / "media"
|
|
|
|
| 35 |
MAX_GPU_S = 240 # the longest call this Space asks ZeroGPU for (a 512 box asks about 150 s)
|
| 36 |
READY = threading.Event()
|
| 37 |
SETUP = {"error": None, "code": None, "checkpoint": None, "seconds": None}
|
|
@@ -648,6 +649,9 @@ def build_demo():
|
|
| 648 |
gr.Markdown(HOW_TO, elem_classes="lf-howto")
|
| 649 |
with gr.Tab("Agents and API", id="agents"):
|
| 650 |
gr.Markdown(AGENTS.format(host=host))
|
|
|
|
|
|
|
|
|
|
| 651 |
gr.HTML('<footer class="lf-credit">Made by <a href="https://github.com/ChaseHendrick">Chase Hendrick</a> 路 '
|
| 652 |
'model and code: <a href="https://github.com/ScrollPrize/villa">villa</a> lasagna (MIT) 路 scans: '
|
| 653 |
'<a href="https://scrollprize.org">Vesuvius Challenge</a> open data, CC BY-NC 4.0 路 '
|
|
|
|
| 32 |
OUT = Path(tempfile.gettempdir()) / "lasagna-fields-out"
|
| 33 |
GUIDE = HERE / "guide" / "index.html"
|
| 34 |
MEDIA = HERE / "media"
|
| 35 |
+
CONNECT_HTML = HERE / "connect.html"
|
| 36 |
MAX_GPU_S = 240 # the longest call this Space asks ZeroGPU for (a 512 box asks about 150 s)
|
| 37 |
READY = threading.Event()
|
| 38 |
SETUP = {"error": None, "code": None, "checkpoint": None, "seconds": None}
|
|
|
|
| 649 |
gr.Markdown(HOW_TO, elem_classes="lf-howto")
|
| 650 |
with gr.Tab("Agents and API", id="agents"):
|
| 651 |
gr.Markdown(AGENTS.format(host=host))
|
| 652 |
+
with gr.Accordion("Connect your tool: the fields and scans by URL", open=True):
|
| 653 |
+
# the data's URLs and ready snippets, made by python -m kit spaceconnect render from connect.json
|
| 654 |
+
gr.HTML(CONNECT_HTML.read_text() if CONNECT_HTML.exists() else "")
|
| 655 |
gr.HTML('<footer class="lf-credit">Made by <a href="https://github.com/ChaseHendrick">Chase Hendrick</a> 路 '
|
| 656 |
'model and code: <a href="https://github.com/ScrollPrize/villa">villa</a> lasagna (MIT) 路 scans: '
|
| 657 |
'<a href="https://scrollprize.org">Vesuvius Challenge</a> open data, CC BY-NC 4.0 路 '
|
connect.html
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<section class="scc" id="connect" aria-label="Connect your tool"><style>.scc{--a:var(--scc-accent,#4ea8de);color:inherit;font:inherit;line-height:1.5;max-width:60rem}
|
| 2 |
+
.scc h2{font-size:1.15em;margin:.2em 0 .3em}.scc h3{font-size:1em;margin:0 0 .2em}
|
| 3 |
+
.scc p{margin:.3em 0}.scc a{color:var(--a)}
|
| 4 |
+
.scc .scc-src{border:1px solid color-mix(in srgb,currentColor 18%,transparent);border-radius:10px;padding:.7em .9em;margin:.7em 0;background:color-mix(in srgb,currentColor 4%,transparent)}
|
| 5 |
+
.scc .scc-meta{font-size:.85em;opacity:.8}
|
| 6 |
+
.scc details{border-top:1px solid color-mix(in srgb,currentColor 12%,transparent);padding:.35em 0}
|
| 7 |
+
.scc summary{cursor:pointer;font-weight:600;list-style-position:inside}
|
| 8 |
+
.scc .scc-b{font-weight:400;font-size:.75em;padding:.05em .5em;border-radius:99px;margin-left:.5em;border:1px solid currentColor;opacity:.75;white-space:nowrap}
|
| 9 |
+
.scc .scc-b.ok{color:#3fb37f}.scc .scc-b.src{color:var(--a)}.scc .scc-b.warn{color:#e0a030}
|
| 10 |
+
.scc .scc-code{position:relative;margin:.4em 0 .2em}
|
| 11 |
+
.scc pre{margin:0;padding:.7em .8em;border-radius:8px;overflow:auto;font-size:.82em;background:color-mix(in srgb,currentColor 9%,transparent);white-space:pre}
|
| 12 |
+
.scc code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
| 13 |
+
.scc button.scc-copy{all:unset;box-sizing:border-box;position:absolute;top:.35em;right:.35em;font-size:.75em;line-height:1.4;padding:.1em .6em;border-radius:6px;border:1px solid color-mix(in srgb,currentColor 30%,transparent);background:color-mix(in srgb,currentColor 8%,transparent);color:inherit;cursor:pointer}
|
| 14 |
+
.scc button.scc-copy:hover{border-color:var(--a)}
|
| 15 |
+
.scc .scc-url{position:relative}.scc .scc-url pre{padding-right:4.5em;white-space:pre-wrap;word-break:break-all}
|
| 16 |
+
.scc .scc-go{display:inline-block;margin:.3em 0;padding:.25em .8em;border-radius:6px;border:1px solid var(--a);text-decoration:none}
|
| 17 |
+
.scc footer{font-size:.8em;opacity:.75;margin-top:.6em}</style>
|
| 18 |
+
<h2>Connect your tool</h2>
|
| 19 |
+
<p>The ten whole-scan fields read straight from the public bucket by URL, logged out, with no download step; the scans they came from are open data. The page is also an API and an MCP server that makes a field for any box of any public scan.</p>
|
| 20 |
+
<div class="scc-src" id="connect-field"><h3>A whole-scan field: PHerc0175A cos, level 1 (every 2nd scan voxel)</h3>
|
| 21 |
+
<p class="scc-meta">CC BY-NC 4.0 (derived from Vesuvius Challenge open data) 路 Model output (villa lasagna at db3dbea2, scrollprize/lasagna at de45f011). grad_mag, nx and ny sit beside it, from level 2; PHerc0175A.lasagna.json in the same folder is villa's manifest. The other nine scans: replace the scan and run folder as listed on the Ten whole scans tab.</p>
|
| 22 |
+
<div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr</code></pre></div>
|
| 23 |
+
<details><summary>Python (zarr)<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 24 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "zarr>=3" fsspec aiohttp
|
| 25 |
+
import zarr
|
| 26 |
+
|
| 27 |
+
root = zarr.open_group("https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr", mode="r") # OME-Zarr, zarr v2
|
| 28 |
+
a = root["1"] # level 0 is full resolution; level L is 2**L times coarser
|
| 29 |
+
print(a.shape, a.dtype, a.chunks)
|
| 30 |
+
block = a[3186:3250, 2900:2964, 2200:2264] # (z, y, x); reads only the chunks it touches</code></pre></div></details>
|
| 31 |
+
<details><summary>villa's vesuvius package<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 32 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "vesuvius[volume-only]"
|
| 33 |
+
from vesuvius import Volume
|
| 34 |
+
|
| 35 |
+
v = Volume(type="zarr", path="https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr/1") # one pyramid level
|
| 36 |
+
block = v[3186:3250, 2900:2964, 2200:2264]</code></pre></div></details>
|
| 37 |
+
<details><summary>VC3D<span class="scc-b src">from villa's source</span></summary>
|
| 38 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>In VC3D (villa's volume-cartographer), open or create a project, then
|
| 39 |
+
File > Attach Remote Zarr... and paste:
|
| 40 |
+
|
| 41 |
+
https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr
|
| 42 |
+
|
| 43 |
+
It accepts http, https and s3 OME-Zarr roots.</code></pre></div></details>
|
| 44 |
+
<details><summary>neuroglancer<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 45 |
+
<a class="scc-go" href="https://neuroglancer-demo.appspot.com/#!%7B%22layers%22%3A%5B%7B%22type%22%3A%22image%22%2C%22source%22%3A%22zarr%3A%2F%2Fhttps%3A%2F%2Fhuggingface.co%2Fbuckets%2FSharpMeow%2Flasagna-fields%2Fresolve%2FPHerc0175A%2Frepresentations%2Fpredictions%2Flasagna%2F20250521115057-lasagna-de45f011%2FPHerc0175A_cos.ome.zarr%2F%22%2C%22name%22%3A%22A%20whole-scan%20field%3A%20PHerc0175A%20cos%2C%20level%201%20%28every%202nd%20scan%20voxel%29%22%7D%5D%2C%22layout%22%3A%224panel%22%7D" target="_blank" rel="noopener">Open in neuroglancer</a>
|
| 46 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://neuroglancer-demo.appspot.com/#!%7B%22layers%22%3A%5B%7B%22type%22%3A%22image%22%2C%22source%22%3A%22zarr%3A%2F%2Fhttps%3A%2F%2Fhuggingface.co%2Fbuckets%2FSharpMeow%2Flasagna-fields%2Fresolve%2FPHerc0175A%2Frepresentations%2Fpredictions%2Flasagna%2F20250521115057-lasagna-de45f011%2FPHerc0175A_cos.ome.zarr%2F%22%2C%22name%22%3A%22A%20whole-scan%20field%3A%20PHerc0175A%20cos%2C%20level%201%20%28every%202nd%20scan%20voxel%29%22%7D%5D%2C%22layout%22%3A%224panel%22%7D</code></pre></div></details>
|
| 47 |
+
<details><summary>curl<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 48 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>curl -s https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr/.zattrs # OME multiscales metadata
|
| 49 |
+
curl -s https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr/1/.zarray # one level: shape, chunks, dtype, codec</code></pre></div></details>
|
| 50 |
+
</div>
|
| 51 |
+
<div class="scc-src" id="connect-ct"><h3>X-ray CT that field came from, PHerc0175A 8.640 um</h3>
|
| 52 |
+
<p class="scc-meta">CC BY-NC 4.0 (Vesuvius Challenge open data) 路 Read live from the open-data bucket, never copied here. The field's level 1 is the scan's level 1 grid. 路 <a href="https://scrollprize.org/data_browser/PHerc0175A" target="_blank" rel="noopener">browse</a></p>
|
| 53 |
+
<div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr</code></pre></div>
|
| 54 |
+
<details><summary>Python (zarr)<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 55 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "zarr>=3" fsspec aiohttp
|
| 56 |
+
import zarr
|
| 57 |
+
|
| 58 |
+
root = zarr.open_group("https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr", mode="r") # OME-Zarr, zarr v2
|
| 59 |
+
a = root["2"] # level 0 is full resolution; level L is 2**L times coarser
|
| 60 |
+
print(a.shape, a.dtype, a.chunks)
|
| 61 |
+
block = a[1593:1657, 1170:1234, 1170:1234] # (z, y, x); reads only the chunks it touches</code></pre></div></details>
|
| 62 |
+
<details><summary>villa's vesuvius package<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 63 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install "vesuvius[volume-only]"
|
| 64 |
+
from vesuvius import Volume
|
| 65 |
+
|
| 66 |
+
v = Volume(type="zarr", path="https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr/2") # one pyramid level
|
| 67 |
+
block = v[1593:1657, 1170:1234, 1170:1234]</code></pre></div></details>
|
| 68 |
+
<details><summary>VC3D<span class="scc-b src">from villa's source</span></summary>
|
| 69 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>In VC3D (villa's volume-cartographer), open or create a project, then
|
| 70 |
+
File > Attach Remote Zarr... and paste:
|
| 71 |
+
|
| 72 |
+
https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr
|
| 73 |
+
|
| 74 |
+
It accepts http, https and s3 OME-Zarr roots.</code></pre></div></details>
|
| 75 |
+
<details><summary>neuroglancer<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 76 |
+
<a class="scc-go" href="https://neuroglancer-demo.appspot.com/#!%7B%22layers%22%3A%5B%7B%22type%22%3A%22image%22%2C%22source%22%3A%22zarr%3A%2F%2Fhttps%3A%2F%2Fvesuvius-challenge-open-data.s3.us-east-1.amazonaws.com%2FPHerc0175A%2Fvolumes%2F20250521115057-8.640um-1.2m-116keV-masked.zarr%2F%22%2C%22name%22%3A%22X-ray%20CT%20that%20field%20came%20from%2C%20PHerc0175A%208.640%20um%22%7D%5D%2C%22layout%22%3A%224panel%22%7D" target="_blank" rel="noopener">Open in neuroglancer</a>
|
| 77 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://neuroglancer-demo.appspot.com/#!%7B%22layers%22%3A%5B%7B%22type%22%3A%22image%22%2C%22source%22%3A%22zarr%3A%2F%2Fhttps%3A%2F%2Fvesuvius-challenge-open-data.s3.us-east-1.amazonaws.com%2FPHerc0175A%2Fvolumes%2F20250521115057-8.640um-1.2m-116keV-masked.zarr%2F%22%2C%22name%22%3A%22X-ray%20CT%20that%20field%20came%20from%2C%20PHerc0175A%208.640%20um%22%7D%5D%2C%22layout%22%3A%224panel%22%7D</code></pre></div></details>
|
| 78 |
+
<details><summary>curl<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 79 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr/.zattrs # OME multiscales metadata
|
| 80 |
+
curl -s https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr/2/.zarray # one level: shape, chunks, dtype, codec</code></pre></div></details>
|
| 81 |
+
</div>
|
| 82 |
+
<div class="scc-src" id="connect-api"><h3>Make a field for any box, from code or an agent</h3>
|
| 83 |
+
<p class="scc-meta">Code Apache 2.0; villa lasagna and its checkpoint MIT; scans and fields CC BY-NC 4.0 路 make_field (same arguments as plan_field) runs villa's lasagna on ZeroGPU and uses the caller's ZeroGPU time, so pass a Hugging Face token. Model output, not a reading.</p>
|
| 84 |
+
<div class="scc-url"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>https://huggingface.co/spaces/SharpMeow/lasagna-fields</code></pre></div>
|
| 85 |
+
<details><summary>Python /list_models<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 86 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install gradio_client
|
| 87 |
+
from gradio_client import Client
|
| 88 |
+
|
| 89 |
+
client = Client("SharpMeow/lasagna-fields")
|
| 90 |
+
result = client.predict(api_name="/list_models")</code></pre></div></details>
|
| 91 |
+
<details><summary>Python /example_points<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 92 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install gradio_client
|
| 93 |
+
from gradio_client import Client
|
| 94 |
+
|
| 95 |
+
client = Client("SharpMeow/lasagna-fields")
|
| 96 |
+
result = client.predict(api_name="/example_points")</code></pre></div></details>
|
| 97 |
+
<details><summary>Python /plan_field<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 98 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code># pip install gradio_client
|
| 99 |
+
from gradio_client import Client
|
| 100 |
+
|
| 101 |
+
client = Client("SharpMeow/lasagna-fields")
|
| 102 |
+
result = client.predict(volume="20260930100252", z=39424, y=10752, x=13824, size=256, model="lasagna", api_name="/plan_field")</code></pre></div></details>
|
| 103 |
+
<details><summary>curl /list_models<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 104 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>URL=https://sharpmeow-lasagna-fields.hf.space
|
| 105 |
+
EVENT=$(curl -s -X POST $URL/gradio_api/call/list_models -H 'Content-Type: application/json' \
|
| 106 |
+
-d '{"data": []}' | python3 -c 'import json,sys; print(json.load(sys.stdin)["event_id"])')
|
| 107 |
+
curl -sN $URL/gradio_api/call/list_models/$EVENT</code></pre></div></details>
|
| 108 |
+
<details><summary>MCP (Claude, Cursor and other agents)<span class="scc-b ok">tested 2026-10-24</span></summary>
|
| 109 |
+
<div class="scc-code"><button type="button" class="scc-copy" data-testid="connect-copy" onclick="navigator.clipboard&&navigator.clipboard.writeText(this.parentNode.querySelector('code').innerText).then(()=>{this.textContent='Copied';setTimeout(()=>this.textContent='Copy',1200)})">Copy</button><pre><code>{
|
| 110 |
+
"mcpServers": {
|
| 111 |
+
"lasagna-fields": {
|
| 112 |
+
"url": "https://sharpmeow-lasagna-fields.hf.space/gradio_api/mcp/sse"
|
| 113 |
+
}
|
| 114 |
+
}
|
| 115 |
+
}
|
| 116 |
+
|
| 117 |
+
Tool list: https://sharpmeow-lasagna-fields.hf.space/gradio_api/mcp/schema</code></pre></div></details>
|
| 118 |
+
</div>
|
| 119 |
+
<footer>Machine-readable: <a href="https://huggingface.co/spaces/SharpMeow/lasagna-fields/blob/main/connect.json" target="_blank" rel="noopener">connect.json</a> and <a href="https://huggingface.co/spaces/SharpMeow/lasagna-fields/blob/main/CONNECT.md" target="_blank" rel="noopener">CONNECT.md</a>. Checked 2026-10-25. "Tested" means the snippet ran against this public data on that date. Scan data keeps its own license (the Vesuvius Challenge open data is CC BY-NC 4.0).</footer></section>
|
connect.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema": "space-connect/1",
|
| 3 |
+
"space": "SharpMeow/lasagna-fields",
|
| 4 |
+
"title": "Lasagna Fields",
|
| 5 |
+
"checked": "2026-10-25",
|
| 6 |
+
"intro": "The ten whole-scan fields read straight from the public bucket by URL, logged out, with no download step; the scans they came from are open data. The page is also an API and an MCP server that makes a field for any box of any public scan.",
|
| 7 |
+
"sources": [
|
| 8 |
+
{"id": "field", "title": "A whole-scan field: PHerc0175A cos, level 1 (every 2nd scan voxel)", "kind": "ome-zarr",
|
| 9 |
+
"url": "https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0175A/representations/predictions/lasagna/20250521115057-lasagna-de45f011/PHerc0175A_cos.ome.zarr",
|
| 10 |
+
"zarr_format": 2, "example": {"level": "1", "start": [3186, 2900, 2200]},
|
| 11 |
+
"license": "CC BY-NC 4.0 (derived from Vesuvius Challenge open data)",
|
| 12 |
+
"note": "Model output (villa lasagna at db3dbea2, scrollprize/lasagna at de45f011). grad_mag, nx and ny sit beside it, from level 2; PHerc0175A.lasagna.json in the same folder is villa's manifest. The other nine scans: replace the scan and run folder as listed on the Ten whole scans tab."},
|
| 13 |
+
{"id": "ct", "title": "X-ray CT that field came from, PHerc0175A 8.640 um", "kind": "ome-zarr",
|
| 14 |
+
"url": "https://vesuvius-challenge-open-data.s3.us-east-1.amazonaws.com/PHerc0175A/volumes/20250521115057-8.640um-1.2m-116keV-masked.zarr",
|
| 15 |
+
"zarr_format": 2, "example": {"level": "2", "start": [1593, 1170, 1170]},
|
| 16 |
+
"license": "CC BY-NC 4.0 (Vesuvius Challenge open data)",
|
| 17 |
+
"note": "Read live from the open-data bucket, never copied here. The field's level 1 is the scan's level 1 grid.",
|
| 18 |
+
"browse": "https://scrollprize.org/data_browser/PHerc0175A"},
|
| 19 |
+
{"id": "api", "title": "Make a field for any box, from code or an agent", "kind": "gradio-api",
|
| 20 |
+
"url": "https://huggingface.co/spaces/SharpMeow/lasagna-fields",
|
| 21 |
+
"space": "SharpMeow/lasagna-fields",
|
| 22 |
+
"host": "https://sharpmeow-lasagna-fields.hf.space",
|
| 23 |
+
"status": "running",
|
| 24 |
+
"endpoints": [
|
| 25 |
+
{"api": "/list_models", "args": {}},
|
| 26 |
+
{"api": "/example_points", "args": {}},
|
| 27 |
+
{"api": "/plan_field", "args": {"volume": "20260930100252", "z": 39424, "y": 10752, "x": 13824, "size": 256, "model": "lasagna"}}
|
| 28 |
+
],
|
| 29 |
+
"license": "Code Apache 2.0; villa lasagna and its checkpoint MIT; scans and fields CC BY-NC 4.0",
|
| 30 |
+
"note": "make_field (same arguments as plan_field) runs villa's lasagna on ZeroGPU and uses the caller's ZeroGPU time, so pass a Hugging Face token. Model output, not a reading."}
|
| 31 |
+
]
|
| 32 |
+
}
|