register_ffd — MATCHREG intensityreg op

• 数据种类:image2d × image2d → table

• 调用: import fullseye as fs; fs.ledger.register_ffd(fixed, moving, grid_spacing=8, levels=None, max_iter=150, reg_weight=1.0, normalize=True, init_flow2d=None, membrane_weight=0.0, min_coarse_spacing=2.0)(要直接调用实现,import intensityreg; intensityreg.register_ffd(fixed, moving, grid_spacing=8, levels=None, max_iter=150, reg_weight=1.0, normalize=True, init_flow2d=None, membrane_weight=0.0, min_coarse_spacing=2.0);从台账取用则 opsmatchreg.get("register_ffd"))

• GPU:无(仅 CPU 参考实现)

用法

用三次 B 样条自由形变(FFD)将 moving 非刚性地对齐到 fixed。→ table(kind="registration")。

> 以下的详细说明为原文 —— 摘要与标题已翻译。

変形を grid_spacing px 間隔の制御格子の係数 C で表し(Rueckert et al. 1999)、場は分離可能な行列積 w = By C Bxᵀ(By・Bx は 3 次 B-spline の基底行列)。目的は mean((M(p + w) - F)²) + reg_weight · 曲げの罰(制御格子の 2 階差分の 2 乗和、∂²/∂y²・ ∂²/∂x²・2 ∂²/∂x∂y)、勾配は Byᵀ (2 r ∇M / N) Bx の解析式。最適化は numpy の L-BFGS を粗から細のピラミッドで(段を上がるたびに場を 2 倍して細かい基底へ最小二乗で写す)。

demons(deformreg.demons_register)との違い: demons は画素ごとの場をガウスでならす(自由度 2HW)、FFD は制御格子の自由度 2 · ny · nx しか持たず、格子より細かい変形は表せない代わりに、模様の無い所でも場が格子の補間で埋まる。どちらが良いかは被写体次第で、register_accuracy_map が同じ真値で両方を測れる。

Args:

fixed: 基準の 2-D 画像。

moving: 合わせる 2-D 画像(fixed と同じ形)。

grid_spacing: 制御点の間隔 [px] (全解像で)。

levels: ピラミッドの段数。None なら最も粗い段が 16 px 以上になる範囲で最大 3 段。

max_iter: 段ごとの L-BFGS の反復の上限。

reg_weight: 曲げの罰の重み(0 で無し)。罰は場の 2 階微分 [1/px] の 2 乗の制御点平均なので、

格子間隔を変えても効きが変わらない。

normalize: 2 枚とも平均 0・分散 1 にしてから比べる(明るさのアフィンな違いを消す。SSD のまま)。

init_flow2d: 初期の場((2,H,W)、出力と同じ向き)。None なら 0。

membrane_weight: 1 階微分の 2 乗(膜のエネルギー)の重み(既定 0 = Rueckert 1999 どおり曲げだけ)。

★曲げの罰は一様な傾き(伸び・剪断)を罰しないので、模様の無い所では場が真の振幅の数倍まで暴れうる(examples/poc_sheet_deformation_ffd.py の 6b 節: 余白で最大 34 px、真値 1.5 px)。

0.1 でそれが 3.6 px に収まる一方、模様のある所の本物の傾きも罰するので、滑らかな大きな場では

精度が落ちる(tests/test_intensityreg.py)。両立しないので既定は 0 のまま。

min_coarse_spacing: 粗い段での制御点の間隔の下限 [その段の px]。

Returns:

dict(kind="registration", method="ffd")。warp=None、flow2d (2,H,W) の (dy, dx)、

metric_name="rms_residual"(正規化後の残差の rms、罰を含まない)、grid_shape(制御格子)、

grid_spacing。他の鍵は register_ecc と同じ。

限界: 微分同相(折り返し無し)は保証しない。模様の無い所・1 方向にしか模様の無い所(縦縞では縦の成分)の場は罰と補間が決めた値で、データの裏付けは無い —— register_accuracy_map の by_texture で見える。

Raises:

ValueError: 画像が不正 / 形が違う / 引数が値域外 / init_flow2d の形が違うか非有限。

详细使用指南

• matching_registration 族使用指南

参考(示例数据、文献)

• 示例数据目录(下载 URL / 许可证) —— 2-D 用 skimage.data(BSD/公有领域)加合成图,3-D 给出真实数据源(Stanford/PDS 等)的下载 URL。

• 算子来历与参考文献 —— 该算子族所依据的研究/方法出处。

• 算法的正典(作者、年份)与用途见上面的族使用指南。

可运行的示例(实际调用该算子并已验证的样例)

• poc_sheet_deformation_ffd — py -3.11 examples/poc_sheet_deformation_ffd.py

类型可衔接的下一个算子(可接受 table 作为输入)

features_match · ransac_homography · ransac_fundamental · registration_to_flow2d

同类别(intensityreg)

register_ecc · register_mi · registration_to_flow2d · register_accuracy_map · register_capture_range


*Provenance: intensityreg.py — MATCHREG 算子登记表。本条目由 tools/opdocs.py md 自动生成(请勿手工编辑)。*

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