Add --resample so Hecate can read the 8.64 µm eligible volumes
Hecate refuses any render whose spacing is more than 2 % away from 9.6 µm, and the message says to resample first. Half of the
First Letters eligible volumes (11 of 22: 0175A, 0175B, 0268, 0306B, 0343, 0483A, 0483B, 0490A, 0490B, 0800, 1218) are 8.64 µm,
so on those you either can't run it, or you pass --spacing-um 9.6 and the model sees letters about 11 % bigger than in training.
This adds an opt-in --resample flag: the input stack is rescaled by spacing / 9.6 (linear interpolation) before inference, and
the prediction is mapped back to the input grid so it stays aligned with the segment. Without the flag nothing changes (the error
message now mentions the option). It's refused together with --output-3d. scipy is added to requirements.txt; it's only
imported when --resample is used.
What I measured, on the three PHerc0841 segments with papyrologist labels (official 9.366 µm renders, treated as if they were
8.64 µm scans):
- w00: declared 9.6 without resampling AUC 0.899 → with
--resample0.925 (reference at true spacing 0.931) - AG1: 0.769 → 0.781 (ref 0.782)
- AG2: 0.895 → 0.905 (ref 0.914)
Same direction on all three. Caveat: Hecate saw 0841 during training, so the absolute numbers are optimistic, but the gap between
the two runs is the point.
I know resampling by hand was already recommended; this just makes it one flag and checks that it actually helps.