From b6fa62a763d893abc0a21ea74b7b767e1e96647f Mon Sep 17 00:00:00 2001 From: Furen Xiao Date: Fri, 25 Sep 2026 16:00:37 +0800 Subject: [PATCH] feat: initial project structure Add .gitignore, AGENTS.md, scripts directory, and src directory to initialize the repository. --- .gitignore | 5 + AGENTS.md | 23 ++++ scripts/01_build_ntuh_manifest.py | 54 ++++++++ scripts/02_build_m6_dataset.py | 147 +++++++++++++++++++++ scripts/03_scan_lee_t1c.py | 175 +++++++++++++++++++++++++ scripts/04_reconstruct_lee.py | 190 +++++++++++++++++++++++++++ scripts/05_build_splits.py | 121 +++++++++++++++++ scripts/06_pseudo_label.py | 211 ++++++++++++++++++++++++++++++ scripts/07_train.py | 37 ++++++ scripts/08_eval.py | 38 ++++++ scripts/09_run_iterative.py | 133 +++++++++++++++++++ scripts/preprocess.py | 114 ++++++++++++++++ src/common.py | 191 +++++++++++++++++++++++++++ src/dataset.py | 102 +++++++++++++++ src/losses.py | 35 +++++ src/training.py | 181 +++++++++++++++++++++++++ src/unet3d.py | 48 +++++++ 17 files changed, 1805 insertions(+) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 scripts/01_build_ntuh_manifest.py create mode 100644 scripts/02_build_m6_dataset.py create mode 100644 scripts/03_scan_lee_t1c.py create mode 100644 scripts/04_reconstruct_lee.py create mode 100644 scripts/05_build_splits.py create mode 100644 scripts/06_pseudo_label.py create mode 100644 scripts/07_train.py create mode 100644 scripts/08_eval.py create mode 100644 scripts/09_run_iterative.py create mode 100644 scripts/preprocess.py create mode 100644 src/common.py create mode 100644 src/dataset.py create mode 100644 src/losses.py create mode 100644 src/training.py create mode 100644 src/unet3d.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..142c56b --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +data/ +runs/ +results/ +logs/ +__pycache__/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..747b13f --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,23 @@ +# AGENTS.md + +## Environment + +This project uses a conda environment named `longitudinal` (Python 3.14). + +Activate with: + +```bash +source /opt/conda/etc/profile.d/conda.sh && conda activate longitudinal +``` + +Key packages: torch 2.14 (+cu126), torchvision, numpy, scipy, pandas, scikit-learn, scikit-image, matplotlib, nibabel, SimpleITK. + +## Project + +Longitudinal (repeated-measures) analysis of medical imaging data. Repo is at an early stage — see README.md for any project notes. + +## Conventions + +- All Python commands must run inside the `longitudinal` conda environment. +- GPU is available (CUDA 12.6); use `torch.device('cuda')` when appropriate. +- No lint/test tooling is configured yet; run scripts directly with `python