--- license: cc-by-nc-4.0 tags: [vesuvius-challenge, herculaneum, ct, lasagna, ome-zarr] pretty_name: PHerc0490A lasagna field (villa predict3d) --- # PHerc0490A lasagna field villa's lasagna `predict3d` output for the whole PHerc0490A 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](preview-xy.png) ## Get it ```bash hf download SharpMeow/pherc0490a-lasagna --repo-type dataset --local-dir pherc0490a-lasagna cd pherc0490a-lasagna && sha256sum -c SHA256SUMS for f in parts/*.tar; do tar -xf "$f"; done tar -xf PHerc0490A-lasagna-pyramid-fix.tar # last: the joined PHerc0490A.lasagna.json ``` You end up with `PHerc0490A.lasagna.json` and `PHerc0490A_{cos,grad_mag,nx,ny}.ome.zarr`. ## Load it ```python import numpy as np import zarr cos = zarr.open("PHerc0490A_cos.ome.zarr/1", mode="r") # every 2nd scan voxel nx = zarr.open("PHerc0490A_nx.ome.zarr/2", mode="r") # every 4th scan voxel ny = zarr.open("PHerc0490A_ny.ome.zarr/2", mode="r") print("cos", cos.shape, "normals", nx.shape) z, y, x = 1536, 4550, 4550 # 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](https://huggingface.co/buckets/SharpMeow/lasagna-fields) under `PHerc0490A/representations/predictions/lasagna/20250521151210-lasagna-de45f011/`, so any zarr reader can open it by URL: ```python import zarr # zarr 3, with fsspec and aiohttp base = "https://huggingface.co/buckets/SharpMeow/lasagna-fields/resolve/PHerc0490A/representations/predictions/lasagna/20250521151210-lasagna-de45f011" cos = zarr.open_array(base + "/PHerc0490A_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](https://huggingface.co/spaces/SharpMeow/lasagna-fields) page. ## What it is - Scan: PHerc0490A, `20250521151210-8.640um-1.2m-116keV-masked.zarr`, level 0, Vesuvius Challenge open data (8.64 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: 25 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.18 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 PHerc0490A is in [SharpMeow/vesuvius-center-lines](https://huggingface.co/datasets/SharpMeow/vesuvius-center-lines). The same kind of field for PHerc0175A is in [SharpMeow/pherc0175a-lasagna](https://huggingface.co/datasets/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.