varmodel_score — SPC variation op

• データ種: image2d × table → table

• 呼び出し: import fullseye as fs; fs.ledger.varmodel_score(image, model, mask=None, align='check') (実装を直接呼ぶなら import varmodel; varmodel.varmodel_score(image, model, mask=None, align='check')、台帳から引くなら opsspc.get("varmodel_score"))

使い方

1 枚を varmodel_fit の模型に当てる: 何 σ 外れたかの z 図・帯の外の図・領域ごとの説明(table)。

> 以下の詳細説明は原文のままです —— 要約と見出しは訳出済み。

z = (image - center) / spread on valid pixels (0 elsewhere); a pixel is out of band when |z| > k. Out-of-band pixels are grouped into 8-connected regions; each region reports area, peak_z (signed, the largest |z|), mean_abs_z, polarity (bright / dark / mixed), centroid (row, col), bbox (r0, c0, r1, c1, exclusive end) and peak_pos; regions are sorted by |peak_z| (rounded to 1e-9, ties by label order). Also returns z, exceed, valid (scored pixels, image grid), n_exceed, n_valid, k, far, expected_false = far * n_valid and count_pvalue = P(Binomial(n_valid, far) >= n_exceed) — that p-value assumes independent pixels and is optimistic for spatially correlated noise (reported, not used to decide).

Alignment: the image's translation against the model centre is measured as in varmodel_alignment and returned as offset. align="check" REFUSES an image displaced by more than the model's max_misalign_px; align="translate" registers it to the model by a Fourier shift, computes z in model coordinates and maps z / exceed back onto the image grid by the rounded offset (the wrapped border is invalid), so the maps line up with masks drawn on the original image. mask is on the image grid.

Raises ValueError when image is empty / not 2-D / non-finite, its shape differs from the model, model lacks the fitted keys, mask has the wrong shape, align is unknown, or the image is misaligned (check) / displaced by more than a quarter of the image (translate).

参考(サンプルデータ・文献)

• サンプルデータ カタログ(DL URL / ライセンス) — 2-D は skimage.data(BSD/public)+ 合成、3-D は実データ源(Stanford/PDS 等)の DL URL。

• 演算子の来歴・参考文献 — この op 族の元になった研究/手法の出典。

• アルゴリズムの正典(著者・年)と用途は上記ファミリ使い方ガイドに記載。

実行できる例(この op を実際に呼ぶ検証済みサンプル)

• poc_good_sample_variation_model — py -3.11 examples/poc_good_sample_variation_model.py

• poc_patch_anomaly — py -3.11 examples/poc_patch_anomaly.py

型が繋がる次の op(table を入力に取れる)

msa_anova_table · msa_gauge_rr · msa_bias_linearity · msa_attribute_agreement · gum_standard_uncertainty · gum_propagate · gum_expanded · gum_monte_carlo

同カテゴリ(variation)

varmodel_alignment · varmodel_band_k · varmodel_fit · varmodel_calibrate


*Provenance: varmodel.py — SPC operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.