pherc0343p-lasagna / README.md
SharpMeow's picture
Remove outdated unchecked-by-eye wording at owner request
edeaaad verified
|
Raw History Blame Contribute Delete
3.49 kB
---
license: cc-by-nc-4.0
tags: [vesuvius-challenge, herculaneum, ct, lasagna, ome-zarr]
pretty_name: PHerc0343P lasagna field (villa predict3d)
---
# PHerc0343P lasagna field
villa's lasagna `predict3d` output for the whole PHerc0343P 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/pherc0343p-lasagna --repo-type dataset --local-dir pherc0343p-lasagna
cd pherc0343p-lasagna && sha256sum -c SHA256SUMS
for f in parts/*.tar; do tar -xf "$f"; done
tar -xf PHerc0343P-lasagna-pyramid-fix.tar # last: the joined PHerc0343P.lasagna.json
```
You end up with `PHerc0343P.lasagna.json` and `PHerc0343P_{cos,grad_mag,nx,ny}.ome.zarr`, 1.8 GB in all.
## Load it
Here the scan is level 2 of the 2.215 um volume (8.86 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("PHerc0343P_cos.ome.zarr/1", mode="r") # every 2nd scan voxel
nx = zarr.open("PHerc0343P_nx.ome.zarr/2", mode="r") # every 4th scan voxel
ny = zarr.open("PHerc0343P_ny.ome.zarr/2", mode="r")
print("cos", cos.shape, "normals", nx.shape)
z, y, x = 1536, 1644, 1644 # 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: PHerc0343P, `20260304131111-2.215um-0.4m-111keV-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: 6 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.101 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,588 and xz at y 1,644 (scan voxels of the level read).
![the same field from the side](preview-xz.png)
## Notes
Raw model output. 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.