pherc0846a-lasagna / README.md
SharpMeow's picture
Card: stream the field by URL from the public bucket
91002c3 verified
|
Raw History Blame Contribute Delete
4.2 kB
metadata
license: cc-by-nc-4.0
tags:
  - vesuvius-challenge
  - herculaneum
  - ct
  - lasagna
  - ome-zarr
pretty_name: PHerc0846A lasagna field (villa predict3d)

PHerc0846A lasagna field

villa's lasagna predict3d output for the whole PHerc0846A scan, in villa's own layout, so you can point lasagna or the spiral fit at it without running the model yourself. The open data has no lasagna field for this scan.

cos and surface normals, a slice through the middle of the scroll

Get it

hf download SharpMeow/pherc0846a-lasagna --repo-type dataset --local-dir pherc0846a-lasagna
cd pherc0846a-lasagna && sha256sum -c SHA256SUMS
for f in parts/*.tar; do tar -xf "$f"; done
tar -xf PHerc0846A-lasagna-pyramid-fix.tar   # last: the joined PHerc0846A.lasagna.json

You end up with PHerc0846A.lasagna.json and PHerc0846A_{cos,grad_mag,nx,ny}.ome.zarr.

Load it

import numpy as np
import zarr

cos = zarr.open("PHerc0846A_cos.ome.zarr/1", mode="r")  # every 2nd scan voxel
nx = zarr.open("PHerc0846A_nx.ome.zarr/2", mode="r")    # every 4th scan voxel
ny = zarr.open("PHerc0846A_ny.ome.zarr/2", mode="r")
print("cos", cos.shape, "normals", nx.shape)

z, y, x = 512, 5911, 3863                              # a point in full-resolution scan voxels
patch = cos[z // 2, y // 2 - 256:y // 2 + 256, x // 2 - 256:x // 2 + 256]
a = (float(nx[z // 4, y // 4, x // 4]) - 128) / 127
b = (float(ny[z // 4, y // 4, x // 4]) - 128) / 127
print("cos patch", patch.shape, "mean", round(float(patch.mean()), 1))
print("normal", round(a, 3), round(b, 3), round(float(np.sqrt(max(0.0, 1 - a * a - b * b))), 3))

load_example.py is a runnable version of this snippet; it was run on the real parts before upload.

Stream it, no download

The same field, unpacked, is in the public bucket SharpMeow/lasagna-fields under PHerc0846A/representations/predictions/lasagna/20250728152254-lasagna-de45f011/, so any zarr reader can open it by URL:

import zarr   # zarr 3, with fsspec and aiohttp

base = "https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0846A/representations/predictions/lasagna/20250728152254-lasagna-de45f011"
cos = zarr.open_array(base + "/PHerc0846A_cos.ome.zarr/1", mode="r", zarr_format=2)

Region downloads, a Neuroglancer link and the methods for all ten fields are on the Lasagna Fields page.

What it is

  • Scan: PHerc0846A, 20250728152254-9.362um-1.2m-113keV-masked.zarr, level 0, Vesuvius Challenge open data (9.362 um)
  • Model: scrollprize/lasagna model_current.pt at revision de45f011 (sha256 4cc0c40a...)
  • Code: ScrollPrize/villa lasagna at db3dbea2, lasagna-preprocess predict3d --tile-size 192, default chunks and levels
  • Channels: cos at OME-Zarr level 1 (2x down); grad_mag, nx, ny at level 2 (4x down); each with its pyramid
  • Run: 17 parts on Hugging Face Jobs (RTX PRO 6000), one x, y, z box each. Every part edge sits on a multiple of 1,024 scan voxels, so every chunk of every level, level 4 included, was written by exactly one part, and the parts together are the whole field. A seam check on level 2 found no step at any part edge (worst ratio 1.11 against a 1.5 limit; 1.0 means no step).
  • Settings check: the same code and settings reproduce villa's published PHerc0343 lasagna field on a test crop (cos within 2 of 255 at every voxel compared).

Notes

Raw model output; nobody has checked it by eye. Regions the masked scan leaves empty are absent (fill 0). The model ran on the scan at its native resolution with no resampling.

Related

A center line (umbilicus) for PHerc0846A is in SharpMeow/vesuvius-center-lines. The same kind of field for PHerc0175A is in SharpMeow/pherc0175a-lasagna.

Credit and terms

The scan is Vesuvius Challenge open data, CC BY-NC 4.0; this derived field is shared under the same terms. Model and code are ScrollPrize/villa's lasagna, credit to its authors. Shared by Chase Hendrick.