Add neck-based CT prealignment before VoxelMorph

This commit is contained in:
admin
2026-06-03 10:58:12 +08:00
parent 0a6a0ece00
commit 3d96bdb706
8 changed files with 665 additions and 266 deletions

View File

@@ -53,9 +53,9 @@ def ensure_multiple_of_16(shape: Sequence[int]) -> Tuple[int, int, int]:
shape = tuple(int(v) for v in shape)
if len(shape) != 3:
raise ValueError("target_shape 必须包含 3 个维度。")
bad = [v for v in shape if v <= 0 or v % 16 != 0]
bad = [v for v in shape if v <= 0 or v % 32 != 0]
if bad:
raise ValueError(f"VoxelMorph 建议三维尺寸均为 16 的倍数,当前非法维度: {bad}")
raise ValueError(f"VoxelMorph 当前 U-Net 建议三维尺寸均为 32 的倍数,当前非法维度: {bad}")
return shape # type: ignore[return-value]
@@ -324,4 +324,3 @@ def main(argv: Iterable[str] | None = None) -> None:
if __name__ == "__main__":
main()