Skip to content

Latest commit

 

History

History
149 lines (108 loc) · 3.63 KB

File metadata and controls

149 lines (108 loc) · 3.63 KB

INSTALL.md

Agent Runbook for Codex and Claude Code

OpenAI Codex Claude Code

This file is written for terminal coding agents such as OpenAI Codex and Anthropic Claude Code. It provides the exact steps needed to reproduce the VoxelOpt abdomen CT registration result without touching unrelated files.

Ground Rules for Agents

  • Work from the repository root.
  • Do not commit abdomenreg/, logs_abct/, .npy, .npz, .nii, or .nii.gz files.
  • Keep the public source surface focused on VoxelOpt: get_unet_features.py, test_abdomen.py, abdomenreg_loader.py, costVolComplex.py, and the metric/warping utilities.
  • Prefer a one-pair smoke test before the full 42-pair evaluation.
  • Use one GPU at a time with --gpu_id; this repo does not need multi-GPU launchers.

1. Create Environment

conda create -n voxelopt python=3.9 -y
conda activate voxelopt

Install PyTorch for the target CUDA version from the official PyTorch selector:

https://pytorch.org/get-started/locally/

Then install Python dependencies:

pip install -r requirements.txt

2. Place Data

Download the preprocessed abdominal CT registration data:

https://www.dropbox.com/scl/fo/1ri37zp2awc1e218p0zjx/AHw9tXM-wowNqT8WzG6Uq5c?rlkey=ppgyoll7vzzg6hgdz8uzt9h7q&st=drein7eg&dl=0

The repository root should look like:

VoxelOpt/
  abdomenreg/
    img/img0001.nii.gz ... img0030.nii.gz
    label/label0001.nii.gz ... label0030.nii.gz
  src/
    unet.pth

The default scripts use the test split subjects 0024 to 0030.

3. Extract Feature Maps

python src/get_unet_features.py --data_path ./abdomenreg --split test --gpu_id 0 --overwrite

Expected generated files:

abdomenreg/fea/img0024.npy
...
abdomenreg/fea/img0030.npy

4. Smoke Test

Run one ordered pair before launching the full evaluation:

python src/test_abdomen.py --data_path ./abdomenreg --gpu_id 0 --max_pairs 1

Expected behavior:

  • It reports Dataset size: 42.
  • It writes logs_abct/results_ks1_half1_ada1_foundation_n1.csv.
  • The first pair should complete without CUDA out-of-memory.

5. Full Table 1 Reproduction

python src/test_abdomen.py --data_path ./abdomenreg --gpu_id 0

Expected output CSV:

logs_abct/results_ks1_half1_ada1_foundation.csv

Expected metrics are approximately:

Dice:  58.5%
HD95:  18.5
SDLogJ: 0.21

6. Useful Agent Prompts

For Codex or Claude Code:

Read README.md and INSTALL.md. Verify the VoxelOpt reproduction setup without
committing generated data. First run the one-pair smoke test, then summarize
whether the full 42-pair command is ready.
Run feature extraction for abdomenreg test subjects and then run the VoxelOpt
Table 1 evaluation on GPU 0. Do not modify source files unless a command fails;
if it fails, inspect the traceback and make the smallest fix.

7. Cleanup Before Commit

Generated outputs should stay untracked:

git status --short

If present, these should not be committed:

abdomenreg/
logs_abct/
__pycache__/
*.npy
*.npz
*.nii.gz