Files
Voxelmorph_Head_CT/config.py

33 lines
1.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""项目级默认配置。
这些值只作为命令行和 Web 界面的默认项。真正运行时仍可通过参数覆盖,
便于把同一套代码迁移到其他患者或其他机器。
"""
from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parent
DATA_ROOT = PROJECT_ROOT / "Data"
DEFAULT_FIXED_DICOM_DIR = DATA_ROOT / "患者1-平扫CT"
DEFAULT_MOVING_DICOM_DIR = DATA_ROOT / "患者1-仰头CT"
OUTPUT_ROOT = PROJECT_ROOT / "outputs"
NIFTI_DIR = OUTPUT_ROOT / "nifti"
PREPROCESSED_DIR = OUTPUT_ROOT / "preprocessed"
CHECKPOINT_DIR = OUTPUT_ROOT / "checkpoints"
INFERENCE_DIR = OUTPUT_ROOT / "inference"
DEFAULT_MOVING_NIFTI = PREPROCESSED_DIR / "patient1_moving_preprocessed.nii.gz"
DEFAULT_FIXED_NIFTI = PREPROCESSED_DIR / "patient1_fixed_preprocessed.nii.gz"
DEFAULT_CHECKPOINT = CHECKPOINT_DIR / "vxm_head_ct_patient1.pt"
# VoxelMorph 的 3D U-Net 多次下采样,三维尺寸建议均为 16 的倍数。
DEFAULT_TARGET_SHAPE = (256, 256, 352) # NIfTI 轴顺序: X, Y, Z
DEFAULT_TARGET_SPACING = (1.0, 1.0, 1.0) # mm, X/Y/Z
# 颈部软组织/气道观察常用窗口W=400, L=40。
DEFAULT_WINDOW_WIDTH = 400.0
DEFAULT_WINDOW_LEVEL = 40.0