Views
No views yet
| Path | Description |
|---|---|
OM_train*.py | Training entrypoints (single-/2-/3-mode variants, CUDA + Intel XPU) |
OM_aug*.py, OM_reg*.py, OM_contrastive*.py | Inference / augmentation / registration / contrastive scripts |
Diffusion/ | DeformDDPM core: diffuser.py, networks, losses, spatial utils |
OMorpher/ | Higher-level model wrapper |
Dataloader/ | Multi-modality dataloaders + dataset mappings (16 datasets) |
Config/ | YAML training/inference configs |
Scripts/ | Auxiliary scripts (registration, evaluation) |
tests/ | Pytest suite for OMorpher and loss functions |
bash_*.sh, *.slurm | SLURM submission scripts (CUDA + Intel XPU/Dawn) |
Models/all_om_net/000110_all_om_net.pth | Trained checkpoint — production multi-modal recmulmodmutattnnet (epoch 110, ~3.0 GB) |
Models/all_recmulmodmutattnnet/000010_all_recmulmodmutattnnet.pth | Earlier recmulmodmutattnnet run (epoch 10, ~906 MB) |
Note Only the final checkpoint of each training run is shipped — intermediate epochs and thebert_large_uncasedweights are not bundled. Downloadbert-large-uncasedfrom the official Hugging Face repo if you need the contrastive text encoder.
1git clone https://huggingface.co/DRDMsig/Omini3D
2cd Omini3D
3pip install -r requirements.txtintel-extension-for-pytorch build before installing the rest of the requirements.1# Single-mode diffusion
2CUDA_VISIBLE_DEVICES=0 python OM_train.py -C Config/config_om.yaml
3
4# Dual mode (diffusion + registration)
5CUDA_VISIBLE_DEVICES=0,1 python OM_train_2modes.py -C Config/config_om.yaml
6
7# Triple mode (diffusion + contrastive + registration)
8CUDA_VISIBLE_DEVICES=0,1 python OM_train_3modes.py -C Config/config_om.yaml
9
10# Intel XPU (single node)
11sbatch bash_train_single_node.sh1# Augmentation / restoration with a trained model
2python OM_aug.py -C Config/config_om.yaml
3
4# Paired registration
5python OM_reg.py -C Config/config_om.yaml
6
7# Flexible-resolution registration
8python OM_reg_flexres.py -C Config/config_om.yaml1import torch
2from Diffusion.networks import get_net
3
4# Production network (multi-modal recmulmodmutattnnet)
5net = get_net("recmulmodmutattnnet")
6
7# Production checkpoint (epoch 110)
8ckpt_path = "Models/all_om_net/000110_all_om_net.pth"
9# Or earlier run: "Models/all_recmulmodmutattnnet/000010_all_recmulmodmutattnnet.pth"
10
11state = torch.load(ckpt_path, map_location="cpu")
12net.load_state_dict(state["model"] if "model" in state else state)
13net.eval()Config YAML → DataLoader(s) → DeformDDPM(Network, STN) → Loss → CheckpointDeformDDPM (Diffusion/diffuser.py) — forward/reverse diffusion over deformation vector fields (DVFs); multi-scale DDFs at control-point ratios [4, 8, 16, 32, 64].Diffusion/networks.py) — selectable via get_net(name):
recmulmodmutattnnet — current production multi-modal multi-head-attention net (used by 000110_all_om_net.pth)recmutattnnet, recmutattnnet_contrastive, recresacnet, defrecmutattnnetSTN — Spatial Transformer for differentiable warping; composes deformations as comp_ddf = dvf + stn(ddf, dvf).Diffusion/losses.py, losses_ncc0.py) — Grad, LNCC, LMSE, NCC, MRSE, RMSE.Dataloader/nifty_mappings/ contains pre-computed mappings for 16 public medical-imaging datasets, including:
AbdomenAtlas, AbdomenCT-1k, BraTS 2019/2020/2021, MSD, OASIS-1/2, OAI-ZIB, MnMs, Kaggle OSIC, TotalSegmentator (CT+MRI), PSMA-FDG-PET-CT-Lesion, CIA.1@article{omnimorph,
2 title = {OmniMorph: Deform All-in-One Framework for Medical Image Generation,
3 Restoration and Registration via Conditional Deformation-Recovery
4 Diffusion Models},
5 author = {Zheng, J. and Mo, M. and others},
6 year = {2025}
7}LICENSE.