--- license: cc-by-nc-4.0 tags: [vesuvius-challenge, herculaneum, ct, lasagna, ome-zarr] pretty_name: PHercMANBp lasagna field (villa predict3d) --- # PHercMANBp lasagna field villa's lasagna `predict3d` output for the whole PHercMANBp 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/phercmanbp-lasagna --repo-type dataset --local-dir phercmanbp-lasagna cd phercmanbp-lasagna && sha256sum -c SHA256SUMS for f in parts/*.tar; do tar -xf "$f"; done tar -xf PHercMANBp-lasagna-pyramid-fix.tar # last: the joined PHercMANBp.lasagna.json ``` You end up with `PHercMANBp.lasagna.json` and `PHercMANBp_{cos,grad_mag,nx,ny}.ome.zarr`, 375 MB in all. ## Load it Here the scan is level 2 of the 2.399 um volume (9.60 um voxels), as villa reads its fine scans; every coordinate below is in that grid. ```python import numpy as np import zarr cos = zarr.open("PHercMANBp_cos.ome.zarr/1", mode="r") # every 2nd scan voxel nx = zarr.open("PHercMANBp_nx.ome.zarr/2", mode="r") # every 4th scan voxel ny = zarr.open("PHercMANBp_ny.ome.zarr/2", mode="r") print("cos", cos.shape, "normals", nx.shape) z, y, x = 1536, 1572, 1572 # 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 this snippet; it was run on the real parts before upload. ## What it is - Scan: PHercMANBp, `20251216152116-2.399um-0.2m-78keV-masked.zarr`, level 2, Vesuvius Challenge open data - 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: 5 parts on Hugging Face Jobs (RTX PRO 6000), one 1,024-slice slab 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 across every part edge found no step (worst ratio 1.203 against a 1.5 limit). - 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). - Previews: xy at z 2,144 and xz at y 1,572 (scan voxels of the level read). ![the same field from the side](preview-xz.png) ## 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 the level named above with no resampling. ## Related villa lasagna fields for ten more scans are on the [Lasagna Fields](https://huggingface.co/spaces/SharpMeow/lasagna-fields) page. ## 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.