# L12 Stack alignment and intensity audit

Status: first exploratory check ready for review. [Result page](../results/l12/), [measurements](../results/l12/registration.csv), and [script](l12_registration.py). Reproduce using the temporary CPU environment with `MPLCONFIGDIR=/tmp/mpl-diatom PYTHONDONTWRITEBYTECODE=1 /tmp/diatom-research-venv/bin/python research/l12_registration.py`.

Four selected 512 × 512 practice-field crops were read at every focal plane from the original TIFF. Their mean 8-bit intensities varied by less than one gray level within each crop's stack. This does not establish constant exposure or linear intensity scaling. OME metadata contains no per-plane entries in the 28 scans inventoried under L5. File names say `0.5um`, but the actual optical Z spacing and direction have not been independently verified.

Phase correlation was applied with a Hann window to each plane relative to plane 1 and to its immediate predecessor. A separate synthetic random-texture image shifted by (+5, −3) pixels was recovered as approximately (+5.007, −2.998) pixels, confirming coordinate convention for that test. Direct correlations against plane 1 gave very low responses and implausibly large shifts on distant planes. Adjacent-plane estimates generally had stronger responses, but focus variation can distort them too. The estimates are not independently verified stage displacement and should not be applied automatically to align stacks.

Next compare consecutive-plane registration using stable non-diatom landmarks and multi-plane tracking, quantify whether correction preserves valve details, and ask for acquisition settings before attempting physical phase reconstruction. Include local deformation and tile-stitch seams rather than assuming a single global shift.
